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 AE26AB4D7 for ; Wed, 18 Feb 2015 10:35:55 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 18 Feb 2015 01:35:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,600,1418112000"; d="scan'208";a="456158436" Received: from plalor-mobl1.ger.corp.intel.com ([10.252.2.140]) by FMSMGA003.fm.intel.com with SMTP; 18 Feb 2015 01:20:48 -0800 Received: by (sSMTP sendmail emulation); Wed, 18 Feb 2015 09:35:51 +0025 Date: Wed, 18 Feb 2015 09:35:50 +0000 From: Bruce Richardson To: Olivier MATZ Message-ID: <20150218093548.GA14884@bricha3-MOBL3> References: <1424102913-18944-1-git-send-email-sergio.gonzalez.monroy@intel.com> <1424102913-18944-3-git-send-email-sergio.gonzalez.monroy@intel.com> <54E45888.7070603@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54E45888.7070603@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] Remove RTE_MBUF_REFCNT references 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: Wed, 18 Feb 2015 09:35:56 -0000 On Wed, Feb 18, 2015 at 10:16:56AM +0100, Olivier MATZ wrote: > Hi Sergio, > > On 02/16/2015 05:08 PM, Sergio Gonzalez Monroy wrote: > >This patch removes all references to RTE_MBUF_REFCNT, setting the refcnt > >field in the mbuf struct permanently. > > > >Signed-off-by: Sergio Gonzalez Monroy > > I think removing the refcount compile option goes in the right > direction. However, activating the refcount will break the applications > that reserve a private zone in mbufs. This is due to the macros > RTE_MBUF_TO_BADDR() and RTE_MBUF_FROM_BADDR() that suppose that > the beginning of the mbuf is 128 bytes (sizeof mbuf) before the > data buffer. > While I understand how the macros make certain assumptions, how does activating the refcnt specifically lead to the problems you describe? Could you explain that part in a bit more detail? Thanks, /Bruce > For RTE_MBUF_TO_BADDR(), it's relatively easy to replace it. The > mbuf pool could store the size of the private size like it's done > for mbp_priv->mbuf_data_room_size. Using rte_mempool_from_obj(m) > or m->pool, we can retrieve the mbuf pool and this value, then > compute the buffer address. > > For RTE_MBUF_FROM_BADDR(), it's more complex. We could ensure that > a backpointer to the mbuf is always located before the data buffer, > but it looks difficult to do. > > Another idea would be to add a field in indirect mbufs that stores > the pointer to the "parent" mbuf. > > Regards, > Olivier >