From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <thomas@monjalon.net> Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 278471BB2E for <dev@dpdk.org>; Fri, 12 Oct 2018 19:18:10 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 9AD9C22105; Fri, 12 Oct 2018 13:18:09 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 12 Oct 2018 13:18:09 -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=2XROSzU52EGouKoesT2BDoVZ/CfAup+jFy3cO0IYdDc=; b=T6mbPppwpGKW b3wqoJoXFRCANu4Jk6/ZSorTwYSAxqd+4d/o2g7RZmXY2AOphO8U0lTqTviw/8D0 4xpF18JuXVXBTEpkNM/x30iDk5v2JEnDyXm2KNvDRGNFJZUOO//ZPKal7oUfJjQ/ VJiNjcSGiUDREIanTwNVP1+1tgj1zSg= 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=2XROSzU52EGouKoesT2BDoVZ/CfAup+jFy3cO0IYd Dc=; b=f3i9GmvdvgjJV3gwQUDLd/m1hhU/x7pi1lXkk7kAYNM0QPIkvfMi3liqt UXVV0EeRRn6rkojU3lu8mjSHEeZ8V3wx3VAI+fy+fTcoqkzQfDXSeEZ8eMhOZB1l dwjuNNWC8zR9+6I6IXYE7pGTfESmNyZmAzwqGuYY4YfVB0pfiQSOvVTILHgUOc+j CmwRSHRJIKKQOqB1ZfMN1h29hZrubs+f3MeOgllEkigssr7texPbtjMuizJqAYtb tCg2ZekYXMsLqO2xOBKq7PnRP5bPsr5t3RxtuvER0bzhZPR6eLFmPmPOn2Mx/T27 Z0IcwG+MzVK6nKkhUKdF1tLO2+VgA== X-ME-Sender: <xms:UNfAW859LN2rpfenkR8nNy7OjjjTUeajj5qlAuENLRU__t7lHuTZfA> X-ME-Proxy: <xmx:UNfAW3fzbTUKO2jTyhiBWw4lalYGOiSwoF4zUO7ZjTk01Ho_KcFepg> <xmx:UNfAWxg19YkrQqrGPa4WwbmqSUFBQhcNYHqgBjKTuWRtHT7kc-yLQg> <xmx:UNfAW666rYCvTEKdKw0_-yHG_sdbmzZ9ifHOiN8ZRXJ9lM6PAgewBA> <xmx:UNfAW29mwlsgMSwSBLrQzeUf2DxUdwO5kL7KRHIiYxG3Z7LKosYpaw> <xmx:UNfAW4sdvi1EE4elUFFvXf6tM21KghQNBsoX0S_oJarK18-kMlysMA> <xmx:UdfAW078vTW3JIGSkCiHWRKQq_Gt92DMGm6pr0KQKfYRiov-kszQRg> Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id E1C75E4532; Fri, 12 Oct 2018 13:18:06 -0400 (EDT) From: Thomas Monjalon <thomas@monjalon.net> To: Andrew Rybchenko <arybchenko@solarflare.com> Cc: dev@dpdk.org, gaetan.rivet@6wind.com, ophirmu@mellanox.com, qi.z.zhang@intel.com, ferruh.yigit@intel.com, "Ananyev, Konstantin" <konstantin.ananyev@intel.com>, Ajit Khaparde <ajit.khaparde@broadcom.com>, Somnath Kotur <somnath.kotur@broadcom.com>, Rahul Lakkireddy <rahul.lakkireddy@chelsio.com> Date: Fri, 12 Oct 2018 19:18:05 +0200 Message-ID: <2096271.VzXizFIdQq@xps> In-Reply-To: <a2b1c00e-6c7e-61b3-7e40-5e4127b3ab4e@solarflare.com> References: <20180907230958.21402-1-thomas@monjalon.net> <82229acf-1ade-6056-7aaf-d05ffead0792@solarflare.com> <a2b1c00e-6c7e-61b3-7e40-5e4127b3ab4e@solarflare.com> 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 <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> X-List-Received-Date: Fri, 12 Oct 2018 17:18:10 -0000 12/10/2018 18:46, Andrew Rybchenko: > On 10/12/18 7:42 PM, Andrew Rybchenko wrote: > > On 10/12/18 7:40 PM, Thomas Monjalon wrote: > >> 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: <driver>_<ring>_<port>_<queue> > >>>> Syntax of new name: eth_p<port>_q<queue>_<ring> > >>>> > >>>> Signed-off-by: Thomas Monjalon <thomas@monjalon.net> > >>>> --- > >>>> 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. > > > > Yes, but testpmd will fail to find the memzone and command to > > take a look at descriptors will be broken. > > > > May be it is already broken etc. I think someone from Intel should > > comment it. > > Potentially the following drivers may use it: > $ git grep -w \"rx_ring\" drivers/net/ > drivers/net/avf/avf_rxtx.c:380: mz = rte_eth_dma_zone_reserve(dev, > "rx_ring", queue_idx, > drivers/net/axgbe/axgbe_rxtx.c:91: dma = > rte_eth_dma_zone_reserve(dev, "rx_ring", queue_idx, size, 12 > drivers/net/cxgbe/sge.c:1878: fwevtq ? "fwq_ring" : "rx_ring", > drivers/net/e1000/em_rxtx.c:1437: rz = > rte_eth_dma_zone_reserve(dev, "rx_ring", queue_idx, rsize, > drivers/net/e1000/igb_rxtx.c:1734: rz = > rte_eth_dma_zone_reserve(dev, "rx_ring", queue_idx, size, > drivers/net/fm10k/fm10k_ethdev.c:1878: mz = > rte_eth_dma_zone_reserve(dev, "rx_ring", queue_id, > drivers/net/i40e/i40e_rxtx.c:1853: rz = > rte_eth_dma_zone_reserve(dev, "rx_ring", queue_idx, > drivers/net/ixgbe/ixgbe_rxtx.c:2966: rz = > rte_eth_dma_zone_reserve(dev, "rx_ring", queue_idx, > drivers/net/nfp/nfp_net.c:1516: tz = rte_eth_dma_zone_reserve(dev, > "rx_ring", queue_idx, Excuse me, I really don't understand what you mean.