patch 'vdpa/nfp: fix reconfiguration' has been queued to stable release 23.11.3
Xueming Li
xuemingl at nvidia.com
Mon Nov 11 07:27:35 CET 2024
Hi,
FYI, your patch has been queued to stable release 23.11.3
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/30/24. 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=23.11-staging
This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=a46c4c1b435b99d9b5a3a2a9867b452cf42abd49
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From a46c4c1b435b99d9b5a3a2a9867b452cf42abd49 Mon Sep 17 00:00:00 2001
From: Xinying Yu <xinying.yu at corigine.com>
Date: Mon, 5 Aug 2024 10:12:40 +0800
Subject: [PATCH] vdpa/nfp: fix reconfiguration
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit d149827203a61da4c8c9e4a13e07bb0260438124 ]
The ctrl words of vDPA is located on the extended word, so it
should use the 'nfp_ext_reconfig()' rather than 'nfp_reconfig()'.
Also replace the misuse of 'NFP_NET_CFG_CTRL_SCATTER' macro
with 'NFP_NET_CFG_CTRL_VIRTIO'.
Fixes: b47a0373903f ("vdpa/nfp: add datapath update")
Signed-off-by: Xinying Yu <xinying.yu at corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he at corigine.com>
Reviewed-by: Long Wu <long.wu at corigine.com>
Reviewed-by: Peng Zhang <peng.zhang at corigine.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
drivers/common/nfp/nfp_common_ctrl.h | 1 +
drivers/vdpa/nfp/nfp_vdpa_core.c | 16 ++++++++++++----
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/drivers/common/nfp/nfp_common_ctrl.h b/drivers/common/nfp/nfp_common_ctrl.h
index d09fd2b892..532bc6584a 100644
--- a/drivers/common/nfp/nfp_common_ctrl.h
+++ b/drivers/common/nfp/nfp_common_ctrl.h
@@ -223,6 +223,7 @@ struct nfp_net_fw_ver {
#define NFP_NET_CFG_CTRL_IPSEC_SM_LOOKUP (0x1 << 3) /**< SA short match lookup */
#define NFP_NET_CFG_CTRL_IPSEC_LM_LOOKUP (0x1 << 4) /**< SA long match lookup */
#define NFP_NET_CFG_CTRL_MULTI_PF (0x1 << 5)
+#define NFP_NET_CFG_CTRL_VIRTIO (0x1 << 10) /**< Virtio offload */
#define NFP_NET_CFG_CTRL_IN_ORDER (0x1 << 11) /**< Virtio in-order flag */
#define NFP_NET_CFG_CAP_WORD1 0x00a4
diff --git a/drivers/vdpa/nfp/nfp_vdpa_core.c b/drivers/vdpa/nfp/nfp_vdpa_core.c
index 291798196c..6d07356581 100644
--- a/drivers/vdpa/nfp/nfp_vdpa_core.c
+++ b/drivers/vdpa/nfp/nfp_vdpa_core.c
@@ -101,7 +101,7 @@ nfp_vdpa_hw_init(struct nfp_vdpa_hw *vdpa_hw,
static uint32_t
nfp_vdpa_check_offloads(void)
{
- return NFP_NET_CFG_CTRL_SCATTER |
+ return NFP_NET_CFG_CTRL_VIRTIO |
NFP_NET_CFG_CTRL_IN_ORDER;
}
@@ -112,6 +112,7 @@ nfp_vdpa_hw_start(struct nfp_vdpa_hw *vdpa_hw,
int ret;
uint32_t update;
uint32_t new_ctrl;
+ uint32_t new_ext_ctrl;
struct timespec wait_tst;
struct nfp_hw *hw = &vdpa_hw->super;
uint8_t mac_addr[RTE_ETHER_ADDR_LEN];
@@ -131,8 +132,6 @@ nfp_vdpa_hw_start(struct nfp_vdpa_hw *vdpa_hw,
nfp_disable_queues(hw);
nfp_enable_queues(hw, NFP_VDPA_MAX_QUEUES, NFP_VDPA_MAX_QUEUES);
- new_ctrl = nfp_vdpa_check_offloads();
-
nn_cfg_writel(hw, NFP_NET_CFG_MTU, 9216);
nn_cfg_writel(hw, NFP_NET_CFG_FLBUFSZ, 10240);
@@ -147,8 +146,17 @@ nfp_vdpa_hw_start(struct nfp_vdpa_hw *vdpa_hw,
/* Writing new MAC to the specific port BAR address */
nfp_write_mac(hw, (uint8_t *)mac_addr);
+ new_ext_ctrl = nfp_vdpa_check_offloads();
+
+ update = NFP_NET_CFG_UPDATE_GEN;
+ ret = nfp_ext_reconfig(hw, new_ext_ctrl, update);
+ if (ret != 0)
+ return -EIO;
+
+ hw->ctrl_ext = new_ext_ctrl;
+
/* Enable device */
- new_ctrl |= NFP_NET_CFG_CTRL_ENABLE;
+ new_ctrl = NFP_NET_CFG_CTRL_ENABLE;
/* Signal the NIC about the change */
update = NFP_NET_CFG_UPDATE_MACADDR |
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-11-11 14:23:07.484732592 +0800
+++ 0049-vdpa-nfp-fix-reconfiguration.patch 2024-11-11 14:23:05.122192840 +0800
@@ -1 +1 @@
-From d149827203a61da4c8c9e4a13e07bb0260438124 Mon Sep 17 00:00:00 2001
+From a46c4c1b435b99d9b5a3a2a9867b452cf42abd49 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit d149827203a61da4c8c9e4a13e07bb0260438124 ]
@@ -13 +15,0 @@
-Cc: stable at dpdk.org
@@ -26 +28 @@
-index 69596dd6f5..1b30f81fdb 100644
+index d09fd2b892..532bc6584a 100644
@@ -29 +31,2 @@
-@@ -205,6 +205,7 @@ struct nfp_net_fw_ver {
+@@ -223,6 +223,7 @@ struct nfp_net_fw_ver {
+ #define NFP_NET_CFG_CTRL_IPSEC_SM_LOOKUP (0x1 << 3) /**< SA short match lookup */
@@ -32 +34,0 @@
- #define NFP_NET_CFG_CTRL_FLOW_STEER (0x1 << 8) /**< Flow Steering */
@@ -35 +36,0 @@
- #define NFP_NET_CFG_CTRL_USO (0x1 << 16) /**< UDP segmentation offload */
@@ -36,0 +38 @@
+ #define NFP_NET_CFG_CAP_WORD1 0x00a4
More information about the stable
mailing list