From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Richardson Subject: Re: [PATCH 2/2] ixgbe: don't override mbuf buffer length Date: Thu, 4 Dec 2014 17:19:24 +0000 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 Cc: "dev-VfR2kkLFssw@public.gmane.org" To: Jean-Mickael Guerin Return-path: Content-Disposition: inline In-Reply-To: <548095CD.5080607-pdR9zngts4EAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 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