From patchwork Mon Sep 28 08:57:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sachin Saxena (OSS)" X-Patchwork-Id: 78984 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E476CA04C0; Mon, 28 Sep 2020 10:58:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2DBBD1D692; Mon, 28 Sep 2020 10:57:42 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20046.outbound.protection.outlook.com [40.107.2.46]) by dpdk.org (Postfix) with ESMTP id 2D1591D67D for ; Mon, 28 Sep 2020 10:57:36 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HdGrF8/a/YXD/yJ14kMo1jJ/vDxjGBSZQvaxrSyhei5NiKntKXNb0jcTsUvAMipqpdJ/1WOVexXkurJfM7Euw5rohh2P//bX0bnJbgA7taQ8ffWr/dFF6iNUWuD8/RlzjCXU92ca7TecOaojDmEAIL9gPsN8D6QWLUnM8cKHAA5S/PaZTPyQEayAiztNIEL90Fw18OLVWm4xbDxR54/KU8ZAcYoi6AODQcrAJ6XqziWHrzEn2MWKoekDa8raeaI4YnY9VFPEmMq2RG6DNM3wZE3S5sFpQ5SCL5UB/u2MonVRV0q+R9FQcOMvLEfQVehGFiOztxASpKixD+azSMrX1g== 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-SenderADCheck; bh=nX7l/90Qw1wdr8CMmY/W5g4DbtQv2cd4t7mwq6KLMf0=; b=fvl4NfN4wVy8L8zzgpjS1EZxOxavkF0s7eBQgqlU0xYC7buV+dsQKoJ/fE4L53Zfao0fKmDwyrd5GAO43P+cd7NqovXNuCIqS7oLevCQiH/y+U92i1Hepz0Nv012jRyRyFan5iOOegJzYDWKa4df++4OIdpMJtzR9eX8y4he4+X3CSjMaxnU7YbhIWAYR507gRUq9aQhC+SMiJRO2nddISvbOD3njZinth9HZi8G7OI/1F9CDRquHl3qa52haWD9CUFa4OyHTR2YeqBo/nqxtmn4XAwtupYciWYMphzqi2ObU/1uFM3Mgz7ZtAFH3Hl8CGQmhJX2Yk85IuFclrRKNQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nX7l/90Qw1wdr8CMmY/W5g4DbtQv2cd4t7mwq6KLMf0=; b=a57ovHOYXIdfR/Tj2D+zoCVnlW8IZ3OLfuVX61Zf7xG7lDlrPTPqZd0Xf7KR49TfIL+/21v4va0dQAv6owFialbLwISjhE5So+J2PQJb3OAaZ+lOz6PnMp79VTJ3p+Of3P51iZHWFrYTctBZlcP9nhabk5sa9V1rwpg7BeizUKo= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=oss.nxp.com; Received: from VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) by VE1PR04MB6542.eurprd04.prod.outlook.com (2603:10a6:803:123::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.22; Mon, 28 Sep 2020 08:57:34 +0000 Received: from VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::cc01:9fe2:2544:8a4b]) by VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::cc01:9fe2:2544:8a4b%7]) with mapi id 15.20.3391.030; Mon, 28 Sep 2020 08:57:34 +0000 From: "Sachin Saxena (OSS)" To: dev@dpdk.org, thomas@monjalon.net, ferruh.yigit@intel.com Date: Mon, 28 Sep 2020 14:27:13 +0530 Message-Id: <20200928085713.13560-5-sachin.saxena@oss.nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200928085713.13560-1-sachin.saxena@oss.nxp.com> References: <20200928085713.13560-1-sachin.saxena@oss.nxp.com> X-ClientProxiedBy: SG2PR06CA0206.apcprd06.prod.outlook.com (2603:1096:4:68::14) To VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03161.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR06CA0206.apcprd06.prod.outlook.com (2603:1096:4:68::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3412.20 via Frontend Transport; Mon, 28 Sep 2020 08:57:32 +0000 X-Mailer: git-send-email 2.28.0 X-Originating-IP: [14.142.151.118] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 36280e24-ce3c-4426-583f-08d8638c8a48 X-MS-TrafficTypeDiagnostic: VE1PR04MB6542: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5HGvJVp1apRLmU8ETOc4hprm9CLL2MMI8y+ZcKF4UZVujmmbVFnWzaKbUL6NZWTIxEkeTY+/aBOuMNUOiajl6k6D8/ZYNJnEga5U0t+SEH21YKaJXXqpGykXBLavUTgPs52cLUL5GHJ1hb1JhM8VQ4ZfMb+6Ntc8z4Iw1+6LuzVMj4ow0aRjhhLR/gmRnQRSfw7X2WPK8kKIe0h2W1+EXER2PBeFafrzYPtEKYF1bqu69Xe159sQu/QZfpoHCP+kpE3fDFwhgjKCDHdgCZA5UgXZevZW10LmqJHb1uuutjv2k4LqUwAI4iACL9MhYaUAotkNecvqGzQvL7QHHXbKlx5jZh5Q3u78x1D49WFPED0MDElYAsKxAg2gtCbSGvsLbaFfMmn54y1x/+OqH4AuxbHmXzY5aZBRR9vOAQvZmoA= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5837.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(396003)(39860400002)(346002)(366004)(136003)(6486002)(66946007)(186003)(478600001)(52116002)(5660300002)(16526019)(8676002)(316002)(6506007)(55236004)(83380400001)(8936002)(26005)(1076003)(2906002)(86362001)(1006002)(6666004)(66476007)(66556008)(6512007)(956004)(2616005)(110426005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: i8THUtxDuCcddNFtuN5TBzaPoEl0jl/8Z7Muih4jgHcvceK8RpT1/xTgTV8CuY06ZlsdXfC2+pQ6I/97xjV0TN8GZhS/s3wDEzFzLACkV3Fn1njC6XGUIVbmaEK5yPIPlDerwTg62/Ow1zOKrJL2lstDmpi3au0kU+MIS2tWokflpasgSKL59+6aUqqT+j8NCtgXhDACtZXJ0oy+5H/s6w4dWtnNEnbWAw2ookj5Lw+na/A31QQp40p7Ya3pti64HJ65vItB7PcRnFM7Iqc0fqak7JBPJ6U+jfasYNoY+wUxqw2kf0DbApGnFx+QsytPrrsqQQu0G/zpyAlco2PIQWQz47OjxP0D/5q2m6c78NUUL2vez63vFTBPkhjjUnDKFTKCHgjGMf4KQUi9DvO7ZTeHx8x/cx3kOoZ3AVGKBGo2l2ZK/Bd5Y9makRBpWVc1NQlxrnyM97UD3BdN+0Rg7+wybOVO8mqDVQQJWpAJSlKnRzaIGQpsfoo3+q/WXisaSNcEPTB1sT+h78M7XXf+49U7I4gLRW8Qv+HHHIsEyaeO64wCRvSbVWsNq3YrYZ8o2AlQMVRXtcwEmn6kwNrHYX51XvFal0J6t4EXRM8rz8Vbd08zYZkJhPK7QgfG5JzqmE/h+XHedWFn+L9PhbkT7A== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 36280e24-ce3c-4426-583f-08d8638c8a48 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5837.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2020 08:57:34.3871 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AQ86827xPdLCKfeAmllOxgvLV2P1GNk2nuo0ApkUXZcYVgVI3IGez3gU9zX0dsg8TlvkI7YB8hH+ocjUo+ysHQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6542 Subject: [dpdk-dev] [PATCH v1 4/4] net/enetc: release port upon close 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Sachin Saxena With removal of old close behavior, the private port resources must be released in the .dev_close callback. Freeing of port private resources is moved from the ".remove(device)" to the ".dev_close(port)" operation Signed-off-by: Sachin Saxena --- drivers/net/enetc/enetc_ethdev.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_ethdev.c index d42add3ef..b3dec7e64 100644 --- a/drivers/net/enetc/enetc_ethdev.c +++ b/drivers/net/enetc/enetc_ethdev.c @@ -568,6 +568,9 @@ enetc_dev_close(struct rte_eth_dev *dev) } dev->data->nb_tx_queues = 0; + if (rte_eal_iova_mode() == RTE_IOVA_PA) + dpaax_iova_table_depopulate(); + return 0; } @@ -919,14 +922,11 @@ enetc_dev_init(struct rte_eth_dev *eth_dev) } static int -enetc_dev_uninit(struct rte_eth_dev *eth_dev __rte_unused) +enetc_dev_uninit(struct rte_eth_dev *eth_dev) { PMD_INIT_FUNC_TRACE(); - if (rte_eal_iova_mode() == RTE_IOVA_PA) - dpaax_iova_table_depopulate(); - - return 0; + return enetc_dev_close(eth_dev); } static int