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 852302A5E for ; Fri, 10 Jul 2015 11:32:29 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP; 10 Jul 2015 02:32:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,446,1432623600"; d="scan'208";a="603605609" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.208.63]) by orsmga003.jf.intel.com with SMTP; 10 Jul 2015 02:32:19 -0700 Received: by (sSMTP sendmail emulation); Fri, 10 Jul 2015 10:32:17 +0025 Date: Fri, 10 Jul 2015 10:32:17 +0100 From: Bruce Richardson To: Stephen Hemminger Message-ID: <20150710093217.GB10556@bricha3-MOBL3> References: <1436485068-30609-1-git-send-email-stephen@networkplumber.org> <1436485068-30609-3-git-send-email-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1436485068-30609-3-git-send-email-stephen@networkplumber.org> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Cc: dev@dpdk.org, Stephen Hemminger Subject: Re: [dpdk-dev] [PATCH 2/2] mbuf: make sure userdata is initialized 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: Fri, 10 Jul 2015 09:32:30 -0000 On Thu, Jul 09, 2015 at 04:37:48PM -0700, Stephen Hemminger wrote: > From: Stephen Hemminger > > For applications that use m->userdata the initialization can > be a signficant (10%) performance penalty. > > Rather than taking the cache penalty of initializing userdata > in the receive handling, do it in the place where mbuf is > already cache hot and being setup. Should the management of the userdata field not be the responsibility of the app itself, rather than having the PMD manage it? If the PMD does manage the userdata field, I would suggest taking the approach of having the field cleared by the mbuf library on free, rather than on RX. > > Signed-off-by: Stephen Hemminger > --- > drivers/net/cxgbe/sge.c | 1 + > drivers/net/e1000/em_rxtx.c | 2 ++ > drivers/net/e1000/igb_rxtx.c | 2 ++ > drivers/net/enic/enic_main.c | 2 ++ > drivers/net/fm10k/fm10k.h | 1 + > drivers/net/i40e/i40e_rxtx.c | 4 ++++ > drivers/net/ixgbe/ixgbe_rxtx.c | 4 ++++ > drivers/net/ixgbe/ixgbe_rxtx_vec.c | 1 + > drivers/net/virtio/virtio_rxtx.c | 3 +++ > drivers/net/vmxnet3/vmxnet3_rxtx.c | 1 + > drivers/net/xenvirt/rte_eth_xenvirt.c | 1 + > lib/librte_mbuf/rte_mbuf.h | 1 + > 12 files changed, 23 insertions(+) > > diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec.c b/drivers/net/ixgbe/ixgbe_rxtx_vec.c > index 912d3b4..d73d8dc 100644 > --- a/drivers/net/ixgbe/ixgbe_rxtx_vec.c > +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec.c > @@ -742,6 +742,7 @@ ixgbe_rxq_vec_setup(struct ixgbe_rx_queue *rxq) > > mb_def.nb_segs = 1; > mb_def.data_off = RTE_PKTMBUF_HEADROOM; > + mb_def.userdata = NULL; > mb_def.port = rxq->port_id; > rte_mbuf_refcnt_set(&mb_def, 1); > This won't actually work for the vector PMD. The userdata field is not covered by the "rearm_data" part of the mbuf. /Bruce