[v2,09/13] common/mlx5: read VLAN capability from DevX

Message ID 20211012124554.21296-10-talshn@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Series Expand NIC offloads support on Windows |


Context Check Description
ci/checkpatch success coding style OK

Commit Message

Tal Shnaiderman Oct. 12, 2021, 12:45 p.m. UTC
  mlx5 in Windows needs the hca capability vlan_cap
to query the NIC for VLAN stripping support

Added the capability as part of the capabilities
queried by the PMD using DevX.

Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Tested-by: Idan Hackmon <idanhac@nvidia.com>
 drivers/common/mlx5/mlx5_devx_cmds.c | 2 ++
 drivers/common/mlx5/mlx5_devx_cmds.h | 1 +
 2 files changed, 3 insertions(+)


diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c
index be3c3e61d1..deee4954f4 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.c
+++ b/drivers/common/mlx5/mlx5_devx_cmds.c
@@ -985,6 +985,8 @@  mlx5_devx_cmd_query_hca_attr(void *ctx,
 					 hcattr, wqe_vlan_insert);
 	attr->csum_cap = MLX5_GET(per_protocol_networking_offload_caps,
 					 hcattr, csum_cap);
+	attr->vlan_cap = MLX5_GET(per_protocol_networking_offload_caps,
+					 hcattr, vlan_cap);
 	attr->lro_cap = MLX5_GET(per_protocol_networking_offload_caps, hcattr,
 	attr->max_lso_cap = MLX5_GET(per_protocol_networking_offload_caps,
diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h
index 7a0155558e..f4aa851cd0 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.h
+++ b/drivers/common/mlx5/mlx5_devx_cmds.h
@@ -108,6 +108,7 @@  struct mlx5_hca_attr {
 	uint32_t eth_virt:1;
 	uint32_t wqe_vlan_insert:1;
 	uint32_t csum_cap:1;
+	uint32_t vlan_cap:1;
 	uint32_t wqe_inline_mode:2;
 	uint32_t vport_inline_mode:3;
 	uint32_t tunnel_stateless_geneve_rx:1;