0

I am working on a low latency application, sending udp packets from a master to a slave. The master acts as access point sending the data directly to the slave. Mostly it is working well but sometimes data is arriving late in the slave. In order to narrow down the possible sources of the delay I want to timestamp the packets when they are sent out in the master device.

To achieve that I need a hook where I can take a timestamp right after a packet is sent out.

According to http://www.xml.com/ldd/chapter/book/ch14.html#t7 there should be an interrupt after a packet is sent out but I can't really find where the tx interrupt is serviced.

This is the driver: drivers/net/wireless/bcmdhd/dhd_linux.c

I call dhd_start_xmit(..) from another driver to send out my packet. dhd_start_xmit(..) calls dhd_sendpkt(..) and then dhd_bus_txdata(..) (in bcmdhd/dhdpcie.c) is called where the data is queued. Thats basically where I lose track of what happens after the queue is scheduled in dhd_bus_schedule_queue(..).

Question

Does someone know what happens right after a packet is physically sent out in this particular driver and maybe can point me to the piece of code.

Of course any other advice how to tackle the problem is also welcome.

Thanks

Community
  • 1
  • 1
Frode Akselsen
  • 616
  • 2
  • 8
  • 23

2 Answers2

2

In case of any network hardware and network driver these steps happen:-

1.driver have a transmit descriptor which will be in format understandable by hardware.

2.driver fill the descriptor with the current transmitting packet and send it to hardware queue to transmit .

  1. after successful transmission a interrupt is generated by hardware .

  2. this interrupt called transmission completion function in driver , which will be free the memory of previous packet and reset many things including descriptor etc.

here in line no. 1829 , you can see packet has been freeing .

PKTFREE(dhd->osh, pkt, TRUE);

Thanks

SHASHI BHUSAN
  • 612
  • 6
  • 12
1

The packet is freed in the function

static void BCMFASTPATH
dhd_prot_txstatus_process(dhd_pub_t *dhd, void * buf, uint16 msglen)

in the file dhd_msgbuf.c

with

PKTFREE(dhd->osh, pkt, TRUE);
Frode Akselsen
  • 616
  • 2
  • 8
  • 23