[v4,3/5] common/mlx5: add cross port object sharing capability
Checks
Commit Message
Add query port capabilities to share steering objects
between multiple ports of the same physical NIC.
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
drivers/common/mlx5/mlx5_devx_cmds.c | 13 +++++++++++++
drivers/common/mlx5/mlx5_devx_cmds.h | 1 +
2 files changed, 14 insertions(+)
@@ -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;
@@ -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. */