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 7C1E3A00C5 for ; Wed, 20 Jul 2022 10:25:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 764A240697; Wed, 20 Jul 2022 10:25:40 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2045.outbound.protection.outlook.com [40.107.223.45]) by mails.dpdk.org (Postfix) with ESMTP id EB0AD4003C for ; Wed, 20 Jul 2022 10:25:38 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A3OV4sAu+iduJL5mUx1ckJi4z1RSL6HJqh7OkCeTHMCnQbMwZwmeCBnc6+Ooh6mGU+3dwouIABT7/DVT0p03aUMjo9R/WnybHNGgxlaAetZBkHG/mbD0yF/78lWZEXZjghNmJuKiF1h5zeegTzh/Os4dCwjGutwFBq0qGoYMyszD1a0s39IZlyeKChAb/pyznnzUnxypP8GCwGi3aHtX9pl7CobG7BIoyiXMpFmFe9UsE8pS/JEK3vDllOXyFNa1uugsU2Qe5MSGlBEintZGjg9yqSPF7DfsSrY7gDu8Vt1BVAZ30MXZC3jiCv3/iXV2y7yRfmkIv9tcK2YoP+Tmbw== 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=/P06bP60z4M0e2XsWIv6K+VXYexUkWrRnGvJ4vZNaZA=; b=WS381lRheFWMNfsIQyRDa7rGfyOtf8A0roEXmNypzuqzbxAC1NwGaIcuPcIDtf91jr7Ww7Kz+Z2EW5kDialHva0w2ZJ70p6wFLmfYWHP7tWMTPFu81LuGN6c2xUPW5lPrqeMP6h9uVMHVQoUDImkwo7dr9flRygH5iQ12b2ygr2mtK6DzdBNRGshUk4V+TE/nxI/Xb5hLEsT3GO/2LWyIyDFwfVy/vqibAQMydSjW9Ja9LwZVMoiDJR0OmL57Ho4SfOXg5WXqQ7qR8MDj7TUFOLAjweidg4JMvh5oQVOc+yqanBSI5OUkWcSnOw2sWEi808LAuOEdV1JYrHbjHhVhA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) smtp.rcpttodomain=broadcom.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/P06bP60z4M0e2XsWIv6K+VXYexUkWrRnGvJ4vZNaZA=; b=bvi/kYmruAvkwNYlG2mU+/Rp2sW3QjgcXk9cF0pnMomkgvEOUY3FwIm4A6XbUtkZiPpgEsOCECT1/RpuDM0EiQcF4DopHkxOeKpG4ubhh4ZHqkp92ib7AqvC/AU6ntWPPTQ6Y5K2o7w/o2Gl5EPMp7GBir5dP2kxYiJbLhFhz89/PVDNMMVyrKjDB5okT4DP24+gH4PzutjT9t0hE/wSNZUmco93mNSKQYs4mY1o5aewxONiE6I2GIG7HFkDT/79KScfkk9ZgGK2s6Bfuyaql2RB6rCT3ygqOTe2ldZyIGjtXWFKdv+HhqysoplRWt0UW69FbUPaAkqv3EptSkO25w== Received: from MW4P223CA0001.NAMP223.PROD.OUTLOOK.COM (2603:10b6:303:80::6) by DM6PR12MB3051.namprd12.prod.outlook.com (2603:10b6:5:119::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.17; Wed, 20 Jul 2022 08:25:34 +0000 Received: from CO1NAM11FT056.eop-nam11.prod.protection.outlook.com (2603:10b6:303:80:cafe::77) by MW4P223CA0001.outlook.office365.com (2603:10b6:303:80::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.19 via Frontend Transport; Wed, 20 Jul 2022 08:25:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.238) by CO1NAM11FT056.mail.protection.outlook.com (10.13.175.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5458.17 via Frontend Transport; Wed, 20 Jul 2022 08:25:34 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Wed, 20 Jul 2022 08:25:33 +0000 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Wed, 20 Jul 2022 01:25:31 -0700 From: Xueming Li To: Ajit Khaparde CC: , Somnath Kotur , "Kalesh AP" , Andy Gospodarek , dpdk stable Subject: patch 'net/bnxt: fix switch domain allocation' has been queued to stable release 20.11.6 Date: Wed, 20 Jul 2022 11:21:12 +0300 Message-ID: <20220720082132.3954126-43-xuemingl@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220720082132.3954126-1-xuemingl@nvidia.com> References: <20220621080301.2315720-1-xuemingl@nvidia.com> <20220720082132.3954126-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 19fd326c-1f01-44a8-1e9b-08da6a296ac1 X-MS-TrafficTypeDiagnostic: DM6PR12MB3051:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?KkbqjNQGZAD86SsWjmo22XKgnMyyd36l2E2YfkmOXaUygOUTTdhiAVaA0tJ3?= =?us-ascii?Q?VOYs6KJVZpkFsaorHZhMjxaYpL7p1ES7h4jmLsCUmDFqKklQtx6i0NgljCwU?= =?us-ascii?Q?fmbFMvduVeFaPNLvMP5kbqU7IrfYpUp0RDFr21Eipgx5QqbAhFi+U5w78mdf?= =?us-ascii?Q?Sq0YPjndKYzokrqGkJfOVDKnjvL5XUB2V/BPNZz3mTVRGMrPhcf8L3Thuji+?= =?us-ascii?Q?RUZtXrnM5Mtlgf8SuCVM7kmWqq8qPGvIcrS7P72j9zbxzNQ8KwU6rtOChldq?= =?us-ascii?Q?UNIyj/xm0xIccyozc1DvvB9J3IJGYAJw2k5wwn7m1aYCLj79HNHN/lY3zgog?= =?us-ascii?Q?rBQwj62b8QlEZUkF30iOJlDvmwleHs+2KK9UgPmzsOQ2UZ2UVswyq+flbHm2?= =?us-ascii?Q?o+3vYjzW5OvWZ8goZoS8/kg8sG70WatnLqVvGtBY+GbPqMdhHlC5dL7+bx/j?= =?us-ascii?Q?sn/X9QZ6/xJuNsI0lKkNdwsaIbzAQhXwsw3jpYv/VbiGxT2iMnzlKJoLkC0K?= =?us-ascii?Q?JN6/gxHRyhaAvd1X4f3ESWmFNo/pqlyfZSKsDECIPxkZgqGd10lpfnCGI/7T?= =?us-ascii?Q?tOgVccpmiLel9X63ao0yVdWBWYveE12cAocP1f4DvjhSt4ughNlAew+alxCc?= =?us-ascii?Q?RqqUjHEYrSPIw1C0e5qgFKGamNSiTwtAvRXPlQAN23O/s1El8elt6y0BGicX?= =?us-ascii?Q?NQ+13oaOPxFmRDqxjMuiwB6S9TXYiOZlVYvvf/P7kRPPGoRjFY22XtINrGyB?= =?us-ascii?Q?KEnTaaIAEdxVijvmTQdjijSX3v1MDgelrmsrxJmzv8vJaXInWv2zhzQIaFfI?= =?us-ascii?Q?ZbEIGRXVsXDfzLvtuhZ9mG0PXKEDYNSQiVH66gF0WYMZQzzn4Zy6slZUQqHI?= =?us-ascii?Q?vS1Gpf7d8K6nS3i/7jEgzbyCfUtYYhbhc83+9Kf3idt2RfJ6hlnPz27rWGMb?= =?us-ascii?Q?qztIb4541DJ5Fz3vZD3HZA=3D=3D?= X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(39860400002)(346002)(376002)(136003)(396003)(46966006)(36840700001)(40470700004)(82310400005)(16526019)(6916009)(316002)(6666004)(186003)(36756003)(426003)(54906003)(86362001)(2616005)(1076003)(47076005)(336012)(6286002)(70206006)(53546011)(55016003)(478600001)(36860700001)(70586007)(40460700003)(83380400001)(26005)(8936002)(8676002)(2906002)(41300700001)(356005)(82740400003)(4326008)(81166007)(966005)(40480700001)(5660300002)(7696005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2022 08:25:34.2653 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 19fd326c-1f01-44a8-1e9b-08da6a296ac1 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.238]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT056.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3051 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 20.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/22/22. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/36aeaa3131cbef77786626a50072e53086f9b24c Thanks. Xueming Li --- >From 36aeaa3131cbef77786626a50072e53086f9b24c Mon Sep 17 00:00:00 2001 From: Ajit Khaparde Date: Wed, 15 Jun 2022 20:26:57 +0530 Subject: [PATCH] net/bnxt: fix switch domain allocation Cc: Xueming Li [ upstream commit aef3baca157d8202c26c5e034a9ab920da60d414 ] Allocate switch domain after the trusted VF capability is queried from the FW. Currently we are calling the function earlier. Since the switch domain is allocated only for PFs or trusted VF, the current location of code fails to allocate the domain during init. But during cleanup we try to free the domain incorrectly. Fix the behavior by changing the sequence of function calls. Fixes: 3127f99274b67 ("net/bnxt: refactor init/uninit") Signed-off-by: Ajit Khaparde Reviewed-by: Somnath Kotur Reviewed-by: Kalesh AP Reviewed-by: Andy Gospodarek --- drivers/net/bnxt/bnxt_ethdev.c | 45 +++++++++++++++++----------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 281c209335..288baf497c 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -5194,6 +5194,25 @@ bnxt_init_locks(struct bnxt *bp) return err; } +/* This should be called after we have queried trusted VF cap */ +static int bnxt_alloc_switch_domain(struct bnxt *bp) +{ + int rc = 0; + + if (BNXT_PF(bp) || BNXT_VF_IS_TRUSTED(bp)) { + rc = rte_eth_switch_domain_alloc(&bp->switch_domain_id); + if (rc) + PMD_DRV_LOG(ERR, + "Failed to alloc switch domain: %d\n", rc); + else + PMD_DRV_LOG(INFO, + "Switch domain allocated %d\n", + bp->switch_domain_id); + } + + return rc; +} + static int bnxt_init_resources(struct bnxt *bp, bool reconfig_dev) { int rc = 0; @@ -5202,6 +5221,10 @@ static int bnxt_init_resources(struct bnxt *bp, bool reconfig_dev) if (rc) return rc; + rc = bnxt_alloc_switch_domain(bp); + if (rc) + return rc; + if (!reconfig_dev) { rc = bnxt_setup_mac_addr(bp->eth_dev); if (rc) @@ -5646,24 +5669,6 @@ err: return ret; } -static int bnxt_alloc_switch_domain(struct bnxt *bp) -{ - int rc = 0; - - if (BNXT_PF(bp) || BNXT_VF_IS_TRUSTED(bp)) { - rc = rte_eth_switch_domain_alloc(&bp->switch_domain_id); - if (rc) - PMD_DRV_LOG(ERR, - "Failed to alloc switch domain: %d\n", rc); - else - PMD_DRV_LOG(INFO, - "Switch domain allocated %d\n", - bp->switch_domain_id); - } - - return rc; -} - /* Allocate and initialize various fields in bnxt struct that * need to be allocated/destroyed only once in the lifetime of the driver */ @@ -5740,10 +5745,6 @@ static int bnxt_drv_init(struct rte_eth_dev *eth_dev) if (rc) return rc; - rc = bnxt_alloc_switch_domain(bp); - if (rc) - return rc; - return rc; } -- 2.35.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-07-20 15:01:00.756388215 +0800 +++ 0043-net-bnxt-fix-switch-domain-allocation.patch 2022-07-20 15:00:58.757667088 +0800 @@ -1 +1 @@ -From aef3baca157d8202c26c5e034a9ab920da60d414 Mon Sep 17 00:00:00 2001 +From 36aeaa3131cbef77786626a50072e53086f9b24c Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit aef3baca157d8202c26c5e034a9ab920da60d414 ] @@ -14 +16,0 @@ -Cc: stable@dpdk.org @@ -25 +27 @@ -index 0f0f40b95b..34f21496a4 100644 +index 281c209335..288baf497c 100644 @@ -28 +30 @@ -@@ -5287,6 +5287,25 @@ bnxt_init_locks(struct bnxt *bp) +@@ -5194,6 +5194,25 @@ bnxt_init_locks(struct bnxt *bp) @@ -54 +56 @@ -@@ -5295,6 +5314,10 @@ static int bnxt_init_resources(struct bnxt *bp, bool reconfig_dev) +@@ -5202,6 +5221,10 @@ static int bnxt_init_resources(struct bnxt *bp, bool reconfig_dev) @@ -65 +67 @@ -@@ -5734,24 +5757,6 @@ err: +@@ -5646,24 +5669,6 @@ err: @@ -90 +92 @@ -@@ -5828,10 +5833,6 @@ static int bnxt_drv_init(struct rte_eth_dev *eth_dev) +@@ -5740,10 +5745,6 @@ static int bnxt_drv_init(struct rte_eth_dev *eth_dev)