Multiple TX queue support in nic driver

Naresh gbal.naresh at gmail.com
Thu Sep 15 14:57:00 UTC 2011


Hi All,

I am working on a 10G Ethernet driver.  I have a requirement to support multiple TX queues. I looked into IXGBE and CXGB drivers for reference, I have some questions regarding the implementation.

1) For supporting multiple TXQs, I see the above mentioned drivers create a ring buffer in the driver for each hardware TX queue, and queue the packets from stack to the ring buffer before queueing on the hardware queue. I don't understand why to create a ring buffer for supporting multiple TXQS. There might be a very good reason for them to do that way, but I am unable to get that.

Is it ok to queue the packets to hardware queue directly based on the flowid supplied in the mbuf  packet header in if_transmit routine ?

2) Regarding flowid, for the first TX packet the flowid is not set and the packet goes out on the default TX queue and when the corresponding RX response comes to hardware it queues   the packet to appropriate RXQ based on the rss hash. The driver then before posting RX packet to stack it should set the flowid in packet to RXQ index.
After that the TX packets from stack for that TCP connection will come with flowid supplied by us. Is this understanding correct ?

Can some one please help me on this?

Thank you all for being patient in reading this long post.

Thanks,
Naresh.


More information about the freebsd-drivers mailing list