From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 1E8EF8032 for ; Thu, 4 Dec 2014 18:30:36 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 04 Dec 2014 09:19:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,516,1413270000"; d="scan'208";a="632751597" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.221.34]) by fmsmga001.fm.intel.com with SMTP; 04 Dec 2014 09:19:25 -0800 Received: by (sSMTP sendmail emulation); Thu, 04 Dec 2014 17:19:24 +0025 Date: Thu, 4 Dec 2014 17:19:24 +0000 From: Bruce Richardson To: Jean-Mickael Guerin Message-ID: <20141204171924.GB7732@bricha3-MOBL3> References: <1417703181-23093-1-git-send-email-jean-mickael.guerin@6wind.com> <20141204151500.GC9300@bricha3-MOBL3> <2601191342CEEE43887BDE71AB977258213BCA80@IRSMSX105.ger.corp.intel.com> <4349408.QROSJAq1DS@xps13> <2601191342CEEE43887BDE71AB977258213BCAE4@IRSMSX105.ger.corp.intel.com> <2601191342CEEE43887BDE71AB977258213BCB11@IRSMSX105.ger.corp.intel.com> <20141204165847.GA7732@bricha3-MOBL3> <548095CD.5080607@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <548095CD.5080607@6wind.com> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH 2/2] ixgbe: don't override mbuf buffer length 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, 04 Dec 2014 17:30:37 -0000 On Thu, Dec 04, 2014 at 06:11:41PM +0100, Jean-Mickael Guerin wrote: > >>Which makes me think, that we probably shouldn't overwrite buf_len by rxq->mbuf_initializer. > >> > >I believe that it is perfectly safe to do so. All buffers from a mempool are meant > >to be the same size, therefore reading the length of one buffer should tell you > >what size all buffers are. If we do hit a scenario where we do need to support > >variable size buffers from a single mempool, we can do that via the older unoptimized > >code paths, I think, since it's a definite edge case. > > > > I agree, and there is a place to store some values unique for all mbufs in a > pool: > > struct rte_pktmbuf_pool_private { > uint16_t mbuf_data_room_size; /**< Size of data space in each > mbuf.*/ > }; > > We could add a new field mbuf_buf_len here, it looks definitely better than > new callbacks in rte_mempool. > > What do you think? I think it's overkill. I like the original suggest to allocate a buffer and pull the length settings from there. Just add the checking so that if the allocation fails the whole setup fails. If we can't allocate one mbuf from a pool, it's a pretty catastrophic error that needs to be flagged ASAP. I wouldn't look to do anything up and above that. /Bruce