summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaeed Mahameed <saeedm@nvidia.com>2025-08-29 15:37:19 -0700
committerPaolo Abeni <pabeni@redhat.com>2025-09-02 15:18:16 +0200
commit9984ec9f1f502dc5e19daf4210b221f554ca35db (patch)
tree7e9ec6f26a91ac8fa22e9d5abadbf55728b0c9ed
parent17426c5d4b1db69c0aa34d0bf6a1552cc2c68d95 (diff)
net/mlx5: E-Switch, Create acls root namespace for adjacent vports
Use the new vport acl root namespace add/remove API to create the missing acl root name spaces per each new adjacent function vport. Signed-off-by: Saeed Mahameed <saeedm@nvidia.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20250829223722.900629-5-saeed@kernel.org Signed-off-by: Paolo Abeni <pabeni@redhat.com>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/esw/adj_vport.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/adj_vport.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/adj_vport.c
index 37a06c0949d5..1d104b3fe9e0 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/esw/adj_vport.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/adj_vport.c
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
// Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+#include "fs_core.h"
#include "eswitch.h"
enum {
@@ -82,6 +83,9 @@ static int mlx5_esw_adj_vport_create(struct mlx5_eswitch *esw, u16 vhca_id)
vport->adjacent = true;
vport->vhca_id = vhca_id;
+ mlx5_fs_vport_egress_acl_ns_add(esw->dev->priv.steering, vport->index);
+ mlx5_fs_vport_ingress_acl_ns_add(esw->dev->priv.steering, vport->index);
+
mlx5_esw_adj_vport_modify(esw->dev, vport_num, MLX5_ADJ_VPORT_CONNECT);
return 0;
@@ -99,6 +103,10 @@ static void mlx5_esw_adj_vport_destroy(struct mlx5_eswitch *esw,
vport_num, vport->vhca_id);
mlx5_esw_adj_vport_modify(esw->dev, vport_num,
MLX5_ADJ_VPORT_DISCONNECT);
+ mlx5_fs_vport_egress_acl_ns_remove(esw->dev->priv.steering,
+ vport->index);
+ mlx5_fs_vport_ingress_acl_ns_remove(esw->dev->priv.steering,
+ vport->index);
mlx5_esw_vport_free(esw, vport);
/* Reset the vport index back so new adj vports can use this index.
* When vport count can incrementally change, this needs to be modified.