net/mlx5: fix device checking for send to kernel action

Message ID 20231025074831.6098-1-jiaweiw@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series net/mlx5: fix device checking for send to kernel action |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-compile-arm64-testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-broadcom-Functional success Functional Testing PASS

Commit Message

Jiawei Wang Oct. 25, 2023, 7:48 a.m. UTC
  The previous commit extended the send to kernel support on FDB table.
This action creation failed at MLX5 core kernel module, due to the
VF/SF ports do NOT belong to E-Switch mode.
The failure caused the kernel stuck with the older MLX5 core
kernel version.

This patch adds the checking to avoid creating action at the VF/SF ports
on the FDB table.

Fixes: b2cd39187cd4 ("net/mlx5: extend send to kernel action support")

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Suanming Mou <suanmingm@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 3 +++
 1 file changed, 3 insertions(+)
  

Comments

Raslan Darawsheh Oct. 25, 2023, 8:42 a.m. UTC | #1
Hi,

> -----Original Message-----
> From: Jiawei(Jonny) Wang <jiaweiw@nvidia.com>
> Sent: Wednesday, October 25, 2023 10:49 AM
> To: Suanming Mou <suanmingm@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>
> Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>
> Subject: [PATCH] net/mlx5: fix device checking for send to kernel action
> 
> The previous commit extended the send to kernel support on FDB table.
> This action creation failed at MLX5 core kernel module, due to the VF/SF ports
> do NOT belong to E-Switch mode.
> The failure caused the kernel stuck with the older MLX5 core kernel version.
> 
> This patch adds the checking to avoid creating action at the VF/SF ports on the
> FDB table.
> 
> Fixes: b2cd39187cd4 ("net/mlx5: extend send to kernel action support")
> 
> Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
> Acked-by: Suanming Mou <suanmingm@nvidia.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh
  

Patch

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 6fcf654e4a..89b6f546ae 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -5957,8 +5957,11 @@  flow_hw_create_send_to_kernel_actions(struct mlx5_priv *priv __rte_unused)
 #ifdef HAVE_MLX5DV_DR_ACTION_CREATE_DEST_ROOT_TABLE
 	int action_flag;
 	int i;
+	bool is_vf_sf_dev = priv->sh->dev_cap.vf || priv->sh->dev_cap.sf;
 
 	for (i = MLX5DR_TABLE_TYPE_NIC_RX; i < MLX5DR_TABLE_TYPE_MAX; i++) {
+		if (is_vf_sf_dev && MLX5DR_TABLE_TYPE_FDB == i)
+			continue;
 		action_flag = mlx5_hw_act_flag[1][i];
 		priv->hw_send_to_kernel[i] =
 				mlx5dr_action_create_dest_root(priv->dr_ctx,