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 45C19432DA for ; Wed, 8 Nov 2023 20:26:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4050442E06; Wed, 8 Nov 2023 20:26:33 +0100 (CET) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by mails.dpdk.org (Postfix) with ESMTP id 6314840395 for ; Wed, 8 Nov 2023 20:26:31 +0100 (CET) Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-32df66c691dso11846f8f.3 for ; Wed, 08 Nov 2023 11:26:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699471591; x=1700076391; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dexzaRzeFXp/wCn7Ih9lONL8iQacm/AYMm7lZo94JaM=; b=AH2jHsikwqSaH4QYP/2pStXDI7iBiKEoAQeINzhhNgtwTU32s2hzpHM0hO/s4x8Z3p UKWs/QpI5Z7JA5NeVldgX8m2c2T8TOgh4G7kkWGSd2V11Hj27ps30e2ZPm+CHbvbacxd WCSUmqLkbrrCGFAJiM5/yLBJOD2qqUBUdfzma04veZXfOzSKJd04ChPwgJ6Nyu4vAIdh tOullCuRnDxh8Bbc3kcZTkBd99ZkxyXpu7yFTvoOPFOEpHYbpy8MWlZbjYNJRGrzX/4k mUy2/S5FQRH0Kiz/SQvaAJsyAGWyjr0rSnTZKBH4bBvK1d9GqiyrOQMeRWqHJpha4Tol eNTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699471591; x=1700076391; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dexzaRzeFXp/wCn7Ih9lONL8iQacm/AYMm7lZo94JaM=; b=Jx5ypdegQ6w3DKVW7oDxyiK+RDrpw1qZPnYczyMGl7cgYC39rH1MP7IffbYkQSb//v AJ6ap1sxUQ0srmsz5obL3dfxPQ20sn7EBkzIEEIgUAGgJgEtCE6NntBEV1qZjlhTZT++ FkB0hTbganI/YlfArKYlUNqhUJezeVZ3o3oL1PQnLMW82hq+C+vqOwDR8JFHbw8tl91F fMlvCuAl37adR9eIJYTlpmhC5v31Mnp39iA5Q3M5XSWDeXQrp/4g9c9UwcluIGTBx6uT eGagsiaX8ZWSVHrAosrE/HkF05l+/b2QEfY9JLtMOaiec6yRu73i4cuQSdB8DTuTX3u9 dKnw== X-Gm-Message-State: AOJu0YyTSYKgF1gzbIrlVwRmDz85v1IYvezlJRSdEpGeFfm+I3PULZCK 5tp2d0VmjuSi6HHlrdALrBk4EYqKG8kDug== X-Google-Smtp-Source: AGHT+IGrJ39TGasnqfG8I5XtqRPUOKHhgBuh8Y1hzpwyHzTLQh8mSfAKi0xHuc51g0y9zLDcCUQvrw== X-Received: by 2002:adf:f984:0:b0:32f:7d21:fd7b with SMTP id f4-20020adff984000000b0032f7d21fd7bmr2233021wrr.39.1699471590930; Wed, 08 Nov 2023 11:26:30 -0800 (PST) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id ba15-20020a0560001c0f00b0032326908972sm5665677wrb.17.2023.11.08.11.26.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 11:26:30 -0800 (PST) From: luca.boccassi@gmail.com To: Huisong Li Cc: Jie Hai , dpdk stable Subject: patch 'net/hns3: fix setting DCB capability' has been queued to stable release 20.11.10 Date: Wed, 8 Nov 2023 19:25:18 +0000 Message-Id: <20231108192535.922238-20-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231108192535.922238-1-luca.boccassi@gmail.com> References: <20231018235930.3144-41-luca.boccassi@gmail.com> <20231108192535.922238-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/10/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://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/4cf3c2381b0ccbd1491f3662e4739bac41a8c72d Thanks. Luca Boccassi --- >From 4cf3c2381b0ccbd1491f3662e4739bac41a8c72d 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 [ 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 | 8 -------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/drivers/net/hns3/hns3_cmd.c b/drivers/net/hns3/hns3_cmd.c index dc65ef8c26..2a67c264c6 100644 --- a/drivers/net/hns3/hns3_cmd.c +++ b/drivers/net/hns3/hns3_cmd.c @@ -448,6 +448,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) { @@ -465,6 +487,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); + hns3_parse_capability(hw, resp); return 0; diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index 2acb2a56d6..454f73ac77 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -3112,19 +3112,11 @@ hns3_get_capability(struct hns3_hw *hw) struct rte_pci_device *pci_dev; struct hns3_pf *pf = &hns->pf; struct rte_eth_dev *eth_dev; - uint16_t device_id; uint8_t revision; 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); /* Get PCI revision id */ ret = rte_pci_read_config(pci_dev, &revision, HNS3_PCI_REVISION_ID_LEN, -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-11-08 19:23:52.992733685 +0000 +++ 0020-net-hns3-fix-setting-DCB-capability.patch 2023-11-08 19:23:51.793396707 +0000 @@ -1 +1 @@ -From ac61c444e647298dded80a2ab52966a2dbe22b68 Mon Sep 17 00:00:00 2001 +From 4cf3c2381b0ccbd1491f3662e4739bac41a8c72d Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit ac61c444e647298dded80a2ab52966a2dbe22b68 ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -18,2 +19,2 @@ - drivers/net/hns3/hns3_ethdev.c | 13 ------------- - 2 files changed, 25 insertions(+), 13 deletions(-) + drivers/net/hns3/hns3_ethdev.c | 8 -------- + 2 files changed, 25 insertions(+), 8 deletions(-) @@ -22 +23 @@ -index ca1d3f1b8c..62c55f347f 100644 +index dc65ef8c26..2a67c264c6 100644 @@ -25 +26 @@ -@@ -525,6 +525,28 @@ hns3_build_api_caps(void) +@@ -448,6 +448,28 @@ hns3_build_api_caps(void) @@ -54 +55 @@ -@@ -542,6 +564,9 @@ hns3_cmd_query_firmware_version_and_capability(struct hns3_hw *hw) +@@ -465,6 +487,9 @@ hns3_cmd_query_firmware_version_and_capability(struct hns3_hw *hw) @@ -61,3 +62,3 @@ - /* - * Make sure mask the capability before parse capability because it - * may overwrite resp's data. + hns3_parse_capability(hw, resp); + + return 0; @@ -65 +66 @@ -index 0feea52542..472737e8a8 100644 +index 2acb2a56d6..454f73ac77 100644 @@ -68,5 +69,2 @@ -@@ -2719,22 +2719,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; +@@ -3112,19 +3112,11 @@ hns3_get_capability(struct hns3_hw *hw) + struct rte_pci_device *pci_dev; @@ -74 +72 @@ -- struct rte_eth_dev *eth_dev; + struct rte_eth_dev *eth_dev; @@ -75,0 +74 @@ + uint8_t revision; @@ -78,2 +77,2 @@ -- eth_dev = &rte_eth_devices[hw->data->port_id]; -- pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); + eth_dev = &rte_eth_devices[hw->data->port_id]; + pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); @@ -87,4 +86,3 @@ -- - ret = hns3_get_pci_revision_id(hw, &hw->revision); - if (ret) - return ret; + + /* Get PCI revision id */ + ret = rte_pci_read_config(pci_dev, &revision, HNS3_PCI_REVISION_ID_LEN,