From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 4ACC0593A for ; Wed, 22 Oct 2014 18:09:19 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 22 Oct 2014 09:10:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,769,1406617200"; d="scan'208";a="618603069" Received: from plxs0284.pdx.intel.com ([10.25.97.128]) by fmsmga002.fm.intel.com with ESMTP; 22 Oct 2014 09:10:02 -0700 Received: from plxv1142.pdx.intel.com (plxv1142.pdx.intel.com [10.25.98.49]) by plxs0284.pdx.intel.com with ESMTP id s9MGA2sp018408; Wed, 22 Oct 2014 09:10:02 -0700 Received: from plxv1142.pdx.intel.com (localhost [127.0.0.1]) by plxv1142.pdx.intel.com with ESMTP id s9MGA2v9003073; Wed, 22 Oct 2014 09:10:02 -0700 Received: (from jbshaw@localhost) by plxv1142.pdx.intel.com with œ id s9MGA1N1002960; Wed, 22 Oct 2014 09:10:02 -0700 Date: Wed, 22 Oct 2014 09:10:01 -0700 From: Jeff Shaw To: GyuminHwang Message-ID: <20141022161001.GA18266@plxv1142.pdx.intel.com> References: <5447BCA9.8030707@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5447BCA9.8030707@gmail.com> User-Agent: Mutt/1.4.2.3i Cc: dev@dpdk.org Subject: Re: [dpdk-dev] ixgbe_recv_pkts, ixgbe_recv_pkts_bulk_alloc. what is difference? X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2014 16:09:19 -0000 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