common/mlx5: add provider query port support to glue library
Subsystems (2)
PATCH 1/1 common/mlx5: add provider query port support to glue library
The rdma-core mlx5 provider introduced the port attributes query API since version v35.0. The patch adds the conditional support of this API to the glue library. The transitional OFED rdma-core versions provide both APIs for compatibility, the new API has a priority for the case.
The compile time configuration key HAVE_MLX5DV_DR_DEVX_PORT was used to choose the destination E-Switch port action creation routine. This dependency should be removed and new dedicated key HAVE_MLX5DV_DR_CREATE_DEST_IB_PORT is introduced.
--- drivers/common/mlx5/linux/meson.build | 4 ++ drivers/common/mlx5/linux/mlx5_glue.c | 57 ++++++++++++++++++++----- drivers/common/mlx5/linux/mlx5_glue.h | 16 ++++++- drivers/net/mlx5/linux/mlx5_os.c | 60 ++++++++++++--------------- drivers/net/mlx5/mlx5_flow_dv.c | 2 +- 5 files changed, 93 insertions(+), 46 deletions(-)
drivers/common/mlx5/linux/meson.build +4 -0
@@ -93,6 +93,10 @@ has_sym_args = [ 'IBV_WQ_FLAG_RX_END_PADDING' ], [ 'HAVE_MLX5DV_DR_DEVX_PORT', 'infiniband/mlx5dv.h', 'mlx5dv_query_devx_port' ], + [ 'HAVE_MLX5DV_DR_DEVX_PORT_V35', 'infiniband/mlx5dv.h', + 'mlx5dv_query_port' ], + [ 'HAVE_MLX5DV_DR_CREATE_DEST_IB_PORT', 'infiniband/mlx5dv.h', + 'mlx5dv_dr_action_create_dest_ib_port' ], [ 'HAVE_IBV_DEVX_OBJ', 'infiniband/mlx5dv.h', 'mlx5dv_devx_obj_create' ], [ 'HAVE_IBV_FLOW_DEVX_COUNTERS', 'infiniband/mlx5dv.h',
drivers/common/mlx5/linux/mlx5_glue.c +47 -10
71 lines not on this page · raw message
drivers/common/mlx5/linux/mlx5_glue.h +15 -1
@@ -84,6 +84,20 @@ struct mlx5dv_dr_action;struct mlx5dv_devx_port ;#endif +#ifndef HAVE_MLX5DV_DR_DEVX_PORT_V35 +struct mlx5dv_port ; +#endif + +#define MLX5_PORT_QUERY_VPORT (1u << 0) +#define MLX5_PORT_QUERY_REG_C0 (1u << 1) + +struct mlx5_port_info { +uint16_t query_flags; +uint16_t vport_id;/* Associated VF vport index (if any). */ +uint32_t vport_meta_tag;/* Used for vport index match ove VF LAG. */ +uint32_t vport_meta_mask;/* Used for vport index field match mask. */ +}; +#ifndef HAVE_MLX5_DR_CREATE_ACTION_FLOW_METER struct mlx5dv_dr_flow_meter_attr ;#endif
@@ -311,7 +325,7 @@ struct mlx5_glue { void *out, size_t outlen);int (*devx_port_query)(struct ibv_context *ctx,uint32_t port_num, -struct mlx5dv_devx_port *mlx5_devx_port); +struct mlx5_port_info *info);int (*dr_dump_domain)(FILE *file,void *domain);int (*dr_dump_rule)(FILE *file,void *rule); int (*devx_query_eqn)(struct ibv_context *context, uint32_t cpus,
drivers/net/mlx5/linux/mlx5_os.c +26 -34
97 lines not on this page · raw message
drivers/net/mlx5/mlx5_flow_dv.c +1 -1
@@ -10330,7 +10330,7 @@ flow_dv_translate_action_port_id(struct rte_eth_dev *dev,RTE_FLOW_ERROR_TYPE_ACTION ,NULL , "No eswitch info was found for port"); -#ifdef HAVE_MLX5DV_DR_DEVX_PORT +#ifdef HAVE_MLX5DV_DR_CREATE_DEST_IB_PORT /* * This parameter is transferred to * mlx5dv_dr_action_create_dest_ib_port().
Signature · 1 line
2.18.1
Hi,
Quoted 21 lines
-----Original Message-----
From: Slava Ovsiienko <[email protected]>
Sent: Monday, June 7, 2021 12:37 PM
To: [email protected]
Cc: Raslan Darawsheh <[email protected]>; Matan Azrad <[email protected]>; [email protected]
Subject: [PATCH] common/mlx5: add provider query port support to glue libraryThe rdma-core mlx5 provider introduced the port attributes query API since version v35.0. The patch adds the conditional support of this API to the glue library. The transitional OFED rdma-core versions provide both APIs for compatibility, the new API has a priority for the case.
The compile time configuration key
HAVE_MLX5DV_DR_DEVX_PORTwas used to choose the destination E-Switch port action creation routine. This dependency should be removed and new dedicated keyHAVE_MLX5DV_DR_CREATE_DEST_IB_PORTis introduced.
Quoted 4 lines
Signed-off-by Viacheslav Ovsiienko <[email protected]>Acked-by Matan Azrad <[email protected]>
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh