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 8984D2A9 for ; Thu, 30 Oct 2014 10:46:31 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 30 Oct 2014 02:55:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,284,1413270000"; d="scan'208";a="613989366" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.220.88]) by fmsmga001.fm.intel.com with SMTP; 30 Oct 2014 02:55:24 -0700 Received: by (sSMTP sendmail emulation); Thu, 30 Oct 2014 09:55:23 +0100 Date: Thu, 30 Oct 2014 09:55:23 +0000 From: Bruce Richardson To: Gyumin Message-ID: <20141030095522.GA4460@bricha3-MOBL3> References: <5451E980.2060707@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5451E980.2060707@gmail.com> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Cc: dev@dpdk.org Subject: Re: [dpdk-dev] Relationship between H/W ring and S/W ring 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: Thu, 30 Oct 2014 09:46:35 -0000 On Thu, Oct 30, 2014 at 04:32:16PM +0900, Gyumin wrote: > Hi > > I`m reading the ixgbe code especially about H/W ring and S/W ring. Is the > relationship between H/W ring and S/W ring one-to-one mapping? > As far as I know, H/W ring size is determined in the code(hard coded) while > S/W ring size is determined in port configuration time. > In the ixgbe_rx_alloc_bufs function, H/W ring header address and packet > address indicate the DMA address of S/W ring's mbuf. I understand it means > that the relationship between the H/W ring and S/W ring is one-to-one > mapping. For example, if the size of H/W ring is greater than the size of > S/W ring then some portion of H/W ring is unused. Is it correct? > > Thanks Hi, Yes, there is a 1:1 mapping between the hardware and software ring entries, and both are sized depending on the configuration parameters passed to the ring setup APIs. As you state, the HW ring contains the DMA addresses of the packet buffers, while the sw_ring contains the pointers to the original mbufs. The two rings are always kept in sync in the code. /Bruce