From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 65F3B1BACA for ; Fri, 12 Oct 2018 18:40:09 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id D738721F6F; Fri, 12 Oct 2018 12:40:08 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 12 Oct 2018 12:40:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=jSHTVYKuv4126nozczlD5THrtkQvAOKj9R7SyNpwjco=; b=bwC5FQGti+1S PEAKWzzZ5woB4qdavZojSuU6SyS9k/A/jM3GsuEP2HnpsOnTtstaAVAoMzk2mMw4 HYprLcvvxbiEwb/HczkIBTHiDRHFrkYUUa0WKqgejCiv/yjIg212ZawE+Vk+SM7B fQo0WWSFZ5aE/zxTMDw2rTBVbQbR+tk= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=jSHTVYKuv4126nozczlD5THrtkQvAOKj9R7SyNpwj co=; b=RXZBizwwT4cHp9o2vSxuyrsuOp7idoYFRBql1F9tf2ZqMTfEBP8iOV6an Kpiekfu9oXssbFRQ7rulAo5O+64tjPI6c5ZHB9wWaWdgDEURFYuUzPgiGRZ7GV3o F+CFNl3k5pht+FE8tqp+2Tfdejy4q3lbNczcuMeWeeskcwbbPkIJOfKZfBwWaiAy /2mRM2Gg6svbx+vcTuqfcDsoSvEadgyB1TkzkaBGakxItSc//dNNhJoB+B8b66WK +cT/N866ns7GtYATvjr5ROnY94vpI/zPOR98fbYHlVeeorIi9Kelji2GvZSc+XJx RjEbkK+ewWSEpeTShkgl1E/54t2ww== X-ME-Sender: X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 5635FE4430; Fri, 12 Oct 2018 12:40:06 -0400 (EDT) From: Thomas Monjalon To: Andrew Rybchenko Cc: dev@dpdk.org, gaetan.rivet@6wind.com, ophirmu@mellanox.com, qi.z.zhang@intel.com, ferruh.yigit@intel.com, "Ananyev, Konstantin" , Ajit Khaparde , Somnath Kotur , Rahul Lakkireddy Date: Fri, 12 Oct 2018 18:40:04 +0200 Message-ID: <3669676.Ndm0HoEbJM@xps> In-Reply-To: References: <20180907230958.21402-1-thomas@monjalon.net> <20181011210251.7705-2-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v4 1/4] ethdev: rename memzones allocated for DMA X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Oct 2018 16:40:09 -0000 12/10/2018 09:53, Andrew Rybchenko: > On 10/12/18 12:02 AM, Thomas Monjalon wrote: > > The helper rte_eth_dma_zone_reserve() is called by PMDs > > when probing a new port. > > It creates a new memzone with an unique name. > > The name of this memzone was using the name of the driver > > doing the probe. > > > > In order to avoid assigning the driver before the end of the probing > > (next patch), the driver name is removed from these memzone names. > > The ethdev name (data->name) is not used because it may be too long > > and may be not set at this stage of probing. > > > > Syntax of old name: ___ > > Syntax of new name: eth_p_q_ > > > > Signed-off-by: Thomas Monjalon > > --- > > lib/librte_ethdev/rte_ethdev.c | 5 ++--- > > 1 file changed, 2 insertions(+), 3 deletions(-) > > > > diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c > > index ef99f7068..ec443def5 100644 > > --- a/lib/librte_ethdev/rte_ethdev.c > > +++ b/lib/librte_ethdev/rte_ethdev.c > > @@ -3441,9 +3441,8 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *dev, const char *ring_name, > > char z_name[RTE_MEMZONE_NAMESIZE]; > > const struct rte_memzone *mz; > > > > - snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d", > > - dev->device->driver->name, ring_name, > > - dev->data->port_id, queue_id); > > + snprintf(z_name, sizeof(z_name), "eth_p%d_q%d_%s", > > + dev->data->port_id, queue_id, ring_name); > > > > mz = rte_memzone_lookup(z_name); > > if (mz) > > LGTM, but I've found more places where the pattern is duplicate > and testpmd frightens me: > - app/test-pmd/config.c ring_dma_zone_lookup() which is used > to look at descriptors (looks like Intel specific since has > RTE_LIBRTE_I40E_16BYTE_RX_DESC conditional code) >>From what I see there is no access to rte_device.driver here, except one in exit function. > - drivers/net/bnx2x/bnx2x_rxtx.c > - drivers/net/cxgbe/sge.c (few times) In bnx2x and cxgbe, it is accessed after probing (queue setup or configure steps). > I've not dig why bnx2x and cxgbe do not use rte_eth_dma_zone_reserve(). Yes may be interesting to standardize them. I will add them to this patch.