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 7F474433D8 for ; Mon, 11 Dec 2023 11:16:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 797B740ED2; Mon, 11 Dec 2023 11:16:04 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2086.outbound.protection.outlook.com [40.107.92.86]) by mails.dpdk.org (Postfix) with ESMTP id 032A940E0F for ; Mon, 11 Dec 2023 11:16:03 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C0HaylU1rwi7bZr4b5L5+29D6rj8Ctm+vYC9un7GClYR20HWJoUNdAZEUVGjbZHbRHZmA1eFT/j2d1hhWLCMA3AH3vIjyctFdTHyz/Zmx340Z24Jy4i6EAIPPe5rGdbMNIPS5QgIS4KZ3ZHqfJdTdhiOipiVQmPVSCTaUEd0CtdXSYMlQtOta//jmi0a2FuQCfqWfvn7LOpp5Bf5Drpf1oVwCzCuW23hscfi+F6hxHdGJ/Skv0MLLsu11H7Z7Kma7rLwtS/RftH8HuIqbHhr7SVHOKsGNTGi0egJNWVNqmem3KRxO1z3Zgj0F6GoRo92Skx9symYTVcNoApT9qEYnQ== 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=GA87zZ6XvDZrpkM7IuXOKIE1f7ESOcNF/dtuCwm1nEA=; b=XgYreiziyr0p9FfTK6jm6NcWA6M14Tp8o5gtDRYcabvIDSOw+hkJMCswFPmZPqp4u2E4ucKNJ15rfG3FT7+pYwPc6P4ByDAhQxxAw1Xll2vevfmOVWfhL2m+chGo1kPc8rDfF7cmuGH+7vAiqXTlK3sjy5HTU/wiD1lBC2Mhf/28BDs98XlA4ql1StQY6QhZH6i4doFi/oUYKs0CViVe7/NfVK5i/YbQ0P8DUwHnOeK7zNo2/S4qbDi6f4tTe6v65yTKagWUAbeOsTAJ4dEvwWroZkj/09dl2A9/FILBmjLAWxu/NlfWb5qTol+UwgttyYxEDXQm7Ji2sdGG1WGi+Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=huawei.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 (0) 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=GA87zZ6XvDZrpkM7IuXOKIE1f7ESOcNF/dtuCwm1nEA=; b=jA4uog1ABg7Mi7di/mry+SYA9THYMQSSwnT3QrcPx606Rp1tqclLMaObMxnpdPM7hchwKMp7hw3LC2q7bPnThj2jbPuPY/vwO5DlJa5zqT2XQ/IfBJhArUQuTTliZahJFMNC2nZ895Y0P41giAp+2PST/fWgEJP34ENcuhrRUl0jNS6cgXNsf29KL6bl4Z6Qg6Wvan9RJNdJJmy4SlW9HhzrkhCrT9BMV5qj48Zy7auS2YiNd1U6jCgq6i1d0jaAMw79gaVpOz9tf1JFlCP5TNRJuL5wZZMwIoTY1Mr+8nmQg69S1LwdgkU+ks7JRsZxCa4c2gGmUZKG86QWst7VNQ== Received: from CH0PR03CA0428.namprd03.prod.outlook.com (2603:10b6:610:10e::23) by PH7PR12MB5903.namprd12.prod.outlook.com (2603:10b6:510:1d7::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.33; Mon, 11 Dec 2023 10:15:58 +0000 Received: from DS3PEPF000099DD.namprd04.prod.outlook.com (2603:10b6:610:10e:cafe::13) by CH0PR03CA0428.outlook.office365.com (2603:10b6:610:10e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32 via Frontend Transport; Mon, 11 Dec 2023 10:15:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DS3PEPF000099DD.mail.protection.outlook.com (10.167.17.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.18 via Frontend Transport; Mon, 11 Dec 2023 10:15:57 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Mon, 11 Dec 2023 02:15:45 -0800 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.41; Mon, 11 Dec 2023 02:15:43 -0800 From: Xueming Li To: Huisong Li CC: Jie Hai , dpdk stable Subject: patch 'net/hns3: fix setting DCB capability' has been queued to stable release 22.11.4 Date: Mon, 11 Dec 2023 18:11:00 +0800 Message-ID: <20231211101226.2122-36-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231211101226.2122-1-xuemingl@nvidia.com> References: <20231022142250.10324-1-xuemingl@nvidia.com> <20231211101226.2122-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: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099DD:EE_|PH7PR12MB5903:EE_ X-MS-Office365-Filtering-Correlation-Id: 78403486-ca59-4697-41fe-08dbfa322af9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TvY/eVCdEnLFljlGN1Se5cTIbCO5dHfpl3wEBoUi58w77slmj7yjpdkqadvl4/vdHwAW1OMUBSxxS46eUpn8i25fsW9U16Uyw3Z25MeSvEuGoBf6GR+GDO3qZTxtNDlB2spunYSMcAsDIp8Kbdnizdy8JHxrLPgOiwB/eR2n2DSmimQtNsuPLEB0yKHq1VbDeJRKmKHLyBWmDCXlNB4839lGv13hL6KBWY+B+FDZQ5dr2KGCxTWjNCNE/Z27Wpl+Mkts7EC3NFCR4HqmltEV8H0ErZ3TfyIZWUGuUOCCCHu7wIbo+BU7nYiqYOCjVvSL8mf77LICgaU9YZn/uND7BAM6Vs59M8iwNyUajdU4BLg33/7mYNDhtdC/5lrTDZcFSFYsRjfC+RtFbrrDgDg8sHtJ5nbHHAaO/ETDI0BA9tSdyEM+pq18qPQfR9abXXE2o3XcRuvs9896X8abvCRtZ3HQCOP+v6aFwOVz98GhWArKT6TLUkMXkqb/6suxbNEUS8joiHLnsEP/bxtLYRfyV/aviqg6t4OzCS2KAKbgnV/Kr4BSEwkht+T/Rt32TDwg9rcFjdKWo629sxNBNtfL2PIoadN7xt9RCBD6vA3WRwSrGnOVE+Qk6Yl6tmlO16kXmHzzZ2nTi+RKjywVvOyoZNamDS2xGfnHxzLoJZYtXtkitwXKIKQ22PbFlF5R4JkMeyYyNw6ruOy0QDcfh7yO3VqL92u7IVezCP1tuQTH9OrQKKe0SPTeoMgOzuXinyhjiNnOAHhmC9CUstNh6igJr5sV9Bunvs/X+QN19X3w7QE= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230031)(4636009)(376002)(39860400002)(396003)(346002)(136003)(230922051799003)(1800799012)(186009)(82310400011)(64100799003)(451199024)(40470700004)(36840700001)(46966006)(40460700003)(4001150100001)(2906002)(41300700001)(36860700001)(36756003)(86362001)(7636003)(82740400003)(356005)(2616005)(336012)(426003)(16526019)(1076003)(26005)(6286002)(6666004)(478600001)(53546011)(7696005)(47076005)(966005)(83380400001)(4326008)(5660300002)(316002)(6916009)(70586007)(70206006)(54906003)(8936002)(8676002)(55016003)(40480700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2023 10:15:57.7938 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 78403486-ca59-4697-41fe-08dbfa322af9 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF000099DD.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5903 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 22.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/13/23. 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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=518bc133278f9c88e81f5be63e293612a611976e Thanks. Xueming Li --- >From 518bc133278f9c88e81f5be63e293612a611976e Mon Sep 17 00:00:00 2001 From: Huisong Li Date: Tue, 31 Oct 2023 20:23:54 +0800 Subject: [PATCH] net/hns3: fix setting DCB capability Cc: Xueming Li [ upstream commit ac61c444e647298dded80a2ab52966a2dbe22b68 ] The "hw->capability" is set after querying firmware and version. But the DCB capability of PF is set in other place. So this patch moves setting DCB capability to the place where all capabilities are set. Fixes: ab2e2e344163 ("net/hns3: get device capability in primary process") Signed-off-by: Huisong Li Signed-off-by: Jie Hai --- drivers/net/hns3/hns3_cmd.c | 25 +++++++++++++++++++++++++ drivers/net/hns3/hns3_ethdev.c | 13 ------------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/drivers/net/hns3/hns3_cmd.c b/drivers/net/hns3/hns3_cmd.c index bdfc85f934..8f5c373acf 100644 --- a/drivers/net/hns3/hns3_cmd.c +++ b/drivers/net/hns3/hns3_cmd.c @@ -519,6 +519,28 @@ hns3_build_api_caps(void) return rte_cpu_to_le_32(api_caps); } +static void +hns3_set_dcb_capability(struct hns3_hw *hw) +{ + struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw); + struct rte_pci_device *pci_dev; + struct rte_eth_dev *eth_dev; + uint16_t device_id; + + if (hns->is_vf) + return; + + eth_dev = &rte_eth_devices[hw->data->port_id]; + pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); + device_id = pci_dev->id.device_id; + + if (device_id == HNS3_DEV_ID_25GE_RDMA || + device_id == HNS3_DEV_ID_50GE_RDMA || + device_id == HNS3_DEV_ID_100G_RDMA_MACSEC || + device_id == HNS3_DEV_ID_200G_RDMA) + hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_DCB_B, 1); +} + static int hns3_cmd_query_firmware_version_and_capability(struct hns3_hw *hw) { @@ -536,6 +558,9 @@ hns3_cmd_query_firmware_version_and_capability(struct hns3_hw *hw) return ret; hw->fw_version = rte_le_to_cpu_32(resp->firmware); + + hns3_set_dcb_capability(hw); + /* * Make sure mask the capability before parse capability because it * may overwrite resp's data. diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index af66bf062e..03ddc14eae 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -2723,22 +2723,9 @@ static int hns3_get_capability(struct hns3_hw *hw) { struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw); - struct rte_pci_device *pci_dev; struct hns3_pf *pf = &hns->pf; - struct rte_eth_dev *eth_dev; - uint16_t device_id; int ret; - eth_dev = &rte_eth_devices[hw->data->port_id]; - pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); - device_id = pci_dev->id.device_id; - - if (device_id == HNS3_DEV_ID_25GE_RDMA || - device_id == HNS3_DEV_ID_50GE_RDMA || - device_id == HNS3_DEV_ID_100G_RDMA_MACSEC || - device_id == HNS3_DEV_ID_200G_RDMA) - hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_DCB_B, 1); - ret = hns3_get_pci_revision_id(hw, &hw->revision); if (ret) return ret; -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-12-11 17:56:24.304259400 +0800 +++ 0035-net-hns3-fix-setting-DCB-capability.patch 2023-12-11 17:56:22.957652300 +0800 @@ -1 +1 @@ -From ac61c444e647298dded80a2ab52966a2dbe22b68 Mon Sep 17 00:00:00 2001 +From 518bc133278f9c88e81f5be63e293612a611976e Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit ac61c444e647298dded80a2ab52966a2dbe22b68 ] @@ -12 +14,0 @@ -Cc: stable@dpdk.org @@ -22 +24 @@ -index ca1d3f1b8c..62c55f347f 100644 +index bdfc85f934..8f5c373acf 100644 @@ -25 +27 @@ -@@ -525,6 +525,28 @@ hns3_build_api_caps(void) +@@ -519,6 +519,28 @@ hns3_build_api_caps(void) @@ -54 +56 @@ -@@ -542,6 +564,9 @@ hns3_cmd_query_firmware_version_and_capability(struct hns3_hw *hw) +@@ -536,6 +558,9 @@ hns3_cmd_query_firmware_version_and_capability(struct hns3_hw *hw) @@ -65 +67 @@ -index 0feea52542..472737e8a8 100644 +index af66bf062e..03ddc14eae 100644 @@ -68 +70 @@ -@@ -2719,22 +2719,9 @@ static int +@@ -2723,22 +2723,9 @@ static int