From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id B7B4AC318 for ; Tue, 16 Jun 2015 10:20:12 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 16 Jun 2015 01:20:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,624,1427785200"; d="scan'208";a="588653632" Received: from bricha3-mobl3.ger.corp.intel.com ([10.243.20.22]) by orsmga003.jf.intel.com with SMTP; 16 Jun 2015 01:20:11 -0700 Received: by (sSMTP sendmail emulation); Tue, 16 Jun 2015 09:20:08 +0025 Date: Tue, 16 Jun 2015 09:20:08 +0100 From: Bruce Richardson To: Stephen Hemminger Message-ID: <20150616082008.GA8644@bricha3-MOBL3> References: <557EECFF.3090402@6wind.com> <20150615152346.GC580@bricha3-MOBL3> <2601191342CEEE43887BDE71AB97725836A0A8FB@irsmsx105.ger.corp.intel.com> <20150615153943.GD580@bricha3-MOBL3> <2601191342CEEE43887BDE71AB97725836A0A91C@irsmsx105.ger.corp.intel.com> <20150615160208.GE580@bricha3-MOBL3> <2601191342CEEE43887BDE71AB97725836A0A952@irsmsx105.ger.corp.intel.com> <20150615162259.GA384@bricha3-MOBL3> <2601191342CEEE43887BDE71AB97725836A0AA03@irsmsx105.ger.corp.intel.com> <20150615134726.65feca71@urahara> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150615134726.65feca71@urahara> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "dev@dpdk.org" , "Damjan Marion \(damarion\)" Subject: Re: [dpdk-dev] rte_mbuf.next in 2nd cacheline 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: Tue, 16 Jun 2015 08:20:13 -0000 On Mon, Jun 15, 2015 at 01:47:26PM -0700, Stephen Hemminger wrote: > On Mon, 15 Jun 2015 18:34:13 +0000 > "Ananyev, Konstantin" wrote: > > > > > > > > -----Original Message----- > > > From: Richardson, Bruce > > > Sent: Monday, June 15, 2015 5:23 PM > > > To: Ananyev, Konstantin > > > Cc: Olivier MATZ; dev@dpdk.org; Damjan Marion (damarion) > > > Subject: Re: [dpdk-dev] rte_mbuf.next in 2nd cacheline > > > > > > On Mon, Jun 15, 2015 at 05:10:44PM +0100, Ananyev, Konstantin wrote: > > > > > > > > > > > > > -----Original Message----- > > > > > From: Richardson, Bruce > > > > > Sent: Monday, June 15, 2015 5:02 PM > > > > > To: Ananyev, Konstantin > > > > > Cc: Olivier MATZ; dev@dpdk.org; Damjan Marion (damarion) > > > > > Subject: Re: [dpdk-dev] rte_mbuf.next in 2nd cacheline > > > > > > > > > > On Mon, Jun 15, 2015 at 04:59:55PM +0100, Ananyev, Konstantin wrote: > > > > > > > > > > > > > > > > > > > > > > > > As I can see, vector TX is the only one that calls __rte_pktmbuf_prefree_seg() directly. > > > > > > All others use rte_pktmbuf_free_seg(), that does ' m->next = NULL' anyway. > > > > > > For vector TX - yes, need to verify that it would not introduce a slowdown. > > > > > > Konstantin > > > > > > > > > > > > > > > > But if the function is only directly called from one place, and that doesn't > > > > > have a problem, why would we bother making any change at all? > > > > > > > > > > > > For future usages? > > > > But sure, if you believe that we can safely remove 'm->next = NULL' at RX path, > > > > without any changes in the __rte_pktmbuf_prefree_seg() - > > > > that seems fine to me. > > > > Konstantin > > > > > > > > > > If we find it's not safe, we can add in the change to __rte_pktmbuf_prefree_seg > > > as you suggest. > > > > > > One other question: based on this, do you think it's safe to also remove the > > > assignment to NULL from the pktmbuf_alloc function? I suspect it should be safe, and > > > that should help any traffic-generator type applications that use that function > > > extensively. > > > > So it will be setup to NULL, either by: > > - mbuf constructor. > > - TX full-path free descriptors code. > > - upper layer code that uses 'next' pointer explicitly. > > ? > > > > I can't come-up with some breakage scenario off-hand. > > But that means that we have to should avoid resetting tx_offload in pktmbuf_alloc() too, right? > > Otherwise there probably wouldn't be any real gain. > > Konstantin > > > > > > > > /Bruce > > > > > > The issue is when mbuf is used once by something and it sets it to non-NULL > packet is sent then freed. > then the free packet is picked up by one of the drivers using "fast path" Rx code. > > IMHO the "fast path" Rx code has to go away. All the special allocation code > should call rte_pktmuf_reset and then only set the fields that are special > for the received packet. The compiler should be able to remove the redundant > stores, and it would prevent bugs I am seeing where some fields are not set > in some drivers. Is the better option here not to just fix the drivers rather than making the fast-path RX code go away? Can you give us a report out on what fields are not getting correctly set, and when using what drivers, and we can look and see where our gaps in coverage are? /Bruce