From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 92C2AA04A8; Wed, 19 Jan 2022 12:48:46 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 233FE41145; Wed, 19 Jan 2022 12:48:46 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2112.outbound.protection.outlook.com [40.107.94.112]) by mails.dpdk.org (Postfix) with ESMTP id 57D4C4013F; Wed, 19 Jan 2022 12:48:44 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mhtxv85uROvkuGp1dGPZCvELVMNfbm0e2jiHLiFenhor+8dLjRFSspvgQ7aBbgGOH5eexQhqb5jcWy3gWG8SBERCf/xbexlpOcfI5/PTrJqsYpcWIAi/m7D084LOZICllnILErqdaxjcgjRMaSo2Kd6sAD5PvFRjBjcPpXBrnj3SuKsLRXMwhVoxPhuHrg2DWgcko2ceJOt72TE72Glgn8ZznSHBqMbEjczmNsG8EsUBanm+yDIrKS87geQ77LWe6lCBnq4djGm5AAs4ncHnZlnJCJngqmDLCmQhcMxhrpCkLTMz86cVNPOYjrYKTB5YrIJ9Q7ESWGvfoa0OUayyVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JDFPG44KwTjc/bITzyrVVi26g9sOzCZH25QlFPpGZmk=; b=igssEZwtRFO/kLBIGsx0BWDDfqeDl8qHKzu/U3ovCkJwy3sIspukTmS1Y8pjND7pXbblgj1jUNGwt8XgCCfQu3PrUv4I+7xPVDJkCZ7f2wmQr+TR/hYNeCQ0eSgxmBAgtHu2SNAldEvmMkRL7HitEqu7Y1p22FmKPiXPt92UdbtBM9WJ2oWmhEG0NlEjXDlOXsuPj46C837FUQyYTfLeMbDWcua1T391BWSI+oozy0VAMXdPPFsOxBVbeIyL8ZLOqCs6ZXok+LqXfwS3qJ7aUrYNS+O7gier4y1hjSlONdOF5mPRWmG2IajZosMfFbgsP4ewFEWlCTLjn/52vmRpfg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JDFPG44KwTjc/bITzyrVVi26g9sOzCZH25QlFPpGZmk=; b=ADNf/pN+jpidIPRdZ7o0NqaxIAVQ96CCeVij7ZJszuGFPP/aQmg1rZLDzKQvFLqSiLjl/p8062z/Ps+To95pXj7LIaSCagk2Ye1HXRbvIjTRZ2otp7d4ueYOzklxrsUMcEKseoixIjR+4N9dufStfkE2LtxcdtrR7xUTQAoAxv4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5771.namprd13.prod.outlook.com (2603:10b6:a03:40e::22) by BYAPR13MB4326.namprd13.prod.outlook.com (2603:10b6:a03:103::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.2; Wed, 19 Jan 2022 11:48:41 +0000 Received: from SJ0PR13MB5771.namprd13.prod.outlook.com ([fe80::1d9e:a22b:a78b:9cc3]) by SJ0PR13MB5771.namprd13.prod.outlook.com ([fe80::1d9e:a22b:a78b:9cc3%7]) with mapi id 15.20.4930.004; Wed, 19 Jan 2022 11:48:40 +0000 From: heinrich.kuhn@corigine.com To: dev@dpdk.org Cc: Heinrich Kuhn , stable@dpdk.org, Simon Horman Subject: [dpdk-dev] [PATCH] net/nfp: free HW rings memzone on queue release Date: Wed, 19 Jan 2022 13:48:00 +0200 Message-Id: <20220119114800.6900-1-heinrich.kuhn@corigine.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: JNAP275CA0035.ZAFP275.PROD.OUTLOOK.COM (2603:1086:0:4d::19) To SJ0PR13MB5771.namprd13.prod.outlook.com (2603:10b6:a03:40e::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6d9ae6b6-17fa-4bc9-7638-08d9db41a2cd X-MS-TrafficTypeDiagnostic: BYAPR13MB4326:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:480; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bx7R3vQ/4bQEqKeflfKEkSN7UsDW0YYE9h3eAS3RqgnvA1yNtc9tYIxmZX1jKIUjGu3kY8OUDe7aH/RkGihNbviLK+jKCchHzFlXYYc0P9VAuliRuYwLzvtpUBi4ahysVWA3KYpDY9QpEpB/j4fyeglC/NXsDTFCEeUa6rrWEsVp5ThOA2bjUy34cVUV+PeoN4Jfm9FWctpV+XtKMh+QLC1IjdPfT2UHoa6sSr9qzWJBWvASyazZAi/d+hrC8BshLhhEOy0n4kE1et0opmOw9eNZHVRXhbi3KVPqwbCoi9hzTTExA+SY2GpaLeAnjwfOH1YBu/W/r/p2qfmCTVBmYsA7qseBv0GKwUmkdeGdkht2gFn0Vtv+Yi4HAo+tB1I9FXqH0Vw8AMdul/5vb8tKhduLXboOG3EaLaqYXlDpA1ofxDT/E8VD7l4AROTliCArwJ7pttQR3zud8yctr57u2CvRkjZH5DNADZYR0PjNogpEC+W3QUJAG2RCu4dgGxgkqH7KS/xeGuhXko4yxEnSQr6SXdZhApwMDoRd+vz9w69NlhmzKThNTs1J5ajpTFCKbK35tUKiuyOrI1pGxf3WipDgw5Rk8JGyCGVktFWm46z4QbVP1OF+424uD+nqL2PUnT5Nhaz60roNzYaxM5zyB+tsctRwr+R9gKkfI5DyPDVL9aGC+0Ne69XAd91ktcvPEJgnhJrql/DdQGvGXZkX/Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5771.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(346002)(396003)(366004)(376002)(39830400003)(136003)(8676002)(9686003)(6512007)(316002)(8936002)(4326008)(186003)(66556008)(450100002)(52116002)(66476007)(26005)(66946007)(83380400001)(1076003)(2906002)(86362001)(2616005)(5660300002)(508600001)(107886003)(38350700002)(38100700002)(36756003)(6666004)(6916009)(54906003)(6506007)(6486002)(20210929001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?cUBnHpLSXcCYBZpHeeYApPXdsQoMx16H5o/lyGHI0+NekuGyVfXxUU60C10G?= =?us-ascii?Q?FB/Y9QxUpcxMC4G2Z2yTUrIJXpTNxXDh5DK/nWyE9+q3hoxL3yU7YC3xp4Rm?= =?us-ascii?Q?Mhgcw5K8edj7BSvA2sPPSWmzUtHCRhOWtjN+JqIL+npI9411wWFonIqflJqk?= =?us-ascii?Q?BVMnZbCsl5Zbq+AR7sHe5bZxjxUPabLVDL8xR6pd5TFfWycO6iEUWq17nqCv?= =?us-ascii?Q?8miIoJkjyNSYXtckXpY4IRZx6OOcTbDiobCjRcR8JA7QXRTHq1CiHW7Ea2Gn?= =?us-ascii?Q?FZskmw4XoXEGN82Agzpqw/OqwwhkceGeuVHUO8zjLqK/hTSmJAJ6vLd8RE6J?= =?us-ascii?Q?wLYp/uEZstSZaSFBWmt43cLjnRR1SId9835yJp0YNwRSriQFtuycF/rQ5qVe?= =?us-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giK2N97wThpqXn0dzgj+S8?= =?us-ascii?Q?ljoY1PdUK3KuCRxYzNraO0Ujl7bUCQ3MItv5eAOBan8ZfWoUY9qgwGd4OoUd?= =?us-ascii?Q?pOc4tofsRhvJGGC3SQ5gkKDAgiJkKR5RZ9i7MmXh7YEXE9ShzTXRh9i+B+kS?= =?us-ascii?Q?w99q9JptNQ8Rx9Pnv1mrMXRRFYJ9CW4Jor7fy+CPD04CE/yXRElS2pyZpEC0?= =?us-ascii?Q?lR9uQYA4l+JTk9sHJ+LxvdSbOEzfOlldfxsqNo2ZS51ukt+x5iv80AgkLdAN?= =?us-ascii?Q?iQjiQXFkmnYnpv6Vxu98DCjFl/xqD3g8h/VnYEivUokAgGWJE7XXfNia0DMY?= =?us-ascii?Q?L4zcF/YGw6/OezkxaYf63k/8k5QqUCoVgj7y68zKo2XslPocK6vnYyEHRCNU?= =?us-ascii?Q?dFkVO7NP3yBkfuvpo7dTh/h1zdM=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6d9ae6b6-17fa-4bc9-7638-08d9db41a2cd X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5771.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2022 11:48:40.7240 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pUaKSJ2jcQ7xQnb0HO1c4BSuehQn7Oyw7daNpkdWkKMSBCo/Wb/7ZPN71/bcZooRuyB3hERTVy5yrgad3/CEiJAg2IOlRd/kQhfRcWY4G3g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR13MB4326 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Heinrich Kuhn During rx/tx queue setup, memory is reserved for the hardware rings. This memory zone should subsequently be freed in the queue release logic. This commit also adds a call to the release logic in the dev_close() callback so that the ring memzone may be freed during port close too. Fixes: b812daadad0d ("nfp: add Rx and Tx") Cc: stable@dpdk.org Signed-off-by: Heinrich Kuhn Signed-off-by: Simon Horman --- drivers/net/nfp/nfp_ethdev.c | 2 ++ drivers/net/nfp/nfp_ethdev_vf.c | 2 ++ drivers/net/nfp/nfp_rxtx.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c index 8e81cc498f..9166f65da3 100644 --- a/drivers/net/nfp/nfp_ethdev.c +++ b/drivers/net/nfp/nfp_ethdev.c @@ -302,11 +302,13 @@ nfp_net_close(struct rte_eth_dev *dev) for (i = 0; i < dev->data->nb_tx_queues; i++) { this_tx_q = (struct nfp_net_txq *)dev->data->tx_queues[i]; nfp_net_reset_tx_queue(this_tx_q); + nfp_net_tx_queue_release(dev, i); } for (i = 0; i < dev->data->nb_rx_queues; i++) { this_rx_q = (struct nfp_net_rxq *)dev->data->rx_queues[i]; nfp_net_reset_rx_queue(this_rx_q); + nfp_net_rx_queue_release(dev, i); } /* Cancel possible impending LSC work here before releasing the port*/ diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c index 303ef72b1b..0034d68ea6 100644 --- a/drivers/net/nfp/nfp_ethdev_vf.c +++ b/drivers/net/nfp/nfp_ethdev_vf.c @@ -219,11 +219,13 @@ nfp_netvf_close(struct rte_eth_dev *dev) for (i = 0; i < dev->data->nb_tx_queues; i++) { this_tx_q = (struct nfp_net_txq *)dev->data->tx_queues[i]; nfp_net_reset_tx_queue(this_tx_q); + nfp_net_tx_queue_release(dev, i); } for (i = 0; i < dev->data->nb_rx_queues; i++) { this_rx_q = (struct nfp_net_rxq *)dev->data->rx_queues[i]; nfp_net_reset_rx_queue(this_rx_q); + nfp_net_rx_queue_release(dev, i); } rte_intr_disable(pci_dev->intr_handle); diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c index 0fe1415596..335a90b2c9 100644 --- a/drivers/net/nfp/nfp_rxtx.c +++ b/drivers/net/nfp/nfp_rxtx.c @@ -470,6 +470,7 @@ nfp_net_rx_queue_release(struct rte_eth_dev *dev, uint16_t queue_idx) if (rxq) { nfp_net_rx_queue_release_mbufs(rxq); + rte_eth_dma_zone_free(dev, "rx_ring", queue_idx); rte_free(rxq->rxbufs); rte_free(rxq); } @@ -660,6 +661,7 @@ nfp_net_tx_queue_release(struct rte_eth_dev *dev, uint16_t queue_idx) if (txq) { nfp_net_tx_queue_release_mbufs(txq); + rte_eth_dma_zone_free(dev, "tx_ring", queue_idx); rte_free(txq->txbufs); rte_free(txq); } -- 2.30.1 (Apple Git-130)