[dpdk-dev] ixgbe_recv_pkts, ixgbe_recv_pkts_bulk_alloc. what is difference?

Jeff Shaw jeffrey.b.shaw at intel.com
Wed Oct 22 18:10:01 CEST 2014


On Wed, Oct 22, 2014 at 11:18:17PM +0900, GyuminHwang wrote:
> Hi all
> 
> I have several questions about ixgbe_rxtx.c especially Tx and Rx function.
> What is the difference between ixgbe_recv_pkts and
> ixgbe_recv_pkts_bulk_alloc? I already know the earlier function is
> non-bulk function and the later function is bulk function. But I want to
> know is the mechanism of these two functions, and the role of H/W ring
> and S/W ring in each function.
As you mentioned, the main difference is that the bulk_alloc version allocates packet buffers in bulk (using rte_mempool_get_bulk) while the ixgbe_recv_pkts function allocates a single buffer at a time to replace the one which was just used to receive a frame.  Another major difference with the bulk_alloc version is that the descriptor ring (aka H/W ring) is scanned in bulk to determine if multiple frames are available to be received.  The resulting performance is higher than if operations were done one at a time, as is teh case with the ixgbe_recv_pkts function.  The drawback of using the bulk_alloc function is that it does not support more than one descriptor per frame, so you cannot use it if you are configured to receive packets greater than 2KB in size.

The H/W ring is the hardware descriptor ring on the NIC.  This is where descriptors are read/written.  There are plenty of details in section 7.1 of the Intel(R) 82599 10 Gigabit Ethernet Controller datasheet.  As for the software ring, this is where pointers to mbufs are stored.  You can think of the h/w ring as storing descriptors, and is used for controlling the NIC behavior, while the s/w ring is for storing buffer pointers.  The sw_ring[0] contains a pointer to the buffer to be used for hw_ring[0].

-Jeff


More information about the dev mailing list