Add query port capabilities to share steering objects
between multiple ports of the same physical NIC.

Signed-off-by: Viacheslav Ovsiienko <viachesl...@nvidia.com>
---
 drivers/common/mlx5/mlx5_devx_cmds.c | 13 +++++++++++++
 drivers/common/mlx5/mlx5_devx_cmds.h |  1 +
 2 files changed, 14 insertions(+)

diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c 
b/drivers/common/mlx5/mlx5_devx_cmds.c
index e3a4927d0f..17128035ec 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.c
+++ b/drivers/common/mlx5/mlx5_devx_cmds.c
@@ -1047,6 +1047,19 @@ mlx5_devx_cmd_query_hca_attr(void *ctx,
                attr->flow_counter_bulk_log_granularity =
                        MLX5_GET(cmd_hca_cap_2, hcattr,
                                 flow_counter_bulk_log_granularity);
+               rc = MLX5_GET(cmd_hca_cap_2, hcattr,
+                             cross_vhca_object_to_object_supported);
+               attr->cross_vhca =
+                       (rc & MLX5_CROSS_VHCA_OBJ_TO_OBJ_TYPE_STC_TO_TIR) &&
+                       (rc & MLX5_CROSS_VHCA_OBJ_TO_OBJ_TYPE_STC_TO_FT) &&
+                       (rc & MLX5_CROSS_VHCA_OBJ_TO_OBJ_TYPE_FT_TO_FT) &&
+                       (rc & MLX5_CROSS_VHCA_OBJ_TO_OBJ_TYPE_FT_TO_RTC);
+               rc = MLX5_GET(cmd_hca_cap_2, hcattr,
+                             allowed_object_for_other_vhca_access);
+               attr->cross_vhca = attr->cross_vhca &&
+                       (rc & MLX5_CROSS_VHCA_ALLOWED_OBJS_TIR) &&
+                       (rc & MLX5_CROSS_VHCA_ALLOWED_OBJS_FT) &&
+                       (rc & MLX5_CROSS_VHCA_ALLOWED_OBJS_RTC);
        }
        if (attr->log_min_stride_wqe_sz == 0)
                attr->log_min_stride_wqe_sz = MLX5_MPRQ_LOG_MIN_STRIDE_WQE_SIZE;
diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h 
b/drivers/common/mlx5/mlx5_devx_cmds.h
index c94b9eac06..b65ba569bc 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.h
+++ b/drivers/common/mlx5/mlx5_devx_cmds.h
@@ -288,6 +288,7 @@ struct mlx5_hca_attr {
        uint32_t alloc_flow_counter_pd:1;
        uint32_t flow_counter_access_aso:1;
        uint32_t flow_access_aso_opc_mod:8;
+       uint32_t cross_vhca:1;
 };
 
 /* LAG Context. */
-- 
2.18.1

Reply via email to