DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] ixgbe_recv_pkts, ixgbe_recv_pkts_bulk_alloc. what is difference?
@ 2014-10-22 14:18 GyuminHwang
  2014-10-22 16:10 ` Jeff Shaw
  0 siblings, 1 reply; 2+ messages in thread
From: GyuminHwang @ 2014-10-22 14:18 UTC (permalink / raw)
  To: dev

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] ixgbe_recv_pkts, ixgbe_recv_pkts_bulk_alloc. what is difference?
  2014-10-22 14:18 [dpdk-dev] ixgbe_recv_pkts, ixgbe_recv_pkts_bulk_alloc. what is difference? GyuminHwang
@ 2014-10-22 16:10 ` Jeff Shaw
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Shaw @ 2014-10-22 16:10 UTC (permalink / raw)
  To: GyuminHwang; +Cc: dev

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-10-22 16:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-22 14:18 [dpdk-dev] ixgbe_recv_pkts, ixgbe_recv_pkts_bulk_alloc. what is difference? GyuminHwang
2014-10-22 16:10 ` Jeff Shaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).