DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jeff Shaw <jeffrey.b.shaw@intel.com>
To: GyuminHwang <hkm73560@gmail.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] ixgbe_recv_pkts, ixgbe_recv_pkts_bulk_alloc. what is difference?
Date: Wed, 22 Oct 2014 09:10:01 -0700
Message-ID: <20141022161001.GA18266@plxv1142.pdx.intel.com> (raw)
In-Reply-To: <5447BCA9.8030707@gmail.com>

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

      reply	other threads:[~2014-10-22 16:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-22 14:18 GyuminHwang
2014-10-22 16:10 ` Jeff Shaw [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141022161001.GA18266@plxv1142.pdx.intel.com \
    --to=jeffrey.b.shaw@intel.com \
    --cc=dev@dpdk.org \
    --cc=hkm73560@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git