RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
"cannot allocate resource memory");
*cache_resource = *resource;
+ /*
+ * Depending on rdma_core version the glue routine calls
+ * either mlx5dv_dr_action_create_dest_ib_port(domain, ibv_port)
+ * or mlx5dv_dr_action_create_dest_vport(domain, vport_id).
+ */
cache_resource->action =
- mlx5_glue->dr_create_flow_action_dest_vport
+ mlx5_glue->dr_create_flow_action_dest_port
(priv->sh->fdb_domain, resource->port_id);
if (!cache_resource->action) {
rte_free(cache_resource);
RTE_FLOW_ERROR_TYPE_ACTION,
NULL,
"No eswitch info was found for port");
+#ifdef HAVE_MLX5DV_DR_DEVX_PORT
+ /*
+ * This parameter is transferred to
+ * mlx5dv_dr_action_create_dest_ib_port().
+ */
+ *dst_port_id = priv->ibv_port;
+#else
+ /*
+ * Legacy mode, no LAG configurations is supported.
+ * This parameter is transferred to
+ * mlx5dv_dr_action_create_dest_vport().
+ */
*dst_port_id = priv->vport_id;
+#endif
return 0;
}
}
static void *
-mlx5_glue_dr_create_flow_action_dest_vport(void *domain, uint32_t vport)
+mlx5_glue_dr_create_flow_action_dest_port(void *domain, uint32_t port)
{
+#ifdef HAVE_MLX5DV_DR_DEVX_PORT
+ return mlx5dv_dr_action_create_dest_ib_port(domain, port);
+#else
#ifdef HAVE_MLX5DV_DR_ESWITCH
- return mlx5dv_dr_action_create_dest_vport(domain, vport);
+ return mlx5dv_dr_action_create_dest_vport(domain, port);
#else
(void)domain;
- (void)vport;
+ (void)port;
errno = ENOTSUP;
return NULL;
#endif
+#endif
}
static void *
.cq_ex_to_cq = mlx5_glue_cq_ex_to_cq,
.dr_create_flow_action_dest_flow_tbl =
mlx5_glue_dr_create_flow_action_dest_flow_tbl,
- .dr_create_flow_action_dest_vport =
- mlx5_glue_dr_create_flow_action_dest_vport,
+ .dr_create_flow_action_dest_port =
+ mlx5_glue_dr_create_flow_action_dest_port,
.dr_create_flow_action_drop =
mlx5_glue_dr_create_flow_action_drop,
.dr_create_flow_action_push_vlan =
const char *(*port_state_str)(enum ibv_port_state port_state);
struct ibv_cq *(*cq_ex_to_cq)(struct ibv_cq_ex *cq);
void *(*dr_create_flow_action_dest_flow_tbl)(void *tbl);
- void *(*dr_create_flow_action_dest_vport)(void *domain, uint32_t vport);
+ void *(*dr_create_flow_action_dest_port)(void *domain,
+ uint32_t port);
void *(*dr_create_flow_action_drop)();
void *(*dr_create_flow_action_push_vlan)
(struct mlx5dv_dr_domain *domain,