From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 33094A49 for ; Wed, 1 May 2019 22:40:55 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE2 (envelope-from orika@mellanox.com) with ESMTPS (AES256-SHA encrypted); 1 May 2019 23:40:54 +0300 Received: from pegasus03.mtr.labs.mlnx (pegasus03.mtr.labs.mlnx [10.210.16.124]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x41KesDh007234; Wed, 1 May 2019 23:40:54 +0300 From: Ori Kam To: yskoh@mellanox.com, shahafs@mellanox.com Cc: dev@dpdk.org, orika@mellanox.com Date: Wed, 1 May 2019 20:40:45 +0000 Message-Id: <1556743245-138357-1-git-send-email-orika@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] net/mlx5: fix Direct Rules API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 20:40:55 -0000 The RDMA-CORE Direct Rules API was changed in latest upstream code This commit update the API accordingly. Fixes: 4f84a19779ca ("net/mlx5: add Direct Rules API") Signed-off-by: Ori Kam --- drivers/net/mlx5/Makefile | 4 +-- drivers/net/mlx5/meson.build | 4 +-- drivers/net/mlx5/mlx5.c | 68 +++++++++++++++++++------------------- drivers/net/mlx5/mlx5.h | 6 ++-- drivers/net/mlx5/mlx5_flow_dv.c | 30 +++++++++-------- drivers/net/mlx5/mlx5_glue.c | 73 +++++++++++++++++++++-------------------- drivers/net/mlx5/mlx5_glue.h | 19 ++++++----- 7 files changed, 104 insertions(+), 100 deletions(-) diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile index 2b72a33..2694916 100644 --- a/drivers/net/mlx5/Makefile +++ b/drivers/net/mlx5/Makefile @@ -158,12 +158,12 @@ mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh $Q sh -- '$<' '$@' \ HAVE_MLX5DV_DR \ infiniband/mlx5dv.h \ - enum MLX5DV_DR_NS_TYPE_TERMINATING \ + enum MLX5DV_DR_DOMAIN_TYPE_NIC_RX \ $(AUTOCONF_OUTPUT) $Q sh -- '$<' '$@' \ HAVE_MLX5DV_DR_ESWITCH \ infiniband/mlx5dv.h \ - enum MLX5DV_DR_NS_DOMAIN_FDB_BYPASS \ + enum MLX5DV_DR_DOMAIN_TYPE_FDB \ $(AUTOCONF_OUTPUT) $Q sh -- '$<' '$@' \ HAVE_IBV_DEVX_OBJ \ diff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build index cf5e7e7..ac3b529 100644 --- a/drivers/net/mlx5/meson.build +++ b/drivers/net/mlx5/meson.build @@ -115,9 +115,9 @@ if build [ 'HAVE_IBV_FLOW_DEVX_COUNTERS', 'infiniband/mlx5dv.h', 'MLX5DV_FLOW_ACTION_COUNTERS_DEVX' ], [ 'HAVE_MLX5DV_DR', 'infiniband/mlx5dv.h', - 'MLX5DV_DR_NS_TYPE_TERMINATING' ], + 'MLX5DV_DR_DOMAIN_TYPE_NIC_RX' ], [ 'HAVE_MLX5DV_DR_ESWITCH', 'infiniband/mlx5dv.h', - 'MLX5DV_DR_NS_DOMAIN_FDB_BYPASS' ], + 'MLX5DV_DR_DOMAIN_TYPE_FDB' ], [ 'HAVE_SUPPORTED_40000baseKR4_Full', 'linux/ethtool.h', 'SUPPORTED_40000baseKR4_Full' ], [ 'HAVE_SUPPORTED_40000baseCR4_Full', 'linux/ethtool.h', diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index de85e85..9f5ec97 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -342,7 +342,7 @@ struct mlx5_dev_spawn_data { #ifdef HAVE_MLX5DV_DR struct mlx5_ibv_shared *sh = priv->sh; int err = 0; - void *ns; + void *domain; assert(sh); if (sh->dv_refcnt) { @@ -352,33 +352,33 @@ struct mlx5_dev_spawn_data { return 0; } /* Reference counter is zero, we should initialize structures. */ - ns = mlx5_glue->dr_create_ns(sh->ctx, - MLX5DV_DR_NS_DOMAIN_INGRESS_BYPASS); - if (!ns) { - DRV_LOG(ERR, "ingress mlx5dv_dr_create_ns failed"); + domain = mlx5_glue->dr_create_domain(sh->ctx, + MLX5DV_DR_DOMAIN_TYPE_NIC_RX); + if (!domain) { + DRV_LOG(ERR, "ingress mlx5dv_dr_create_domain failed"); err = errno; goto error; } - sh->rx_ns = ns; - ns = mlx5_glue->dr_create_ns(sh->ctx, - MLX5DV_DR_NS_DOMAIN_EGRESS_BYPASS); - if (!ns) { - DRV_LOG(ERR, "egress mlx5dv_dr_create_ns failed"); + sh->rx_domain = domain; + domain = mlx5_glue->dr_create_domain(sh->ctx, + MLX5DV_DR_DOMAIN_TYPE_NIC_TX); + if (!domain) { + DRV_LOG(ERR, "egress mlx5dv_dr_create_domain failed"); err = errno; goto error; } pthread_mutex_init(&sh->dv_mutex, NULL); - sh->tx_ns = ns; + sh->tx_domain = domain; #ifdef HAVE_MLX5DV_DR_ESWITCH if (priv->config.dv_esw_en) { - ns = mlx5_glue->dr_create_ns(sh->ctx, - MLX5DV_DR_NS_DOMAIN_FDB_BYPASS); - if (!ns) { - DRV_LOG(ERR, "FDB mlx5dv_dr_create_ns failed"); + domain = mlx5_glue->dr_create_domain + (sh->ctx, MLX5DV_DR_DOMAIN_TYPE_FDB); + if (!domain) { + DRV_LOG(ERR, "FDB mlx5dv_dr_create_domain failed"); err = errno; goto error; } - sh->fdb_ns = ns; + sh->fdb_domain = domain; sh->esw_drop_action = mlx5_glue->dr_create_flow_action_drop(); } #endif @@ -388,17 +388,17 @@ struct mlx5_dev_spawn_data { error: /* Rollback the created objects. */ - if (sh->rx_ns) { - mlx5_glue->dr_destroy_ns(sh->rx_ns); - sh->rx_ns = NULL; + if (sh->rx_domain) { + mlx5_glue->dr_destroy_domain(sh->rx_domain); + sh->rx_domain = NULL; } - if (sh->tx_ns) { - mlx5_glue->dr_destroy_ns(sh->tx_ns); - sh->tx_ns = NULL; + if (sh->tx_domain) { + mlx5_glue->dr_destroy_domain(sh->tx_domain); + sh->tx_domain = NULL; } - if (sh->fdb_ns) { - mlx5_glue->dr_destroy_ns(sh->fdb_ns); - sh->fdb_ns = NULL; + if (sh->fdb_domain) { + mlx5_glue->dr_destroy_domain(sh->fdb_domain); + sh->fdb_domain = NULL; } if (sh->esw_drop_action) { mlx5_glue->destroy_flow_action(sh->esw_drop_action); @@ -431,18 +431,18 @@ struct mlx5_dev_spawn_data { assert(sh->dv_refcnt); if (sh->dv_refcnt && --sh->dv_refcnt) return; - if (sh->rx_ns) { - mlx5_glue->dr_destroy_ns(sh->rx_ns); - sh->rx_ns = NULL; + if (sh->rx_domain) { + mlx5_glue->dr_destroy_domain(sh->rx_domain); + sh->rx_domain = NULL; } - if (sh->tx_ns) { - mlx5_glue->dr_destroy_ns(sh->tx_ns); - sh->tx_ns = NULL; + if (sh->tx_domain) { + mlx5_glue->dr_destroy_domain(sh->tx_domain); + sh->tx_domain = NULL; } #ifdef HAVE_MLX5DV_DR_ESWITCH - if (sh->fdb_ns) { - mlx5_glue->dr_destroy_ns(sh->fdb_ns); - sh->fdb_ns = NULL; + if (sh->fdb_domain) { + mlx5_glue->dr_destroy_domain(sh->fdb_domain); + sh->fdb_domain = NULL; } if (sh->esw_drop_action) { mlx5_glue->destroy_flow_action(sh->esw_drop_action); diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 82fcb29..3eaaafd 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -288,13 +288,13 @@ struct mlx5_ibv_shared { /* Shared DV/DR flow data section. */ pthread_mutex_t dv_mutex; /* DV context mutex. */ uint32_t dv_refcnt; /* DV/DR data reference counter. */ - void *fdb_ns; /* FDB Direct Rules name space handle. */ + void *fdb_domain; /* FDB Direct Rules name space handle. */ struct mlx5_flow_tbl_resource fdb_tbl[MLX5_MAX_TABLES_FDB]; /* FDB Direct Rules tables. */ - void *rx_ns; /* RX Direct Rules name space handle. */ + void *rx_domain; /* RX Direct Rules name space handle. */ struct mlx5_flow_tbl_resource rx_tbl[MLX5_MAX_TABLES]; /* RX Direct Rules tables. */ - void *tx_ns; /* TX Direct Rules name space handle. */ + void *tx_domain; /* TX Direct Rules name space handle. */ struct mlx5_flow_tbl_resource tx_tbl[MLX5_MAX_TABLES]; void *esw_drop_action; /* Pointer to DR E-Switch drop action. */ /* TX Direct Rules tables/ */ diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index eea67a1..c248b36 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -40,8 +40,10 @@ #endif #ifndef HAVE_MLX5DV_DR_ESWITCH +#ifndef MLX5DV_FLOW_TABLE_TYPE_FDB #define MLX5DV_FLOW_TABLE_TYPE_FDB 0 #endif +#endif #ifndef HAVE_MLX5DV_DR #define MLX5DV_DR_ACTION_FLAGS_ROOT_LEVEL 1 @@ -943,15 +945,15 @@ struct field_modify_info modify_tcp[] = { struct mlx5_ibv_shared *sh = priv->sh; struct mlx5_flow_dv_encap_decap_resource *cache_resource; struct rte_flow *flow = dev_flow->flow; - struct mlx5dv_dr_ns *ns; + struct mlx5dv_dr_domain *domain; resource->flags = flow->group ? 0 : 1; if (resource->ft_type == MLX5DV_FLOW_TABLE_TYPE_FDB) - ns = sh->fdb_ns; + domain = sh->fdb_domain; else if (resource->ft_type == MLX5DV_FLOW_TABLE_TYPE_NIC_RX) - ns = sh->rx_ns; + domain = sh->rx_domain; else - ns = sh->tx_ns; + domain = sh->tx_domain; /* Lookup a matching resource from cache. */ LIST_FOREACH(cache_resource, &sh->encaps_decaps, next) { @@ -980,7 +982,7 @@ struct field_modify_info modify_tcp[] = { cache_resource->verbs_action = mlx5_glue->dv_create_flow_action_packet_reformat (sh->ctx, cache_resource->reformat_type, - cache_resource->ft_type, ns, cache_resource->flags, + cache_resource->ft_type, domain, cache_resource->flags, cache_resource->size, (cache_resource->size ? cache_resource->buf : NULL)); if (!cache_resource->verbs_action) { @@ -1108,8 +1110,8 @@ struct field_modify_info modify_tcp[] = { "cannot allocate resource memory"); *cache_resource = *resource; cache_resource->action = - mlx5_glue->dr_create_flow_action_dest_vport(priv->sh->fdb_ns, - resource->port_id); + mlx5_glue->dr_create_flow_action_dest_vport + (priv->sh->fdb_domain, resource->port_id); if (!cache_resource->action) { rte_free(cache_resource); return rte_flow_error_set(error, ENOMEM, @@ -1826,14 +1828,14 @@ struct field_modify_info modify_tcp[] = { struct mlx5_priv *priv = dev->data->dev_private; struct mlx5_ibv_shared *sh = priv->sh; struct mlx5_flow_dv_modify_hdr_resource *cache_resource; - struct mlx5dv_dr_ns *ns; + struct mlx5dv_dr_domain *ns; if (resource->ft_type == MLX5DV_FLOW_TABLE_TYPE_FDB) - ns = sh->fdb_ns; + ns = sh->fdb_domain; else if (resource->ft_type == MLX5DV_FLOW_TABLE_TYPE_NIC_TX) - ns = sh->tx_ns; + ns = sh->tx_domain; else - ns = sh->rx_ns; + ns = sh->rx_domain; resource->flags = dev_flow->flow->group ? 0 : MLX5DV_DR_ACTION_FLAGS_ROOT_LEVEL; /* Lookup a matching resource from cache. */ @@ -3305,17 +3307,17 @@ struct field_modify_info modify_tcp[] = { tbl = &sh->fdb_tbl[table_id]; if (!tbl->obj) tbl->obj = mlx5_glue->dr_create_flow_tbl - (sh->fdb_ns, table_id); + (sh->fdb_domain, table_id); } else if (egress) { tbl = &sh->tx_tbl[table_id]; if (!tbl->obj) tbl->obj = mlx5_glue->dr_create_flow_tbl - (sh->tx_ns, table_id); + (sh->tx_domain, table_id); } else { tbl = &sh->rx_tbl[table_id]; if (!tbl->obj) tbl->obj = mlx5_glue->dr_create_flow_tbl - (sh->rx_ns, table_id); + (sh->rx_domain, table_id); } if (!tbl->obj) { rte_flow_error_set(error, ENOMEM, diff --git a/drivers/net/mlx5/mlx5_glue.c b/drivers/net/mlx5/mlx5_glue.c index b32cd09c..6172e0d 100644 --- a/drivers/net/mlx5/mlx5_glue.c +++ b/drivers/net/mlx5/mlx5_glue.c @@ -180,7 +180,7 @@ { #ifdef HAVE_IBV_FLOW_DV_SUPPORT #ifdef HAVE_MLX5DV_DR - return mlx5dv_dr_destroy_action(action); + return mlx5dv_dr_action_destroy(action); #else struct mlx5dv_flow_action_attr *attr = action; int res = 0; @@ -374,7 +374,7 @@ mlx5_glue_dr_create_flow_action_dest_flow_tbl(void *tbl) { #ifdef HAVE_MLX5DV_DR - return mlx5dv_dr_create_action_dest_flow_table(tbl); + return mlx5dv_dr_action_create_dest_table(tbl); #else (void)tbl; return NULL; @@ -382,12 +382,12 @@ } static void * -mlx5_glue_dr_create_flow_action_dest_vport(void *ns, uint32_t vport) +mlx5_glue_dr_create_flow_action_dest_vport(void *domain, uint32_t vport) { #ifdef HAVE_MLX5DV_DR_ESWITCH - return mlx5dv_dr_create_action_dest_vport(ns, vport); + return mlx5dv_dr_action_create_dest_vport(domain, vport); #else - (void)ns; + (void)domain; (void)vport; return NULL; #endif @@ -397,19 +397,19 @@ mlx5_glue_dr_create_flow_action_drop(void) { #ifdef HAVE_MLX5DV_DR_ESWITCH - return mlx5dv_dr_create_action_drop(); + return mlx5dv_dr_action_create_drop(); #else return NULL; #endif } static void * -mlx5_glue_dr_create_flow_tbl(void *ns, uint32_t level) +mlx5_glue_dr_create_flow_tbl(void *domain, uint32_t level) { #ifdef HAVE_MLX5DV_DR - return mlx5dv_dr_create_ft(ns, level); + return mlx5dv_dr_table_create(domain, level); #else - (void)ns; + (void)domain; (void)level; return NULL; #endif @@ -419,7 +419,7 @@ mlx5_glue_dr_destroy_flow_tbl(void *tbl) { #ifdef HAVE_MLX5DV_DR - return mlx5dv_dr_destroy_ft(tbl); + return mlx5dv_dr_table_destroy(tbl); #else (void)tbl; return 0; @@ -427,11 +427,11 @@ } static void * -mlx5_glue_dr_create_ns(struct ibv_context *ctx, - enum mlx5dv_dr_ns_domain domain) +mlx5_glue_dr_create_domain(struct ibv_context *ctx, + enum mlx5dv_dr_domain_type domain) { #ifdef HAVE_MLX5DV_DR - return mlx5dv_dr_create_ns(ctx, domain); + return mlx5dv_dr_domain_create(ctx, domain); #else (void)ctx; (void)domain; @@ -440,12 +440,12 @@ } static int -mlx5_glue_dr_destroy_ns(void *ns) +mlx5_glue_dr_destroy_domain(void *domain) { #ifdef HAVE_MLX5DV_DR - return mlx5dv_dr_destroy_ns(ns); + return mlx5dv_dr_domain_destroy(domain); #else - (void)ns; + (void)domain; return 0; #endif } @@ -516,9 +516,9 @@ #ifdef HAVE_IBV_FLOW_DV_SUPPORT #ifdef HAVE_MLX5DV_DR (void)context; - return mlx5dv_dr_create_matcher(tbl, matcher_attr->priority, - matcher_attr->match_criteria_enable, - matcher_attr->match_mask); + return mlx5dv_dr_matcher_create(tbl, matcher_attr->priority, + matcher_attr->match_criteria_enable, + matcher_attr->match_mask); #else (void)tbl; return mlx5dv_create_flow_matcher(context, matcher_attr); @@ -539,7 +539,7 @@ { #ifdef HAVE_IBV_FLOW_DV_SUPPORT #ifdef HAVE_MLX5DV_DR - return mlx5dv_dr_create_rule(matcher, match_value, num_actions, + return mlx5dv_dr_rule_create(matcher, match_value, num_actions, (struct mlx5dv_dr_action **)actions); #else struct mlx5dv_flow_action_attr actions_attr[8]; @@ -566,7 +566,7 @@ { #ifdef HAVE_IBV_FLOW_DV_SUPPORT #ifdef HAVE_MLX5DV_DR - return mlx5dv_dr_create_action_devx_counter(counter_obj, offset); + return mlx5dv_dr_action_create_flow_counter(counter_obj, offset); #else struct mlx5dv_flow_action_attr *action; @@ -590,7 +590,7 @@ { #ifdef HAVE_IBV_FLOW_DV_SUPPORT #ifdef HAVE_MLX5DV_DR - return mlx5dv_dr_create_action_dest_ibv_qp(qp); + return mlx5dv_dr_action_create_dest_ibv_qp(qp); #else struct mlx5dv_flow_action_attr *action; @@ -611,7 +611,7 @@ mlx5_glue_dv_create_flow_action_modify_header (struct ibv_context *ctx, enum mlx5dv_flow_table_type ft_type, - void *ns, uint64_t flags, + void *domain, uint64_t flags, size_t actions_sz, uint64_t actions[]) { @@ -619,12 +619,12 @@ #ifdef HAVE_MLX5DV_DR (void)ctx; (void)ft_type; - return mlx5dv_dr_create_action_modify_header(ns, flags, actions_sz, - actions); + return mlx5dv_dr_action_create_modify_header(domain, flags, actions_sz, + (__be64 *)actions); #else struct mlx5dv_flow_action_attr *action; - (void)ns; + (void)domain; (void)flags; action = malloc(sizeof(*action)); if (!action) @@ -637,7 +637,7 @@ #else (void)ctx; (void)ft_type; - (void)ns; + (void)domain; (void)flags; (void)actions_sz; (void)actions; @@ -649,18 +649,19 @@ mlx5_glue_dv_create_flow_action_packet_reformat (struct ibv_context *ctx, enum mlx5dv_flow_action_packet_reformat_type reformat_type, - enum mlx5dv_flow_table_type ft_type, struct mlx5dv_dr_ns *ns, + enum mlx5dv_flow_table_type ft_type, + struct mlx5dv_dr_domain *domain, uint32_t flags, size_t data_sz, void *data) { #ifdef HAVE_IBV_FLOW_DV_SUPPORT #ifdef HAVE_MLX5DV_DR (void)ctx; (void)ft_type; - return mlx5dv_dr_create_action_packet_reformat(ns, flags, + return mlx5dv_dr_action_create_packet_reformat(domain, flags, reformat_type, data_sz, data); #else - (void)ns; + (void)domain; (void)flags; struct mlx5dv_flow_action_attr *action; @@ -676,7 +677,7 @@ (void)ctx; (void)reformat_type; (void)ft_type; - (void)ns; + (void)domain; (void)flags; (void)data_sz; (void)data; @@ -689,7 +690,7 @@ { #ifdef HAVE_IBV_FLOW_DV_SUPPORT #ifdef HAVE_MLX5DV_DR - return mlx5dv_dr_create_action_tag(tag); + return mlx5dv_dr_action_create_tag(tag); #else struct mlx5dv_flow_action_attr *action; action = malloc(sizeof(*action)); @@ -708,7 +709,7 @@ mlx5_glue_dv_destroy_flow(void *flow_id) { #ifdef HAVE_MLX5DV_DR - return mlx5dv_dr_destroy_rule(flow_id); + return mlx5dv_dr_rule_destroy(flow_id); #else return ibv_destroy_flow(flow_id); #endif @@ -719,7 +720,7 @@ { #ifdef HAVE_IBV_FLOW_DV_SUPPORT #ifdef HAVE_MLX5DV_DR - return mlx5dv_dr_destroy_matcher(matcher); + return mlx5dv_dr_matcher_destroy(matcher); #else return mlx5dv_destroy_flow_matcher(matcher); #endif @@ -875,8 +876,8 @@ mlx5_glue_dr_create_flow_action_drop, .dr_create_flow_tbl = mlx5_glue_dr_create_flow_tbl, .dr_destroy_flow_tbl = mlx5_glue_dr_destroy_flow_tbl, - .dr_create_ns = mlx5_glue_dr_create_ns, - .dr_destroy_ns = mlx5_glue_dr_destroy_ns, + .dr_create_domain = mlx5_glue_dr_create_domain, + .dr_destroy_domain = mlx5_glue_dr_destroy_domain, .dv_create_cq = mlx5_glue_dv_create_cq, .dv_create_wq = mlx5_glue_dv_create_wq, .dv_query_device = mlx5_glue_dv_query_device, diff --git a/drivers/net/mlx5/mlx5_glue.h b/drivers/net/mlx5/mlx5_glue.h index 1d06583..b5c63cb 100644 --- a/drivers/net/mlx5/mlx5_glue.h +++ b/drivers/net/mlx5/mlx5_glue.h @@ -64,8 +64,8 @@ #endif #ifndef HAVE_MLX5DV_DR -struct mlx5dv_dr_ns; -enum mlx5dv_dr_ns_domain { unused, }; +enum mlx5dv_dr_domain_type { unused, }; +struct mlx5dv_dr_domain; #endif /* LIB_GLUE_VERSION must be updated every time this structure is modified. */ @@ -146,13 +146,13 @@ struct mlx5_glue { 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 *ns, uint32_t vport); + void *(*dr_create_flow_action_dest_vport)(void *domain, uint32_t vport); void *(*dr_create_flow_action_drop)(); - void *(*dr_create_flow_tbl)(void *ns, uint32_t level); + void *(*dr_create_flow_tbl)(void *domain, uint32_t level); int (*dr_destroy_flow_tbl)(void *tbl); - void *(*dr_create_ns)(struct ibv_context *ctx, - enum mlx5dv_dr_ns_domain domain); - int (*dr_destroy_ns)(void *ns); + void *(*dr_create_domain)(struct ibv_context *ctx, + enum mlx5dv_dr_domain_type domain); + int (*dr_destroy_domain)(void *domain); struct ibv_cq_ex *(*dv_create_cq) (struct ibv_context *context, struct ibv_cq_init_attr_ex *cq_attr, @@ -181,12 +181,13 @@ struct mlx5_glue { void *(*dv_create_flow_action_dest_ibv_qp)(void *qp); void *(*dv_create_flow_action_modify_header) (struct ibv_context *ctx, enum mlx5dv_flow_table_type ft_type, - void *ns, uint64_t flags, size_t actions_sz, + void *domain, uint64_t flags, size_t actions_sz, uint64_t actions[]); void *(*dv_create_flow_action_packet_reformat) (struct ibv_context *ctx, enum mlx5dv_flow_action_packet_reformat_type reformat_type, - enum mlx5dv_flow_table_type ft_type, struct mlx5dv_dr_ns *ns, + enum mlx5dv_flow_table_type ft_type, + struct mlx5dv_dr_domain *domain, uint32_t flags, size_t data_sz, void *data); void *(*dv_create_flow_action_tag)(uint32_t tag); int (*dv_destroy_flow)(void *flow); -- 1.8.3.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 75015A0AC5 for ; Wed, 1 May 2019 22:40:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 860501041; Wed, 1 May 2019 22:40:56 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 33094A49 for ; Wed, 1 May 2019 22:40:55 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE2 (envelope-from orika@mellanox.com) with ESMTPS (AES256-SHA encrypted); 1 May 2019 23:40:54 +0300 Received: from pegasus03.mtr.labs.mlnx (pegasus03.mtr.labs.mlnx [10.210.16.124]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x41KesDh007234; Wed, 1 May 2019 23:40:54 +0300 From: Ori Kam To: yskoh@mellanox.com, shahafs@mellanox.com Cc: dev@dpdk.org, orika@mellanox.com Date: Wed, 1 May 2019 20:40:45 +0000 Message-Id: <1556743245-138357-1-git-send-email-orika@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] net/mlx5: fix Direct Rules API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190501204045.nXq1MODn2IhrUu3fp-Gmc8a-k6mirKwyTcLoMHMXJ8k@z> The RDMA-CORE Direct Rules API was changed in latest upstream code This commit update the API accordingly. Fixes: 4f84a19779ca ("net/mlx5: add Direct Rules API") Signed-off-by: Ori Kam --- drivers/net/mlx5/Makefile | 4 +-- drivers/net/mlx5/meson.build | 4 +-- drivers/net/mlx5/mlx5.c | 68 +++++++++++++++++++------------------- drivers/net/mlx5/mlx5.h | 6 ++-- drivers/net/mlx5/mlx5_flow_dv.c | 30 +++++++++-------- drivers/net/mlx5/mlx5_glue.c | 73 +++++++++++++++++++++-------------------- drivers/net/mlx5/mlx5_glue.h | 19 ++++++----- 7 files changed, 104 insertions(+), 100 deletions(-) diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile index 2b72a33..2694916 100644 --- a/drivers/net/mlx5/Makefile +++ b/drivers/net/mlx5/Makefile @@ -158,12 +158,12 @@ mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh $Q sh -- '$<' '$@' \ HAVE_MLX5DV_DR \ infiniband/mlx5dv.h \ - enum MLX5DV_DR_NS_TYPE_TERMINATING \ + enum MLX5DV_DR_DOMAIN_TYPE_NIC_RX \ $(AUTOCONF_OUTPUT) $Q sh -- '$<' '$@' \ HAVE_MLX5DV_DR_ESWITCH \ infiniband/mlx5dv.h \ - enum MLX5DV_DR_NS_DOMAIN_FDB_BYPASS \ + enum MLX5DV_DR_DOMAIN_TYPE_FDB \ $(AUTOCONF_OUTPUT) $Q sh -- '$<' '$@' \ HAVE_IBV_DEVX_OBJ \ diff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build index cf5e7e7..ac3b529 100644 --- a/drivers/net/mlx5/meson.build +++ b/drivers/net/mlx5/meson.build @@ -115,9 +115,9 @@ if build [ 'HAVE_IBV_FLOW_DEVX_COUNTERS', 'infiniband/mlx5dv.h', 'MLX5DV_FLOW_ACTION_COUNTERS_DEVX' ], [ 'HAVE_MLX5DV_DR', 'infiniband/mlx5dv.h', - 'MLX5DV_DR_NS_TYPE_TERMINATING' ], + 'MLX5DV_DR_DOMAIN_TYPE_NIC_RX' ], [ 'HAVE_MLX5DV_DR_ESWITCH', 'infiniband/mlx5dv.h', - 'MLX5DV_DR_NS_DOMAIN_FDB_BYPASS' ], + 'MLX5DV_DR_DOMAIN_TYPE_FDB' ], [ 'HAVE_SUPPORTED_40000baseKR4_Full', 'linux/ethtool.h', 'SUPPORTED_40000baseKR4_Full' ], [ 'HAVE_SUPPORTED_40000baseCR4_Full', 'linux/ethtool.h', diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index de85e85..9f5ec97 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -342,7 +342,7 @@ struct mlx5_dev_spawn_data { #ifdef HAVE_MLX5DV_DR struct mlx5_ibv_shared *sh = priv->sh; int err = 0; - void *ns; + void *domain; assert(sh); if (sh->dv_refcnt) { @@ -352,33 +352,33 @@ struct mlx5_dev_spawn_data { return 0; } /* Reference counter is zero, we should initialize structures. */ - ns = mlx5_glue->dr_create_ns(sh->ctx, - MLX5DV_DR_NS_DOMAIN_INGRESS_BYPASS); - if (!ns) { - DRV_LOG(ERR, "ingress mlx5dv_dr_create_ns failed"); + domain = mlx5_glue->dr_create_domain(sh->ctx, + MLX5DV_DR_DOMAIN_TYPE_NIC_RX); + if (!domain) { + DRV_LOG(ERR, "ingress mlx5dv_dr_create_domain failed"); err = errno; goto error; } - sh->rx_ns = ns; - ns = mlx5_glue->dr_create_ns(sh->ctx, - MLX5DV_DR_NS_DOMAIN_EGRESS_BYPASS); - if (!ns) { - DRV_LOG(ERR, "egress mlx5dv_dr_create_ns failed"); + sh->rx_domain = domain; + domain = mlx5_glue->dr_create_domain(sh->ctx, + MLX5DV_DR_DOMAIN_TYPE_NIC_TX); + if (!domain) { + DRV_LOG(ERR, "egress mlx5dv_dr_create_domain failed"); err = errno; goto error; } pthread_mutex_init(&sh->dv_mutex, NULL); - sh->tx_ns = ns; + sh->tx_domain = domain; #ifdef HAVE_MLX5DV_DR_ESWITCH if (priv->config.dv_esw_en) { - ns = mlx5_glue->dr_create_ns(sh->ctx, - MLX5DV_DR_NS_DOMAIN_FDB_BYPASS); - if (!ns) { - DRV_LOG(ERR, "FDB mlx5dv_dr_create_ns failed"); + domain = mlx5_glue->dr_create_domain + (sh->ctx, MLX5DV_DR_DOMAIN_TYPE_FDB); + if (!domain) { + DRV_LOG(ERR, "FDB mlx5dv_dr_create_domain failed"); err = errno; goto error; } - sh->fdb_ns = ns; + sh->fdb_domain = domain; sh->esw_drop_action = mlx5_glue->dr_create_flow_action_drop(); } #endif @@ -388,17 +388,17 @@ struct mlx5_dev_spawn_data { error: /* Rollback the created objects. */ - if (sh->rx_ns) { - mlx5_glue->dr_destroy_ns(sh->rx_ns); - sh->rx_ns = NULL; + if (sh->rx_domain) { + mlx5_glue->dr_destroy_domain(sh->rx_domain); + sh->rx_domain = NULL; } - if (sh->tx_ns) { - mlx5_glue->dr_destroy_ns(sh->tx_ns); - sh->tx_ns = NULL; + if (sh->tx_domain) { + mlx5_glue->dr_destroy_domain(sh->tx_domain); + sh->tx_domain = NULL; } - if (sh->fdb_ns) { - mlx5_glue->dr_destroy_ns(sh->fdb_ns); - sh->fdb_ns = NULL; + if (sh->fdb_domain) { + mlx5_glue->dr_destroy_domain(sh->fdb_domain); + sh->fdb_domain = NULL; } if (sh->esw_drop_action) { mlx5_glue->destroy_flow_action(sh->esw_drop_action); @@ -431,18 +431,18 @@ struct mlx5_dev_spawn_data { assert(sh->dv_refcnt); if (sh->dv_refcnt && --sh->dv_refcnt) return; - if (sh->rx_ns) { - mlx5_glue->dr_destroy_ns(sh->rx_ns); - sh->rx_ns = NULL; + if (sh->rx_domain) { + mlx5_glue->dr_destroy_domain(sh->rx_domain); + sh->rx_domain = NULL; } - if (sh->tx_ns) { - mlx5_glue->dr_destroy_ns(sh->tx_ns); - sh->tx_ns = NULL; + if (sh->tx_domain) { + mlx5_glue->dr_destroy_domain(sh->tx_domain); + sh->tx_domain = NULL; } #ifdef HAVE_MLX5DV_DR_ESWITCH - if (sh->fdb_ns) { - mlx5_glue->dr_destroy_ns(sh->fdb_ns); - sh->fdb_ns = NULL; + if (sh->fdb_domain) { + mlx5_glue->dr_destroy_domain(sh->fdb_domain); + sh->fdb_domain = NULL; } if (sh->esw_drop_action) { mlx5_glue->destroy_flow_action(sh->esw_drop_action); diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 82fcb29..3eaaafd 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -288,13 +288,13 @@ struct mlx5_ibv_shared { /* Shared DV/DR flow data section. */ pthread_mutex_t dv_mutex; /* DV context mutex. */ uint32_t dv_refcnt; /* DV/DR data reference counter. */ - void *fdb_ns; /* FDB Direct Rules name space handle. */ + void *fdb_domain; /* FDB Direct Rules name space handle. */ struct mlx5_flow_tbl_resource fdb_tbl[MLX5_MAX_TABLES_FDB]; /* FDB Direct Rules tables. */ - void *rx_ns; /* RX Direct Rules name space handle. */ + void *rx_domain; /* RX Direct Rules name space handle. */ struct mlx5_flow_tbl_resource rx_tbl[MLX5_MAX_TABLES]; /* RX Direct Rules tables. */ - void *tx_ns; /* TX Direct Rules name space handle. */ + void *tx_domain; /* TX Direct Rules name space handle. */ struct mlx5_flow_tbl_resource tx_tbl[MLX5_MAX_TABLES]; void *esw_drop_action; /* Pointer to DR E-Switch drop action. */ /* TX Direct Rules tables/ */ diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index eea67a1..c248b36 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -40,8 +40,10 @@ #endif #ifndef HAVE_MLX5DV_DR_ESWITCH +#ifndef MLX5DV_FLOW_TABLE_TYPE_FDB #define MLX5DV_FLOW_TABLE_TYPE_FDB 0 #endif +#endif #ifndef HAVE_MLX5DV_DR #define MLX5DV_DR_ACTION_FLAGS_ROOT_LEVEL 1 @@ -943,15 +945,15 @@ struct field_modify_info modify_tcp[] = { struct mlx5_ibv_shared *sh = priv->sh; struct mlx5_flow_dv_encap_decap_resource *cache_resource; struct rte_flow *flow = dev_flow->flow; - struct mlx5dv_dr_ns *ns; + struct mlx5dv_dr_domain *domain; resource->flags = flow->group ? 0 : 1; if (resource->ft_type == MLX5DV_FLOW_TABLE_TYPE_FDB) - ns = sh->fdb_ns; + domain = sh->fdb_domain; else if (resource->ft_type == MLX5DV_FLOW_TABLE_TYPE_NIC_RX) - ns = sh->rx_ns; + domain = sh->rx_domain; else - ns = sh->tx_ns; + domain = sh->tx_domain; /* Lookup a matching resource from cache. */ LIST_FOREACH(cache_resource, &sh->encaps_decaps, next) { @@ -980,7 +982,7 @@ struct field_modify_info modify_tcp[] = { cache_resource->verbs_action = mlx5_glue->dv_create_flow_action_packet_reformat (sh->ctx, cache_resource->reformat_type, - cache_resource->ft_type, ns, cache_resource->flags, + cache_resource->ft_type, domain, cache_resource->flags, cache_resource->size, (cache_resource->size ? cache_resource->buf : NULL)); if (!cache_resource->verbs_action) { @@ -1108,8 +1110,8 @@ struct field_modify_info modify_tcp[] = { "cannot allocate resource memory"); *cache_resource = *resource; cache_resource->action = - mlx5_glue->dr_create_flow_action_dest_vport(priv->sh->fdb_ns, - resource->port_id); + mlx5_glue->dr_create_flow_action_dest_vport + (priv->sh->fdb_domain, resource->port_id); if (!cache_resource->action) { rte_free(cache_resource); return rte_flow_error_set(error, ENOMEM, @@ -1826,14 +1828,14 @@ struct field_modify_info modify_tcp[] = { struct mlx5_priv *priv = dev->data->dev_private; struct mlx5_ibv_shared *sh = priv->sh; struct mlx5_flow_dv_modify_hdr_resource *cache_resource; - struct mlx5dv_dr_ns *ns; + struct mlx5dv_dr_domain *ns; if (resource->ft_type == MLX5DV_FLOW_TABLE_TYPE_FDB) - ns = sh->fdb_ns; + ns = sh->fdb_domain; else if (resource->ft_type == MLX5DV_FLOW_TABLE_TYPE_NIC_TX) - ns = sh->tx_ns; + ns = sh->tx_domain; else - ns = sh->rx_ns; + ns = sh->rx_domain; resource->flags = dev_flow->flow->group ? 0 : MLX5DV_DR_ACTION_FLAGS_ROOT_LEVEL; /* Lookup a matching resource from cache. */ @@ -3305,17 +3307,17 @@ struct field_modify_info modify_tcp[] = { tbl = &sh->fdb_tbl[table_id]; if (!tbl->obj) tbl->obj = mlx5_glue->dr_create_flow_tbl - (sh->fdb_ns, table_id); + (sh->fdb_domain, table_id); } else if (egress) { tbl = &sh->tx_tbl[table_id]; if (!tbl->obj) tbl->obj = mlx5_glue->dr_create_flow_tbl - (sh->tx_ns, table_id); + (sh->tx_domain, table_id); } else { tbl = &sh->rx_tbl[table_id]; if (!tbl->obj) tbl->obj = mlx5_glue->dr_create_flow_tbl - (sh->rx_ns, table_id); + (sh->rx_domain, table_id); } if (!tbl->obj) { rte_flow_error_set(error, ENOMEM, diff --git a/drivers/net/mlx5/mlx5_glue.c b/drivers/net/mlx5/mlx5_glue.c index b32cd09c..6172e0d 100644 --- a/drivers/net/mlx5/mlx5_glue.c +++ b/drivers/net/mlx5/mlx5_glue.c @@ -180,7 +180,7 @@ { #ifdef HAVE_IBV_FLOW_DV_SUPPORT #ifdef HAVE_MLX5DV_DR - return mlx5dv_dr_destroy_action(action); + return mlx5dv_dr_action_destroy(action); #else struct mlx5dv_flow_action_attr *attr = action; int res = 0; @@ -374,7 +374,7 @@ mlx5_glue_dr_create_flow_action_dest_flow_tbl(void *tbl) { #ifdef HAVE_MLX5DV_DR - return mlx5dv_dr_create_action_dest_flow_table(tbl); + return mlx5dv_dr_action_create_dest_table(tbl); #else (void)tbl; return NULL; @@ -382,12 +382,12 @@ } static void * -mlx5_glue_dr_create_flow_action_dest_vport(void *ns, uint32_t vport) +mlx5_glue_dr_create_flow_action_dest_vport(void *domain, uint32_t vport) { #ifdef HAVE_MLX5DV_DR_ESWITCH - return mlx5dv_dr_create_action_dest_vport(ns, vport); + return mlx5dv_dr_action_create_dest_vport(domain, vport); #else - (void)ns; + (void)domain; (void)vport; return NULL; #endif @@ -397,19 +397,19 @@ mlx5_glue_dr_create_flow_action_drop(void) { #ifdef HAVE_MLX5DV_DR_ESWITCH - return mlx5dv_dr_create_action_drop(); + return mlx5dv_dr_action_create_drop(); #else return NULL; #endif } static void * -mlx5_glue_dr_create_flow_tbl(void *ns, uint32_t level) +mlx5_glue_dr_create_flow_tbl(void *domain, uint32_t level) { #ifdef HAVE_MLX5DV_DR - return mlx5dv_dr_create_ft(ns, level); + return mlx5dv_dr_table_create(domain, level); #else - (void)ns; + (void)domain; (void)level; return NULL; #endif @@ -419,7 +419,7 @@ mlx5_glue_dr_destroy_flow_tbl(void *tbl) { #ifdef HAVE_MLX5DV_DR - return mlx5dv_dr_destroy_ft(tbl); + return mlx5dv_dr_table_destroy(tbl); #else (void)tbl; return 0; @@ -427,11 +427,11 @@ } static void * -mlx5_glue_dr_create_ns(struct ibv_context *ctx, - enum mlx5dv_dr_ns_domain domain) +mlx5_glue_dr_create_domain(struct ibv_context *ctx, + enum mlx5dv_dr_domain_type domain) { #ifdef HAVE_MLX5DV_DR - return mlx5dv_dr_create_ns(ctx, domain); + return mlx5dv_dr_domain_create(ctx, domain); #else (void)ctx; (void)domain; @@ -440,12 +440,12 @@ } static int -mlx5_glue_dr_destroy_ns(void *ns) +mlx5_glue_dr_destroy_domain(void *domain) { #ifdef HAVE_MLX5DV_DR - return mlx5dv_dr_destroy_ns(ns); + return mlx5dv_dr_domain_destroy(domain); #else - (void)ns; + (void)domain; return 0; #endif } @@ -516,9 +516,9 @@ #ifdef HAVE_IBV_FLOW_DV_SUPPORT #ifdef HAVE_MLX5DV_DR (void)context; - return mlx5dv_dr_create_matcher(tbl, matcher_attr->priority, - matcher_attr->match_criteria_enable, - matcher_attr->match_mask); + return mlx5dv_dr_matcher_create(tbl, matcher_attr->priority, + matcher_attr->match_criteria_enable, + matcher_attr->match_mask); #else (void)tbl; return mlx5dv_create_flow_matcher(context, matcher_attr); @@ -539,7 +539,7 @@ { #ifdef HAVE_IBV_FLOW_DV_SUPPORT #ifdef HAVE_MLX5DV_DR - return mlx5dv_dr_create_rule(matcher, match_value, num_actions, + return mlx5dv_dr_rule_create(matcher, match_value, num_actions, (struct mlx5dv_dr_action **)actions); #else struct mlx5dv_flow_action_attr actions_attr[8]; @@ -566,7 +566,7 @@ { #ifdef HAVE_IBV_FLOW_DV_SUPPORT #ifdef HAVE_MLX5DV_DR - return mlx5dv_dr_create_action_devx_counter(counter_obj, offset); + return mlx5dv_dr_action_create_flow_counter(counter_obj, offset); #else struct mlx5dv_flow_action_attr *action; @@ -590,7 +590,7 @@ { #ifdef HAVE_IBV_FLOW_DV_SUPPORT #ifdef HAVE_MLX5DV_DR - return mlx5dv_dr_create_action_dest_ibv_qp(qp); + return mlx5dv_dr_action_create_dest_ibv_qp(qp); #else struct mlx5dv_flow_action_attr *action; @@ -611,7 +611,7 @@ mlx5_glue_dv_create_flow_action_modify_header (struct ibv_context *ctx, enum mlx5dv_flow_table_type ft_type, - void *ns, uint64_t flags, + void *domain, uint64_t flags, size_t actions_sz, uint64_t actions[]) { @@ -619,12 +619,12 @@ #ifdef HAVE_MLX5DV_DR (void)ctx; (void)ft_type; - return mlx5dv_dr_create_action_modify_header(ns, flags, actions_sz, - actions); + return mlx5dv_dr_action_create_modify_header(domain, flags, actions_sz, + (__be64 *)actions); #else struct mlx5dv_flow_action_attr *action; - (void)ns; + (void)domain; (void)flags; action = malloc(sizeof(*action)); if (!action) @@ -637,7 +637,7 @@ #else (void)ctx; (void)ft_type; - (void)ns; + (void)domain; (void)flags; (void)actions_sz; (void)actions; @@ -649,18 +649,19 @@ mlx5_glue_dv_create_flow_action_packet_reformat (struct ibv_context *ctx, enum mlx5dv_flow_action_packet_reformat_type reformat_type, - enum mlx5dv_flow_table_type ft_type, struct mlx5dv_dr_ns *ns, + enum mlx5dv_flow_table_type ft_type, + struct mlx5dv_dr_domain *domain, uint32_t flags, size_t data_sz, void *data) { #ifdef HAVE_IBV_FLOW_DV_SUPPORT #ifdef HAVE_MLX5DV_DR (void)ctx; (void)ft_type; - return mlx5dv_dr_create_action_packet_reformat(ns, flags, + return mlx5dv_dr_action_create_packet_reformat(domain, flags, reformat_type, data_sz, data); #else - (void)ns; + (void)domain; (void)flags; struct mlx5dv_flow_action_attr *action; @@ -676,7 +677,7 @@ (void)ctx; (void)reformat_type; (void)ft_type; - (void)ns; + (void)domain; (void)flags; (void)data_sz; (void)data; @@ -689,7 +690,7 @@ { #ifdef HAVE_IBV_FLOW_DV_SUPPORT #ifdef HAVE_MLX5DV_DR - return mlx5dv_dr_create_action_tag(tag); + return mlx5dv_dr_action_create_tag(tag); #else struct mlx5dv_flow_action_attr *action; action = malloc(sizeof(*action)); @@ -708,7 +709,7 @@ mlx5_glue_dv_destroy_flow(void *flow_id) { #ifdef HAVE_MLX5DV_DR - return mlx5dv_dr_destroy_rule(flow_id); + return mlx5dv_dr_rule_destroy(flow_id); #else return ibv_destroy_flow(flow_id); #endif @@ -719,7 +720,7 @@ { #ifdef HAVE_IBV_FLOW_DV_SUPPORT #ifdef HAVE_MLX5DV_DR - return mlx5dv_dr_destroy_matcher(matcher); + return mlx5dv_dr_matcher_destroy(matcher); #else return mlx5dv_destroy_flow_matcher(matcher); #endif @@ -875,8 +876,8 @@ mlx5_glue_dr_create_flow_action_drop, .dr_create_flow_tbl = mlx5_glue_dr_create_flow_tbl, .dr_destroy_flow_tbl = mlx5_glue_dr_destroy_flow_tbl, - .dr_create_ns = mlx5_glue_dr_create_ns, - .dr_destroy_ns = mlx5_glue_dr_destroy_ns, + .dr_create_domain = mlx5_glue_dr_create_domain, + .dr_destroy_domain = mlx5_glue_dr_destroy_domain, .dv_create_cq = mlx5_glue_dv_create_cq, .dv_create_wq = mlx5_glue_dv_create_wq, .dv_query_device = mlx5_glue_dv_query_device, diff --git a/drivers/net/mlx5/mlx5_glue.h b/drivers/net/mlx5/mlx5_glue.h index 1d06583..b5c63cb 100644 --- a/drivers/net/mlx5/mlx5_glue.h +++ b/drivers/net/mlx5/mlx5_glue.h @@ -64,8 +64,8 @@ #endif #ifndef HAVE_MLX5DV_DR -struct mlx5dv_dr_ns; -enum mlx5dv_dr_ns_domain { unused, }; +enum mlx5dv_dr_domain_type { unused, }; +struct mlx5dv_dr_domain; #endif /* LIB_GLUE_VERSION must be updated every time this structure is modified. */ @@ -146,13 +146,13 @@ struct mlx5_glue { 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 *ns, uint32_t vport); + void *(*dr_create_flow_action_dest_vport)(void *domain, uint32_t vport); void *(*dr_create_flow_action_drop)(); - void *(*dr_create_flow_tbl)(void *ns, uint32_t level); + void *(*dr_create_flow_tbl)(void *domain, uint32_t level); int (*dr_destroy_flow_tbl)(void *tbl); - void *(*dr_create_ns)(struct ibv_context *ctx, - enum mlx5dv_dr_ns_domain domain); - int (*dr_destroy_ns)(void *ns); + void *(*dr_create_domain)(struct ibv_context *ctx, + enum mlx5dv_dr_domain_type domain); + int (*dr_destroy_domain)(void *domain); struct ibv_cq_ex *(*dv_create_cq) (struct ibv_context *context, struct ibv_cq_init_attr_ex *cq_attr, @@ -181,12 +181,13 @@ struct mlx5_glue { void *(*dv_create_flow_action_dest_ibv_qp)(void *qp); void *(*dv_create_flow_action_modify_header) (struct ibv_context *ctx, enum mlx5dv_flow_table_type ft_type, - void *ns, uint64_t flags, size_t actions_sz, + void *domain, uint64_t flags, size_t actions_sz, uint64_t actions[]); void *(*dv_create_flow_action_packet_reformat) (struct ibv_context *ctx, enum mlx5dv_flow_action_packet_reformat_type reformat_type, - enum mlx5dv_flow_table_type ft_type, struct mlx5dv_dr_ns *ns, + enum mlx5dv_flow_table_type ft_type, + struct mlx5dv_dr_domain *domain, uint32_t flags, size_t data_sz, void *data); void *(*dv_create_flow_action_tag)(uint32_t tag); int (*dv_destroy_flow)(void *flow); -- 1.8.3.1