From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0055.outbound.protection.outlook.com [104.47.33.55]) by dpdk.org (Postfix) with ESMTP id 653A42C49 for ; Fri, 10 Mar 2017 07:58:10 +0100 (CET) Received: from CY1PR03CA0002.namprd03.prod.outlook.com (10.174.128.12) by MWHPR03MB2960.namprd03.prod.outlook.com (10.175.136.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12; Fri, 10 Mar 2017 06:58:09 +0000 Received: from BN1AFFO11FD029.protection.gbl (2a01:111:f400:7c10::142) by CY1PR03CA0002.outlook.office365.com (2603:10b6:600::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.961.17 via Frontend Transport; Fri, 10 Mar 2017 06:58:09 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; infradead.org; dkim=none (message not signed) header.d=none;infradead.org; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD029.mail.protection.outlook.com (10.58.52.184) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.947.7 via Frontend Transport; Fri, 10 Mar 2017 06:58:08 +0000 Received: from [10.232.14.39] ([10.232.14.39]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v2A6w5lO000549; Thu, 9 Mar 2017 23:58:06 -0700 To: Jan Blunck , References: <1488794430-25179-1-git-send-email-jblunck@infradead.org> <1488794430-25179-4-git-send-email-jblunck@infradead.org> From: Shreyansh Jain Message-ID: <48d78603-3ff3-cdf2-d620-dc62cb6b88b5@nxp.com> Date: Fri, 10 Mar 2017 12:33:55 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1488794430-25179-4-git-send-email-jblunck@infradead.org> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131336026890439051; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39860400002)(39450400003)(39840400002)(39850400002)(39400400002)(39380400002)(39410400002)(2980300002)(1109001)(1110001)(339900001)(189002)(377454003)(199003)(24454002)(9170700003)(36756003)(38730400002)(104016004)(189998001)(50466002)(230700001)(47776003)(106466001)(356003)(77096006)(86362001)(85426001)(31696002)(53936002)(105606002)(83506001)(6246003)(65956001)(65806001)(8936002)(81166006)(76176999)(8676002)(4001350100001)(6666003)(2950100002)(31686004)(229853002)(5660300001)(50986999)(64126003)(23746002)(97736004)(2906002)(65826007)(33646002)(305945005)(54356999); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2960; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD029; 1:MrzekRcnHFfg7zcdmZtCOUZJPb424Qoj2u9tpzokaMLc+5aQP1NLXAi+0Ib5rm/7oD4th6pm/YWg0GuW1JdojV7dMyawzYwiHtsfb7+bUbf9QG0XVDS5dmikij4EZXWXzbmBMJVdSyuMXwlR6yMS08s263W6VaCy8KfmVsCe99tMAG+xblVdHGUZUV8XBUJ3vbSbOxPCM8SyCHLN+pbuCP2gfcZ95aKy9POiZ5AT+3HEaxi8p6EMA1ZpcoNPAXWMKJNDgseZGIbnuZJAmVDVcwJSVqS2b8F5LH7yFjbgC30erRKyDSnnMCR/e5QoFLucYSBXeHfPuBdyJ0cry64aMm+5QQYP5ss7b/Dab94Un7uGNM6CxMPGKl4dBr43+jz1JJkpiVwUFZhXBDj5kHztT1EZ5MI5CwQ5QlEDWqsHQtB3YtcUmG4VQinSQxb7b47KhVjbJaOyX30dn2hCeRu+gdCt23R4nX2fam/M44g7ZTuXgKVb0IwSlNwmqtgouzJFpGSYoT6h/9TjdfSYDU92aJvZYK3N6SM+jYSNotqzcYs3Kjocn+DUIpDyN3KafnLC X-MS-Office365-Filtering-Correlation-Id: d9b7ecd6-8646-4a1d-a82b-08d46782cf78 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:MWHPR03MB2960; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2960; 3:Uh5s7eFePhX6bhIBEDhFaZmqd5QPROf7/h20/fBIJqoQXoTU8UAIt4asXxAcRyXFvakLIHccoMGmqi9N45qYeaHUhFG9jcuwmg6cDOKHQiz1cOEIEYxn3qcujbj1/eYVvRpxnu125TIFkol68bN7ypRSC2EE5P0HsIy8yKGQdr1mhMlfTfFSeA4XlyVOj7/n5sYN3fH1GtIEXv2RRJN8YBXlpWmu2ZWVBLtgC1p6kLEScNCBIfqpYlkvZ4okdF6NxRWvrlL0MJIK1UDRlQ2mdAqith05l+cMgiIIKqc0wq6t7B1MDDbB/mfanZPomk22oLyNWH273S9OwPki/pIG6qVa90GkbR4WbiHVjRcdMVO2t4/ISgth3nL2P3Ii7fkX; 25:D8/iUiOIPfbnosKvJWqwuNz1nsVtSWS8O8k16/3Mb6qcDW88vCMuIIH3MmrRd+cMWrTZ4Q5yEiH0KLkujVJGeIfut72SDU8E3vAwcNjEHtyRpM6WkPkmehK846+cmLPHW8aiySnVvipIcTZ7GpQH7dWfq0vYyW5lLVp4ItqzwvC/yyH5PX7Uwba5R6h3pFThmDImdWi0Oy5cmB3gGgSzeAypdzHCq11focxFS4Bgm+rbmo57SAvDO0Rlt1aalKZPZhOGG0ohrE0PbEEayO8MMzvk+/1giUp004HGD0pEIaVabjHVi8OeYHPJtWjjmIE83sDHMqwTXTcDzYBcqLLIHRy5Zw9KNMdFhUwjKO/BKUNmJ+9qO8PCo4Rs7qN+f2YtYfk9flpAg3CPJ4lfRlSWIzq4xLSgEjK78klCGzPZ35/ZJzDitFlzC0CniURqxzXaGX7pFcT7fzSIRbFtsXpuRA== X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2960; 31:MRSbnH2pqICiN5reBOiRr/oOjmKklo6BDb2I5c+LzCwo919e10FiQM834S3bjiY+ws89yiXo34TnO34bYPA/VhTM7OlySP9R+WnoMbqUB8IGJEML25rgB2TMGoTKd0HNBCYUplEEFWlCUR9xWxfky9bli1B5V3TeKckS187EmN3IvQULar+U5M9XsddJpi+aJkO+dbJ9+wOPdAEgPskRX871aZ5d8QrntI7s+nJL2c5wf4rmBbSHklzOLhOdPaI8c35/K2kf5NrMUDWU1Ada4g== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13023025)(13024025)(13018025)(5005006)(13015025)(13017025)(8121501046)(10201501046)(3002001)(6055026)(6096035)(20161123559025)(20161123565025)(20161123556025)(20161123563025)(20161123561025); SRVR:MWHPR03MB2960; BCL:0; PCL:0; RULEID:(400006); SRVR:MWHPR03MB2960; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2960; 4:XjcpJCH6j07JS14fstmCkKv809ENx8hP8hP4mtbxRTqJB5PdVlAhacgUyQM5olI7xwHM0quo78mHLu5xv+piQEC5VDk5ER704pl7RjWEk/Juo1Q3GRYgxCM7pz/kuUNN31SS+CT6u0GeQKhxLbJo8Lt+eKa486WvYRH6VlQa0Z/V4ZEPNPZMjL4qqX2FbL2itQDXIYgE8VPYnNa7R/RHhKBFwEuuvcXGOnqf54vlC3nQ4eqETQXzzSK2nnlCcj3OLjWHaViAKDxdfUtrwRfYM5UnrGhxo/3Ssc8ny8yVNrRep7glYL6jdYZE4KcQO/IvycWY0yA2LoPmFStbVQEJXukFLp+BXd6/Jq7AR7zOQNSM0krKqdFHoa8my5e1CqGspnUgJ7J3JAFGEMhpsVB/jJLDFLCILyJ1plrMacfS4IFnVSBFUtSQNs0B9EdKG8mrsKRmIeeCdCBkJsDMuOf74+/4fQELYmDGiLbnKlCk7Lo6QxNoLKsV98gDkDTKr6L1ncGiHox0J99iSMS2w70VJ1Tz0iX+wJly5nGo7slYcBLQDQz4ImtGav0Atj3/k4s+HC6m/Fcj57ENQza6VzaI+QzoBLeqA2rogCQRMsU4dejCvntKeVRve6DCb/lx/B6edBGte6wcoW1M4GcB1aoaqdmMb0vSO7vlSSJAGZ46VFhQMYmQHj7DNSIpEppXIikiZtpAp4vPMSwGbKkJhy8dlA== X-Forefront-PRVS: 02426D11FE X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; MWHPR03MB2960; 23:YGppIHO5WXb0/bsD85vV4kk6Jjaa5gblWarDE?= =?Windows-1252?Q?CTlw+TFvARjgfT/qSKNxtBs7ISlary3xLXlhoxHtiexZkhRZnNgM7BED?= =?Windows-1252?Q?C3H4cmytutjzH7R7zvmUmSmxGGoZkf+ckX308MKYbFn7MeBXnybShON9?= =?Windows-1252?Q?kp/Vw/z5H8ADus669l1/yYGQrdNymYiDOLRqsVhnhsmup/C1cHjPXUdn?= =?Windows-1252?Q?moj1ZV5REOsV7J2Vrq9LEdsQGC73V9DBoEfb2VFj1H0Um5knPE909M8j?= =?Windows-1252?Q?gXGx8Ceil5B5yErvLZhpAMAWKMLaEEtyBYYyKcz/bjqgnu2mHYHkuY75?= =?Windows-1252?Q?zVG//riP+NdPRTcAYPCc5FPF8pXZGE5NB3XN24qJCeSYSwQrEuGo0Bhp?= =?Windows-1252?Q?F3UDW1ggTWyFryr1ow52vkRFdk42TJ0qVbQe8xrPtYdiisdhKs1gBGz1?= =?Windows-1252?Q?gPdn89IJpH8s3KEvfwH5zh/bZc+lp5syrczrDDww5gNtw8AJCSMKg6Hv?= =?Windows-1252?Q?kBSdypAqU3yuSQFaYn8M0WZSR/RllddGgR4BILIXpm5XgZCzrRijYsCx?= =?Windows-1252?Q?57xkdtVE6FPfrPWF4NGO+6WcZLOhhPui7mTFmoZ0ArF/MrbxZPkhGwUe?= =?Windows-1252?Q?jZ/qUX4PosfFnkz6mjaBq03w8cmRrpey7bFTR9NGEeCid/j+molPRkuS?= =?Windows-1252?Q?Wbm+6G9KEuABUnvSvZx6NzmEXX9Ie+nJUOh/9cc5yUJtycpNz8O6a+Ki?= =?Windows-1252?Q?3AnkNfRZkBo3QL7Veyziv0cx69S7KsCBhazknll4+AmQ6gqGtDT+uEU9?= =?Windows-1252?Q?fMXrxDPwZMPWZXajWEfnSQJUAgu1zEnBzoirTozeDfJLgIOLcdemchRG?= =?Windows-1252?Q?eNXvSSoNE+Z/9QgyhofwZuhzanrZY6YBcrtGG0C950BtszKheHgS0uZG?= =?Windows-1252?Q?jFmSkByjmr09qeCYpqXZLQXyefQNxDYOxzqNES7UC99ELGPyom/O2v++?= =?Windows-1252?Q?9bA9dRUMcBvo+OEiaWUM6yeuICawXNsBUTaxm1qLzITNceTqKhoLFNe9?= =?Windows-1252?Q?50l0n314UM+1qhYBWghGLOnHoVlD4j+Bof/KeAPl2dkP0QNDfI8g/Hcg?= =?Windows-1252?Q?lE/Y9eoscJJ0d7grx5FPl0CGUgWcaRqCrDXID33tc4wfnF8F5nX+Lvnm?= =?Windows-1252?Q?5xy847HNLAtpQTUW3BETHQujAkmvYGHcBJb1dRKOhHGwDMkxQ9bygHKc?= =?Windows-1252?Q?UT3s0qHjNaLXF7H0tfCxgUga3ldIeHwnnYSpqKjlWGX82Rp7Of7p/DWE?= =?Windows-1252?Q?SHfDtDQ61ZXKDMW7ut2IeC99qPKUtpfhhSMvSMhUpbeAr1h7+cVN8U77?= =?Windows-1252?Q?XaGAFaz/l6wIXA0oLiZ3vE0zeXVdLeuXdTnPBh/qwGAaCo9aFB6xj/1m?= =?Windows-1252?Q?cGl/gKXUzn+Tz5XeflY6b/OF0Q9C10C+IRlBBxnPm9s9CZCbhwmFWVUO?= =?Windows-1252?Q?5xTd00=3D?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2960; 6:y7nZ8EKHbaAZwI9ATQUC15CRakNo6cqi1V6+kPKNd3hhBIij01/bRcmd1qVpVxJNMq3qm22foi79HpNM4FeLqlADC+yBkh4UkvvkrrYBB0P0MKW0zdnywzm/vTxTxkFW8dHvA4P3BouFNaQmwT+vVDT1g+J7r4ADYSGEMp5LVoqHDiADPlccEj3igDfAnhe6pbk9GiGxXrWH4SitoaD1nBta5Um26hP6crzexawMaGXdXEgGpYkPNErzMfUq+8D08dq0HnpQLEwm0XYuee2QNB7YrFo3TTfyNCvKu+U0eBW0w2sqS9CkWOoPX/IKkxmNrxRKy9isOT0S7VGjqfQBT0xmruZVD6ckg9EWG0YQlJSG1b+CEQ6zs2Ct9LtN3OYYnTrT9ccrOSD0LnHWHCh4FCJ/L2Yt+WRdpUjEfcC4KaU=; 5:eHYZm8yiHsVyWGxDCVFxyIlRl/24FdbV44t4L/VnxgaoCKie9ZGKl/2XhP/IasVj3xApmHhvZTU3Rm1lunWi8WT3rmE1jqkUBdQjYww6ORJDWCvGivPjE3iVuMHqiNQYdnEYy/kaamlAoTLv9Si+wjSklzcFbosIirihZrt55uZwky1jWqFyJmSeFs2qqPCd; 24:O71TzXyYmRGGCdilGllgCNBnE1yPF+mbPqBlYI4aRiFeaKurEi5PXvNzDw5ECguS/Q/25Evm5iXB1ILRkM0dihQPo4a+FY/fQ9WoSnnIJcs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2960; 7:E69QR5DYctZ8Oo8VyMegMLaH0cWTS2LcztU+k3LcziI078o8w3KkjqKBky8fj43rcFiKNil30hN4JGob6ubohLuelhL7uv6mjhzrqwli/zuzWlUuBns9NowabgUeg1u96Ta7FKrfMseuhFrhfj2wZ8oVp2eNXpbpdWPrgDQca9YvFD7JohWwP4ReHiz+/a2iu7SWTZ9ZAcCPgJh0tSq6rvIZ3xW+PdCyFFW6tuTjdH13441ZhPlOFPFAiSC4vdJwW/glIN3fUzx/fChc08+cQMbu8en7TgXBB5zHC7KdFUpfvUU0gwGUE7aV3uJUBOoUxPQqr/QyjShxXc9430cFpQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2017 06:58:08.8411 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR03MB2960 Subject: Re: [dpdk-dev] [PATCH 03/38] net/nfp: use library function for DMA zone reserve 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, 10 Mar 2017 06:58:11 -0000 Hello Jan, On Monday 06 March 2017 03:29 PM, Jan Blunck wrote: > This driver can use the library function rte_eth_dma_zone_reserve() > instead of duplicating the code. > > Signed-off-by: Jan Blunck > --- > drivers/net/nfp/nfp_net.c | 30 ++++++------------------------ > 1 file changed, 6 insertions(+), 24 deletions(-) > > diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c > index d79f262..b9dfe80 100644 > --- a/drivers/net/nfp/nfp_net.c > +++ b/drivers/net/nfp/nfp_net.c > @@ -205,26 +205,6 @@ nn_cfg_writeq(struct nfp_net_hw *hw, int off, uint64_t val) > nn_writeq(rte_cpu_to_le_64(val), hw->ctrl_bar + off); > } > > -/* Creating memzone for hardware rings. */ > -static const struct rte_memzone * > -ring_dma_zone_reserve(struct rte_eth_dev *dev, const char *ring_name, > - uint16_t queue_id, uint32_t ring_size, int socket_id) > -{ > - char z_name[RTE_MEMZONE_NAMESIZE]; > - const struct rte_memzone *mz; > - > - snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d", > - dev->driver->pci_drv.driver.name, > - ring_name, dev->data->port_id, queue_id); > - > - mz = rte_memzone_lookup(z_name); > - if (mz) > - return mz; > - > - return rte_memzone_reserve_aligned(z_name, ring_size, socket_id, 0, > - NFP_MEMZONE_ALIGN); > -} > - > /* > * Atomically reads link status information from global structure rte_eth_dev. > * > @@ -1461,9 +1441,10 @@ nfp_net_rx_queue_setup(struct rte_eth_dev *dev, > * handle the maximum ring size is allocated in order to allow for > * resizing in later calls to the queue setup function. > */ > - tz = ring_dma_zone_reserve(dev, "rx_ring", queue_idx, > + tz = rte_eth_dma_zone_reserve(dev, "rx_ring", queue_idx, > sizeof(struct nfp_net_rx_desc) * > - NFP_NET_MAX_RX_DESC, socket_id); > + NFP_NET_MAX_RX_DESC, NFP_MEMZONE_ALIGN, > + socket_id); > > if (tz == NULL) { > RTE_LOG(ERR, PMD, "Error allocatig rx dma\n"); > @@ -1603,9 +1584,10 @@ nfp_net_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, > * handle the maximum ring size is allocated in order to allow for > * resizing in later calls to the queue setup function. > */ > - tz = ring_dma_zone_reserve(dev, "tx_ring", queue_idx, > + tz = rte_eth_dma_zone_reserve(dev, "tx_ring", queue_idx, > sizeof(struct nfp_net_tx_desc) * > - NFP_NET_MAX_TX_DESC, socket_id); > + NFP_NET_MAX_TX_DESC, NFP_MEMZONE_ALIGN, > + socket_id); > if (tz == NULL) { > RTE_LOG(ERR, PMD, "Error allocating tx dma\n"); > nfp_net_tx_queue_release(txq); > This change is not part of the eth_driver removal process. Isn't it? I would suggest this should be a separate series all together. This is valid for Patch 0004 as well.