From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20070.outbound.protection.outlook.com [40.107.2.70]) by dpdk.org (Postfix) with ESMTP id A39CB6CC1 for ; Tue, 2 Apr 2019 21:09:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FvKQmZYf0tSlvsCFqTYf7D1kV/RtkGrx/ARegrXaWAE=; b=D+tj1go1ZeTIjzycErEUFYvpFUBXVJNaU31odiQ6SMMz+Q51qyFZqr8PlBNT0gJo4qpxU3adB+JKCtk2SSqwGW77fLdmcty2uTyGG96/mMVfBKpKislTTqqhWIV3mjC10msWOgpqs4wko1Z72ZU9+DY0S/U/NucRvf6Rynr70G0= Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com (52.133.45.150) by AM0PR0502MB4050.eurprd05.prod.outlook.com (52.133.37.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.20; Tue, 2 Apr 2019 19:09:52 +0000 Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com ([fe80::84f3:7e92:7a51:1003]) by AM0PR0502MB3795.eurprd05.prod.outlook.com ([fe80::84f3:7e92:7a51:1003%2]) with mapi id 15.20.1750.014; Tue, 2 Apr 2019 19:09:52 +0000 From: Shahaf Shuler To: Slava Ovsiienko , "dev@dpdk.org" Thread-Topic: [PATCH 3/4] net/mlx5: share DV/DR flow related structures Thread-Index: AQHU6Rx+lCdwrRzIykGOAm1mBd8dDaYpNpgg Date: Tue, 2 Apr 2019 19:09:52 +0000 Message-ID: References: <1554186157-29455-1-git-send-email-viacheslavo@mellanox.com> <1554186157-29455-4-git-send-email-viacheslavo@mellanox.com> In-Reply-To: <1554186157-29455-4-git-send-email-viacheslavo@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; x-originating-ip: [31.154.10.105] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3a9bfdcb-6cac-4f27-5232-08d6b79ec914 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600139)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:AM0PR0502MB4050; x-ms-traffictypediagnostic: AM0PR0502MB4050: x-microsoft-antispam-prvs: x-forefront-prvs: 0995196AA2 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(396003)(39860400002)(376002)(136003)(366004)(189003)(199004)(97736004)(55016002)(71200400001)(68736007)(14454004)(9686003)(53936002)(26005)(6116002)(6246003)(71190400001)(6506007)(3846002)(99286004)(476003)(446003)(186003)(76176011)(2501003)(6436002)(7696005)(52536014)(11346002)(102836004)(486006)(305945005)(106356001)(33656002)(316002)(7736002)(110136005)(14444005)(86362001)(229853002)(74316002)(66066001)(30864003)(105586002)(5660300002)(81156014)(8936002)(81166006)(25786009)(2906002)(8676002)(256004)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB4050; H:AM0PR0502MB3795.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: zzlUz5Y0ZpOXR81JIpaJkOLj/RUzZ+A5pW7p/u68wuLkz25qfqr5m0CWRXAZiJPUqL02xjvdmzMMsx7yfgZZXpGm34/QzKL8GWZsQZ3cr1xGQBziWYjkInWhoUxfYqrBk23iZlbv23QmvMmCacAQ8MxcAqXDsrVAanbKOLpOcGdHEV/dgQC+EdGHlEvpKCD6V+bUeuVrDbphfd8OaQXacY0aBSE0KcLT8sqzNtHiByJgRZfGPOK36xv4ZnqCWD7D6W4ni1YAJ4ChPGIaAI7xWKcPFg1SGIqcRXRZUOce+ciDwBrlsiGUtRz0D6d+Rv4A0HCPTFF9usmgv+iKs1k5k3kH7h4DXI7jW+apABHaZzwfuatxiZyNWxBmCqB0ngIeJ1qtpQeu1onUYK56uxPhQBo9FgcZwF1/5OS7parxYPE= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3a9bfdcb-6cac-4f27-5232-08d6b79ec914 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Apr 2019 19:09:52.4010 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB4050 Subject: Re: [dpdk-dev] [PATCH 3/4] net/mlx5: share DV/DR flow related structures 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: Tue, 02 Apr 2019 19:09:54 -0000 Tuesday, April 2, 2019 9:23 AM, Viacheslav Ovsiienko: > Subject: [PATCH 3/4] net/mlx5: share DV/DR flow related structures Same comment about the title.=20 >=20 > DV/DR related structures are moved to the shared context: > - rx/tx namespaces, shared by master and representors > - rx/tx flow tables > - matchers > - encap/decap action resources > - flow tags (MARK actions) > - modify action resources > - jump tables I am OK w/ the logic. However the next commit (4/4 net/mlx5: add mutex for shared DV/DR structure= s) should be squashed into this one.=20 Because w/o it, the concurrent flow creation/destroy between multiple devic= es is broken.=20 >=20 > Signed-off-by: Viacheslav Ovsiienko > --- > drivers/net/mlx5/mlx5.c | 28 +++++++++++----------- > drivers/net/mlx5/mlx5.h | 40 +++++++++++++++---------------- > drivers/net/mlx5/mlx5_flow_dv.c | 52 +++++++++++++++++++++++--------- > --------- > 3 files changed, 63 insertions(+), 57 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index > 79e0c17..369b698 100644 > --- a/drivers/net/mlx5/mlx5.c > +++ b/drivers/net/mlx5/mlx5.c > @@ -329,27 +329,27 @@ struct mlx5_dev_spawn_data { > err =3D errno; > goto error; > } > - priv->rx_ns =3D ns; > + sh->rx_ns =3D ns; > ns =3D mlx5dv_dr_create_ns(sh->ctx, > MLX5DV_DR_NS_DOMAIN_EGRESS_BYPASS); > if (!ns) { > DRV_LOG(ERR, "egress mlx5dv_dr_create_ns failed"); > err =3D errno; > goto error; > } > - priv->tx_ns =3D ns; > + sh->tx_ns =3D ns; > sh->dv_refcnt++; > priv->dv_shared =3D 1; > return 0; >=20 > error: > /* Rollback the created objects. */ > - if (priv->rx_ns) { > - mlx5dv_dr_destroy_ns(priv->rx_ns); > - priv->rx_ns =3D NULL; > + if (sh->rx_ns) { > + mlx5dv_dr_destroy_ns(sh->rx_ns); > + sh->rx_ns =3D NULL; > } > - if (priv->tx_ns) { > - mlx5dv_dr_destroy_ns(priv->tx_ns); > - priv->tx_ns =3D NULL; > + if (sh->tx_ns) { > + mlx5dv_dr_destroy_ns(sh->tx_ns); > + sh->tx_ns =3D NULL; > } > return err; > } > @@ -373,13 +373,13 @@ struct mlx5_dev_spawn_data { > assert(sh->dv_refcnt); > if (sh->dv_refcnt && --sh->dv_refcnt) > return; > - if (priv->rx_ns) { > - mlx5dv_dr_destroy_ns(priv->rx_ns); > - priv->rx_ns =3D NULL; > + if (sh->rx_ns) { > + mlx5dv_dr_destroy_ns(sh->rx_ns); > + sh->rx_ns =3D NULL; > } > - if (priv->tx_ns) { > - mlx5dv_dr_destroy_ns(priv->tx_ns); > - priv->tx_ns =3D NULL; > + if (sh->tx_ns) { > + mlx5dv_dr_destroy_ns(sh->tx_ns); > + sh->tx_ns =3D NULL; > } > } > #endif > diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index > 56a2c61..e67227f 100644 > --- a/drivers/net/mlx5/mlx5.h > +++ b/drivers/net/mlx5/mlx5.h > @@ -199,6 +199,15 @@ struct mlx5_ibv_shared_port { > */ > }; >=20 > +/* Table structure. */ > +struct mlx5_flow_tbl_resource { > + void *obj; /**< Pointer to DR table object. */ > + rte_atomic32_t refcnt; /**< Reference counter. */ }; > + > +#define MLX5_MAX_TABLES 1024 > +#define MLX5_GROUP_FACTOR 1 > + > /* > * Shared Infiniband device context for Master/Representors > * which belong to same IB device with multiple IB ports. > @@ -215,6 +224,17 @@ struct mlx5_ibv_shared { > struct ibv_device_attr_ex device_attr; /* Device properties. */ > /* Shared DV/DR flow data section. */ > uint32_t dv_refcnt; /* DV/DR data reference counter. */ > + void *rx_ns; /* 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. */ > + struct mlx5_flow_tbl_resource tx_tbl[MLX5_MAX_TABLES]; > + /* TX Direct Rules tables/ */ > + LIST_HEAD(matchers, mlx5_flow_dv_matcher) matchers; > + LIST_HEAD(encap_decap, mlx5_flow_dv_encap_decap_resource) > encaps_decaps; > + LIST_HEAD(modify_cmd, mlx5_flow_dv_modify_hdr_resource) > modify_cmds; > + LIST_HEAD(tag, mlx5_flow_dv_tag_resource) tags; > + LIST_HEAD(jump, mlx5_flow_dv_jump_tbl_resource) jump_tbl; > /* Shared interrupt handler section. */ > pthread_mutex_t intr_mutex; /* Interrupt config mutex. */ > uint32_t intr_cnt; /* Interrupt handler reference counter. */ @@ - > 222,15 +242,6 @@ struct mlx5_ibv_shared { > struct mlx5_ibv_shared_port port[]; /* per device port data array. */ > }; >=20 > -/* Table structure. */ > -struct mlx5_flow_tbl_resource { > - void *obj; /**< Pointer to DR table object. */ > - rte_atomic32_t refcnt; /**< Reference counter. */ > -}; > - > -#define MLX5_MAX_TABLES 1024 > -#define MLX5_GROUP_FACTOR 1 > - > struct mlx5_priv { > LIST_ENTRY(mlx5_priv) mem_event_cb; > /**< Called by memory event callback. */ @@ -279,11 +290,6 @@ > struct mlx5_priv { > LIST_HEAD(txqibv, mlx5_txq_ibv) txqsibv; /* Verbs Tx queues. */ > /* Verbs Indirection tables. */ > LIST_HEAD(ind_tables, mlx5_ind_table_ibv) ind_tbls; > - LIST_HEAD(matchers, mlx5_flow_dv_matcher) matchers; > - LIST_HEAD(encap_decap, mlx5_flow_dv_encap_decap_resource) > encaps_decaps; > - LIST_HEAD(modify_cmd, mlx5_flow_dv_modify_hdr_resource) > modify_cmds; > - LIST_HEAD(tag, mlx5_flow_dv_tag_resource) tags; > - LIST_HEAD(jump, mlx5_flow_dv_jump_tbl_resource) jump_tbl; > /* Pointer to next element. */ > rte_atomic32_t refcnt; /**< Reference counter. */ > struct ibv_flow_action *verbs_action; > @@ -308,12 +314,6 @@ struct mlx5_priv { > /* UAR same-page access control required in 32bit implementations. > */ #endif > struct mlx5_flow_tcf_context *tcf_context; /* TC flower context. */ > - void *rx_ns; /* 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. */ > - struct mlx5_flow_tbl_resource tx_tbl[MLX5_MAX_TABLES]; > - /* TX Direct Rules tables/ */ > }; >=20 > #define PORT_ID(priv) ((priv)->dev_data->port_id) diff --git > a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c > index f1dd00a..4912fc8 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -804,18 +804,19 @@ struct field_modify_info modify_tcp[] =3D { > struct rte_flow_error *error) > { > struct mlx5_priv *priv =3D dev->data->dev_private; > + struct mlx5_ibv_shared *sh =3D priv->sh; > struct mlx5_flow_dv_encap_decap_resource *cache_resource; > struct rte_flow *flow =3D dev_flow->flow; > struct mlx5dv_dr_ns *ns; >=20 > resource->flags =3D flow->group ? 0 : 1; > if (flow->ingress) > - ns =3D priv->rx_ns; > + ns =3D sh->rx_ns; > else > - ns =3D priv->tx_ns; > + ns =3D sh->tx_ns; >=20 > /* Lookup a matching resource from cache. */ > - LIST_FOREACH(cache_resource, &priv->encaps_decaps, next) { > + LIST_FOREACH(cache_resource, &sh->encaps_decaps, next) { > if (resource->reformat_type =3D=3D cache_resource- > >reformat_type && > resource->ft_type =3D=3D cache_resource->ft_type && > resource->flags =3D=3D cache_resource->flags && @@ -840,7 > +841,7 @@ struct field_modify_info modify_tcp[] =3D { > *cache_resource =3D *resource; > cache_resource->verbs_action =3D > mlx5_glue->dv_create_flow_action_packet_reformat > - (priv->sh->ctx, cache_resource->reformat_type, > + (sh->ctx, cache_resource->reformat_type, > cache_resource->ft_type, ns, cache_resource- > >flags, > cache_resource->size, > (cache_resource->size ? cache_resource->buf : > NULL)); @@ -852,7 +853,7 @@ struct field_modify_info modify_tcp[] =3D { > } > rte_atomic32_init(&cache_resource->refcnt); > rte_atomic32_inc(&cache_resource->refcnt); > - LIST_INSERT_HEAD(&priv->encaps_decaps, cache_resource, next); > + LIST_INSERT_HEAD(&sh->encaps_decaps, cache_resource, next); > dev_flow->dv.encap_decap =3D cache_resource; > DRV_LOG(DEBUG, "new encap/decap resource %p: refcnt %d++", > (void *)cache_resource, > @@ -883,10 +884,11 @@ struct field_modify_info modify_tcp[] =3D { > struct rte_flow_error *error) > { > struct mlx5_priv *priv =3D dev->data->dev_private; > + struct mlx5_ibv_shared *sh =3D priv->sh; > struct mlx5_flow_dv_jump_tbl_resource *cache_resource; >=20 > /* Lookup a matching resource from cache. */ > - LIST_FOREACH(cache_resource, &priv->jump_tbl, next) { > + LIST_FOREACH(cache_resource, &sh->jump_tbl, next) { > if (resource->tbl =3D=3D cache_resource->tbl) { > DRV_LOG(DEBUG, "jump table resource resource > %p: refcnt %d++", > (void *)cache_resource, > @@ -914,7 +916,7 @@ struct field_modify_info modify_tcp[] =3D { > } > rte_atomic32_init(&cache_resource->refcnt); > rte_atomic32_inc(&cache_resource->refcnt); > - LIST_INSERT_HEAD(&priv->jump_tbl, cache_resource, next); > + LIST_INSERT_HEAD(&sh->jump_tbl, cache_resource, next); > dev_flow->dv.jump =3D cache_resource; > DRV_LOG(DEBUG, "new jump table resource %p: refcnt %d++", > (void *)cache_resource, > @@ -1538,14 +1540,15 @@ struct field_modify_info modify_tcp[] =3D { > struct rte_flow_error *error) > { > struct mlx5_priv *priv =3D dev->data->dev_private; > + struct mlx5_ibv_shared *sh =3D priv->sh; > struct mlx5_flow_dv_modify_hdr_resource *cache_resource; >=20 > struct mlx5dv_dr_ns *ns =3D > resource->ft_type =3D=3D MLX5DV_FLOW_TABLE_TYPE_NIC_TX > ? > - priv->tx_ns : priv->rx_ns; > + sh->tx_ns : sh->rx_ns; >=20 > /* Lookup a matching resource from cache. */ > - LIST_FOREACH(cache_resource, &priv->modify_cmds, next) { > + LIST_FOREACH(cache_resource, &sh->modify_cmds, next) { > if (resource->ft_type =3D=3D cache_resource->ft_type && > resource->actions_num =3D=3D cache_resource->actions_num > && > !memcmp((const void *)resource->actions, @@ -1569,7 > +1572,7 @@ struct field_modify_info modify_tcp[] =3D { > *cache_resource =3D *resource; > cache_resource->verbs_action =3D > mlx5_glue->dv_create_flow_action_modify_header > - (priv->sh->ctx, cache_resource- > >ft_type, > + (sh->ctx, cache_resource->ft_type, > ns, 0, > cache_resource->actions_num * > sizeof(cache_resource->actions[0]), > @@ -1582,7 +1585,7 @@ struct field_modify_info modify_tcp[] =3D { > } > rte_atomic32_init(&cache_resource->refcnt); > rte_atomic32_inc(&cache_resource->refcnt); > - LIST_INSERT_HEAD(&priv->modify_cmds, cache_resource, next); > + LIST_INSERT_HEAD(&sh->modify_cmds, cache_resource, next); > dev_flow->dv.modify_hdr =3D cache_resource; > DRV_LOG(DEBUG, "new modify-header resource %p: refcnt %d++", > (void *)cache_resource, > @@ -2879,18 +2882,19 @@ struct field_modify_info modify_tcp[] =3D { > struct rte_flow_error *error) > { > struct mlx5_priv *priv =3D dev->data->dev_private; > + struct mlx5_ibv_shared *sh =3D priv->sh; > struct mlx5_flow_tbl_resource *tbl; >=20 > if (egress) { > - tbl =3D &priv->tx_tbl[table_id]; > + tbl =3D &sh->tx_tbl[table_id]; > if (!tbl->obj) > tbl->obj =3D mlx5_glue->dr_create_flow_tbl > - (priv->tx_ns, table_id); > + (sh->tx_ns, table_id); > } else { > - tbl =3D &priv->rx_tbl[table_id]; > + tbl =3D &sh->rx_tbl[table_id]; > if (!tbl->obj) > tbl->obj =3D mlx5_glue->dr_create_flow_tbl > - (priv->rx_ns, table_id); > + (sh->rx_ns, table_id); > } > if (!tbl->obj) { > rte_flow_error_set(error, ENOMEM, > @@ -2946,6 +2950,7 @@ struct field_modify_info modify_tcp[] =3D { > struct rte_flow_error *error) > { > struct mlx5_priv *priv =3D dev->data->dev_private; > + struct mlx5_ibv_shared *sh =3D priv->sh; > struct mlx5_flow_dv_matcher *cache_matcher; > struct mlx5dv_flow_matcher_attr dv_attr =3D { > .type =3D IBV_FLOW_ATTR_NORMAL, > @@ -2957,7 +2962,7 @@ struct field_modify_info modify_tcp[] =3D { #endif >=20 > /* Lookup from cache. */ > - LIST_FOREACH(cache_matcher, &priv->matchers, next) { > + LIST_FOREACH(cache_matcher, &sh->matchers, next) { > if (matcher->crc =3D=3D cache_matcher->crc && > matcher->priority =3D=3D cache_matcher->priority && > matcher->egress =3D=3D cache_matcher->egress && @@ - > 3001,8 +3006,7 @@ struct field_modify_info modify_tcp[] =3D { > if (matcher->egress) > dv_attr.flags |=3D IBV_FLOW_ATTR_FLAGS_EGRESS; > cache_matcher->matcher_object =3D > - mlx5_glue->dv_create_flow_matcher(priv->sh->ctx, > &dv_attr, > - tbl->obj); > + mlx5_glue->dv_create_flow_matcher(sh->ctx, &dv_attr, tbl- > >obj); > if (!cache_matcher->matcher_object) { > rte_free(cache_matcher); > #ifdef HAVE_MLX5DV_DR > @@ -3013,7 +3017,7 @@ struct field_modify_info modify_tcp[] =3D { > NULL, "cannot create matcher"); > } > rte_atomic32_inc(&cache_matcher->refcnt); > - LIST_INSERT_HEAD(&priv->matchers, cache_matcher, next); > + LIST_INSERT_HEAD(&sh->matchers, cache_matcher, next); > dev_flow->dv.matcher =3D cache_matcher; > DRV_LOG(DEBUG, "priority %hd new %s matcher %p: refcnt %d", > cache_matcher->priority, > @@ -3069,10 +3073,11 @@ struct field_modify_info modify_tcp[] =3D { > struct rte_flow_error *error) > { > struct mlx5_priv *priv =3D dev->data->dev_private; > + struct mlx5_ibv_shared *sh =3D priv->sh; > struct mlx5_flow_dv_tag_resource *cache_resource; >=20 > /* Lookup a matching resource from cache. */ > - LIST_FOREACH(cache_resource, &priv->tags, next) { > + LIST_FOREACH(cache_resource, &sh->tags, next) { > if (resource->tag =3D=3D cache_resource->tag) { > DRV_LOG(DEBUG, "tag resource %p: refcnt %d++", > (void *)cache_resource, > @@ -3099,7 +3104,7 @@ struct field_modify_info modify_tcp[] =3D { > } > rte_atomic32_init(&cache_resource->refcnt); > rte_atomic32_inc(&cache_resource->refcnt); > - LIST_INSERT_HEAD(&priv->tags, cache_resource, next); > + LIST_INSERT_HEAD(&sh->tags, cache_resource, next); > dev_flow->flow->tag_resource =3D cache_resource; > DRV_LOG(DEBUG, "new tag resource %p: refcnt %d++", > (void *)cache_resource, > @@ -3676,6 +3681,7 @@ struct field_modify_info modify_tcp[] =3D { { > struct mlx5_flow_dv_matcher *matcher =3D flow->dv.matcher; > struct mlx5_priv *priv =3D dev->data->dev_private; > + struct mlx5_ibv_shared *sh =3D priv->sh; > struct mlx5_flow_tbl_resource *tbl; >=20 > assert(matcher->matcher_object); > @@ -3687,9 +3693,9 @@ struct field_modify_info modify_tcp[] =3D { > (matcher->matcher_object)); > LIST_REMOVE(matcher, next); > if (matcher->egress) > - tbl =3D &priv->tx_tbl[matcher->group]; > + tbl =3D &sh->tx_tbl[matcher->group]; > else > - tbl =3D &priv->rx_tbl[matcher->group]; > + tbl =3D &sh->rx_tbl[matcher->group]; > flow_dv_tbl_resource_release(tbl); > rte_free(matcher); > DRV_LOG(DEBUG, "port %u matcher %p: removed", > -- > 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 26139A0679 for ; Tue, 2 Apr 2019 21:10:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F1E8C6CC1; Tue, 2 Apr 2019 21:09:54 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20070.outbound.protection.outlook.com [40.107.2.70]) by dpdk.org (Postfix) with ESMTP id A39CB6CC1 for ; Tue, 2 Apr 2019 21:09:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FvKQmZYf0tSlvsCFqTYf7D1kV/RtkGrx/ARegrXaWAE=; b=D+tj1go1ZeTIjzycErEUFYvpFUBXVJNaU31odiQ6SMMz+Q51qyFZqr8PlBNT0gJo4qpxU3adB+JKCtk2SSqwGW77fLdmcty2uTyGG96/mMVfBKpKislTTqqhWIV3mjC10msWOgpqs4wko1Z72ZU9+DY0S/U/NucRvf6Rynr70G0= Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com (52.133.45.150) by AM0PR0502MB4050.eurprd05.prod.outlook.com (52.133.37.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.20; Tue, 2 Apr 2019 19:09:52 +0000 Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com ([fe80::84f3:7e92:7a51:1003]) by AM0PR0502MB3795.eurprd05.prod.outlook.com ([fe80::84f3:7e92:7a51:1003%2]) with mapi id 15.20.1750.014; Tue, 2 Apr 2019 19:09:52 +0000 From: Shahaf Shuler To: Slava Ovsiienko , "dev@dpdk.org" Thread-Topic: [PATCH 3/4] net/mlx5: share DV/DR flow related structures Thread-Index: AQHU6Rx+lCdwrRzIykGOAm1mBd8dDaYpNpgg Date: Tue, 2 Apr 2019 19:09:52 +0000 Message-ID: References: <1554186157-29455-1-git-send-email-viacheslavo@mellanox.com> <1554186157-29455-4-git-send-email-viacheslavo@mellanox.com> In-Reply-To: <1554186157-29455-4-git-send-email-viacheslavo@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; x-originating-ip: [31.154.10.105] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3a9bfdcb-6cac-4f27-5232-08d6b79ec914 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600139)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:AM0PR0502MB4050; x-ms-traffictypediagnostic: AM0PR0502MB4050: x-microsoft-antispam-prvs: x-forefront-prvs: 0995196AA2 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(396003)(39860400002)(376002)(136003)(366004)(189003)(199004)(97736004)(55016002)(71200400001)(68736007)(14454004)(9686003)(53936002)(26005)(6116002)(6246003)(71190400001)(6506007)(3846002)(99286004)(476003)(446003)(186003)(76176011)(2501003)(6436002)(7696005)(52536014)(11346002)(102836004)(486006)(305945005)(106356001)(33656002)(316002)(7736002)(110136005)(14444005)(86362001)(229853002)(74316002)(66066001)(30864003)(105586002)(5660300002)(81156014)(8936002)(81166006)(25786009)(2906002)(8676002)(256004)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB4050; H:AM0PR0502MB3795.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: zzlUz5Y0ZpOXR81JIpaJkOLj/RUzZ+A5pW7p/u68wuLkz25qfqr5m0CWRXAZiJPUqL02xjvdmzMMsx7yfgZZXpGm34/QzKL8GWZsQZ3cr1xGQBziWYjkInWhoUxfYqrBk23iZlbv23QmvMmCacAQ8MxcAqXDsrVAanbKOLpOcGdHEV/dgQC+EdGHlEvpKCD6V+bUeuVrDbphfd8OaQXacY0aBSE0KcLT8sqzNtHiByJgRZfGPOK36xv4ZnqCWD7D6W4ni1YAJ4ChPGIaAI7xWKcPFg1SGIqcRXRZUOce+ciDwBrlsiGUtRz0D6d+Rv4A0HCPTFF9usmgv+iKs1k5k3kH7h4DXI7jW+apABHaZzwfuatxiZyNWxBmCqB0ngIeJ1qtpQeu1onUYK56uxPhQBo9FgcZwF1/5OS7parxYPE= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3a9bfdcb-6cac-4f27-5232-08d6b79ec914 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Apr 2019 19:09:52.4010 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB4050 Subject: Re: [dpdk-dev] [PATCH 3/4] net/mlx5: share DV/DR flow related structures 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" Message-ID: <20190402190952.RdLVdn9AEvrVVvEvH9k76dKS4VF4diKkrAwIRac1bcc@z> Tuesday, April 2, 2019 9:23 AM, Viacheslav Ovsiienko: > Subject: [PATCH 3/4] net/mlx5: share DV/DR flow related structures Same comment about the title.=20 >=20 > DV/DR related structures are moved to the shared context: > - rx/tx namespaces, shared by master and representors > - rx/tx flow tables > - matchers > - encap/decap action resources > - flow tags (MARK actions) > - modify action resources > - jump tables I am OK w/ the logic. However the next commit (4/4 net/mlx5: add mutex for shared DV/DR structure= s) should be squashed into this one.=20 Because w/o it, the concurrent flow creation/destroy between multiple devic= es is broken.=20 >=20 > Signed-off-by: Viacheslav Ovsiienko > --- > drivers/net/mlx5/mlx5.c | 28 +++++++++++----------- > drivers/net/mlx5/mlx5.h | 40 +++++++++++++++---------------- > drivers/net/mlx5/mlx5_flow_dv.c | 52 +++++++++++++++++++++++--------- > --------- > 3 files changed, 63 insertions(+), 57 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index > 79e0c17..369b698 100644 > --- a/drivers/net/mlx5/mlx5.c > +++ b/drivers/net/mlx5/mlx5.c > @@ -329,27 +329,27 @@ struct mlx5_dev_spawn_data { > err =3D errno; > goto error; > } > - priv->rx_ns =3D ns; > + sh->rx_ns =3D ns; > ns =3D mlx5dv_dr_create_ns(sh->ctx, > MLX5DV_DR_NS_DOMAIN_EGRESS_BYPASS); > if (!ns) { > DRV_LOG(ERR, "egress mlx5dv_dr_create_ns failed"); > err =3D errno; > goto error; > } > - priv->tx_ns =3D ns; > + sh->tx_ns =3D ns; > sh->dv_refcnt++; > priv->dv_shared =3D 1; > return 0; >=20 > error: > /* Rollback the created objects. */ > - if (priv->rx_ns) { > - mlx5dv_dr_destroy_ns(priv->rx_ns); > - priv->rx_ns =3D NULL; > + if (sh->rx_ns) { > + mlx5dv_dr_destroy_ns(sh->rx_ns); > + sh->rx_ns =3D NULL; > } > - if (priv->tx_ns) { > - mlx5dv_dr_destroy_ns(priv->tx_ns); > - priv->tx_ns =3D NULL; > + if (sh->tx_ns) { > + mlx5dv_dr_destroy_ns(sh->tx_ns); > + sh->tx_ns =3D NULL; > } > return err; > } > @@ -373,13 +373,13 @@ struct mlx5_dev_spawn_data { > assert(sh->dv_refcnt); > if (sh->dv_refcnt && --sh->dv_refcnt) > return; > - if (priv->rx_ns) { > - mlx5dv_dr_destroy_ns(priv->rx_ns); > - priv->rx_ns =3D NULL; > + if (sh->rx_ns) { > + mlx5dv_dr_destroy_ns(sh->rx_ns); > + sh->rx_ns =3D NULL; > } > - if (priv->tx_ns) { > - mlx5dv_dr_destroy_ns(priv->tx_ns); > - priv->tx_ns =3D NULL; > + if (sh->tx_ns) { > + mlx5dv_dr_destroy_ns(sh->tx_ns); > + sh->tx_ns =3D NULL; > } > } > #endif > diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index > 56a2c61..e67227f 100644 > --- a/drivers/net/mlx5/mlx5.h > +++ b/drivers/net/mlx5/mlx5.h > @@ -199,6 +199,15 @@ struct mlx5_ibv_shared_port { > */ > }; >=20 > +/* Table structure. */ > +struct mlx5_flow_tbl_resource { > + void *obj; /**< Pointer to DR table object. */ > + rte_atomic32_t refcnt; /**< Reference counter. */ }; > + > +#define MLX5_MAX_TABLES 1024 > +#define MLX5_GROUP_FACTOR 1 > + > /* > * Shared Infiniband device context for Master/Representors > * which belong to same IB device with multiple IB ports. > @@ -215,6 +224,17 @@ struct mlx5_ibv_shared { > struct ibv_device_attr_ex device_attr; /* Device properties. */ > /* Shared DV/DR flow data section. */ > uint32_t dv_refcnt; /* DV/DR data reference counter. */ > + void *rx_ns; /* 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. */ > + struct mlx5_flow_tbl_resource tx_tbl[MLX5_MAX_TABLES]; > + /* TX Direct Rules tables/ */ > + LIST_HEAD(matchers, mlx5_flow_dv_matcher) matchers; > + LIST_HEAD(encap_decap, mlx5_flow_dv_encap_decap_resource) > encaps_decaps; > + LIST_HEAD(modify_cmd, mlx5_flow_dv_modify_hdr_resource) > modify_cmds; > + LIST_HEAD(tag, mlx5_flow_dv_tag_resource) tags; > + LIST_HEAD(jump, mlx5_flow_dv_jump_tbl_resource) jump_tbl; > /* Shared interrupt handler section. */ > pthread_mutex_t intr_mutex; /* Interrupt config mutex. */ > uint32_t intr_cnt; /* Interrupt handler reference counter. */ @@ - > 222,15 +242,6 @@ struct mlx5_ibv_shared { > struct mlx5_ibv_shared_port port[]; /* per device port data array. */ > }; >=20 > -/* Table structure. */ > -struct mlx5_flow_tbl_resource { > - void *obj; /**< Pointer to DR table object. */ > - rte_atomic32_t refcnt; /**< Reference counter. */ > -}; > - > -#define MLX5_MAX_TABLES 1024 > -#define MLX5_GROUP_FACTOR 1 > - > struct mlx5_priv { > LIST_ENTRY(mlx5_priv) mem_event_cb; > /**< Called by memory event callback. */ @@ -279,11 +290,6 @@ > struct mlx5_priv { > LIST_HEAD(txqibv, mlx5_txq_ibv) txqsibv; /* Verbs Tx queues. */ > /* Verbs Indirection tables. */ > LIST_HEAD(ind_tables, mlx5_ind_table_ibv) ind_tbls; > - LIST_HEAD(matchers, mlx5_flow_dv_matcher) matchers; > - LIST_HEAD(encap_decap, mlx5_flow_dv_encap_decap_resource) > encaps_decaps; > - LIST_HEAD(modify_cmd, mlx5_flow_dv_modify_hdr_resource) > modify_cmds; > - LIST_HEAD(tag, mlx5_flow_dv_tag_resource) tags; > - LIST_HEAD(jump, mlx5_flow_dv_jump_tbl_resource) jump_tbl; > /* Pointer to next element. */ > rte_atomic32_t refcnt; /**< Reference counter. */ > struct ibv_flow_action *verbs_action; > @@ -308,12 +314,6 @@ struct mlx5_priv { > /* UAR same-page access control required in 32bit implementations. > */ #endif > struct mlx5_flow_tcf_context *tcf_context; /* TC flower context. */ > - void *rx_ns; /* 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. */ > - struct mlx5_flow_tbl_resource tx_tbl[MLX5_MAX_TABLES]; > - /* TX Direct Rules tables/ */ > }; >=20 > #define PORT_ID(priv) ((priv)->dev_data->port_id) diff --git > a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c > index f1dd00a..4912fc8 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -804,18 +804,19 @@ struct field_modify_info modify_tcp[] =3D { > struct rte_flow_error *error) > { > struct mlx5_priv *priv =3D dev->data->dev_private; > + struct mlx5_ibv_shared *sh =3D priv->sh; > struct mlx5_flow_dv_encap_decap_resource *cache_resource; > struct rte_flow *flow =3D dev_flow->flow; > struct mlx5dv_dr_ns *ns; >=20 > resource->flags =3D flow->group ? 0 : 1; > if (flow->ingress) > - ns =3D priv->rx_ns; > + ns =3D sh->rx_ns; > else > - ns =3D priv->tx_ns; > + ns =3D sh->tx_ns; >=20 > /* Lookup a matching resource from cache. */ > - LIST_FOREACH(cache_resource, &priv->encaps_decaps, next) { > + LIST_FOREACH(cache_resource, &sh->encaps_decaps, next) { > if (resource->reformat_type =3D=3D cache_resource- > >reformat_type && > resource->ft_type =3D=3D cache_resource->ft_type && > resource->flags =3D=3D cache_resource->flags && @@ -840,7 > +841,7 @@ struct field_modify_info modify_tcp[] =3D { > *cache_resource =3D *resource; > cache_resource->verbs_action =3D > mlx5_glue->dv_create_flow_action_packet_reformat > - (priv->sh->ctx, cache_resource->reformat_type, > + (sh->ctx, cache_resource->reformat_type, > cache_resource->ft_type, ns, cache_resource- > >flags, > cache_resource->size, > (cache_resource->size ? cache_resource->buf : > NULL)); @@ -852,7 +853,7 @@ struct field_modify_info modify_tcp[] =3D { > } > rte_atomic32_init(&cache_resource->refcnt); > rte_atomic32_inc(&cache_resource->refcnt); > - LIST_INSERT_HEAD(&priv->encaps_decaps, cache_resource, next); > + LIST_INSERT_HEAD(&sh->encaps_decaps, cache_resource, next); > dev_flow->dv.encap_decap =3D cache_resource; > DRV_LOG(DEBUG, "new encap/decap resource %p: refcnt %d++", > (void *)cache_resource, > @@ -883,10 +884,11 @@ struct field_modify_info modify_tcp[] =3D { > struct rte_flow_error *error) > { > struct mlx5_priv *priv =3D dev->data->dev_private; > + struct mlx5_ibv_shared *sh =3D priv->sh; > struct mlx5_flow_dv_jump_tbl_resource *cache_resource; >=20 > /* Lookup a matching resource from cache. */ > - LIST_FOREACH(cache_resource, &priv->jump_tbl, next) { > + LIST_FOREACH(cache_resource, &sh->jump_tbl, next) { > if (resource->tbl =3D=3D cache_resource->tbl) { > DRV_LOG(DEBUG, "jump table resource resource > %p: refcnt %d++", > (void *)cache_resource, > @@ -914,7 +916,7 @@ struct field_modify_info modify_tcp[] =3D { > } > rte_atomic32_init(&cache_resource->refcnt); > rte_atomic32_inc(&cache_resource->refcnt); > - LIST_INSERT_HEAD(&priv->jump_tbl, cache_resource, next); > + LIST_INSERT_HEAD(&sh->jump_tbl, cache_resource, next); > dev_flow->dv.jump =3D cache_resource; > DRV_LOG(DEBUG, "new jump table resource %p: refcnt %d++", > (void *)cache_resource, > @@ -1538,14 +1540,15 @@ struct field_modify_info modify_tcp[] =3D { > struct rte_flow_error *error) > { > struct mlx5_priv *priv =3D dev->data->dev_private; > + struct mlx5_ibv_shared *sh =3D priv->sh; > struct mlx5_flow_dv_modify_hdr_resource *cache_resource; >=20 > struct mlx5dv_dr_ns *ns =3D > resource->ft_type =3D=3D MLX5DV_FLOW_TABLE_TYPE_NIC_TX > ? > - priv->tx_ns : priv->rx_ns; > + sh->tx_ns : sh->rx_ns; >=20 > /* Lookup a matching resource from cache. */ > - LIST_FOREACH(cache_resource, &priv->modify_cmds, next) { > + LIST_FOREACH(cache_resource, &sh->modify_cmds, next) { > if (resource->ft_type =3D=3D cache_resource->ft_type && > resource->actions_num =3D=3D cache_resource->actions_num > && > !memcmp((const void *)resource->actions, @@ -1569,7 > +1572,7 @@ struct field_modify_info modify_tcp[] =3D { > *cache_resource =3D *resource; > cache_resource->verbs_action =3D > mlx5_glue->dv_create_flow_action_modify_header > - (priv->sh->ctx, cache_resource- > >ft_type, > + (sh->ctx, cache_resource->ft_type, > ns, 0, > cache_resource->actions_num * > sizeof(cache_resource->actions[0]), > @@ -1582,7 +1585,7 @@ struct field_modify_info modify_tcp[] =3D { > } > rte_atomic32_init(&cache_resource->refcnt); > rte_atomic32_inc(&cache_resource->refcnt); > - LIST_INSERT_HEAD(&priv->modify_cmds, cache_resource, next); > + LIST_INSERT_HEAD(&sh->modify_cmds, cache_resource, next); > dev_flow->dv.modify_hdr =3D cache_resource; > DRV_LOG(DEBUG, "new modify-header resource %p: refcnt %d++", > (void *)cache_resource, > @@ -2879,18 +2882,19 @@ struct field_modify_info modify_tcp[] =3D { > struct rte_flow_error *error) > { > struct mlx5_priv *priv =3D dev->data->dev_private; > + struct mlx5_ibv_shared *sh =3D priv->sh; > struct mlx5_flow_tbl_resource *tbl; >=20 > if (egress) { > - tbl =3D &priv->tx_tbl[table_id]; > + tbl =3D &sh->tx_tbl[table_id]; > if (!tbl->obj) > tbl->obj =3D mlx5_glue->dr_create_flow_tbl > - (priv->tx_ns, table_id); > + (sh->tx_ns, table_id); > } else { > - tbl =3D &priv->rx_tbl[table_id]; > + tbl =3D &sh->rx_tbl[table_id]; > if (!tbl->obj) > tbl->obj =3D mlx5_glue->dr_create_flow_tbl > - (priv->rx_ns, table_id); > + (sh->rx_ns, table_id); > } > if (!tbl->obj) { > rte_flow_error_set(error, ENOMEM, > @@ -2946,6 +2950,7 @@ struct field_modify_info modify_tcp[] =3D { > struct rte_flow_error *error) > { > struct mlx5_priv *priv =3D dev->data->dev_private; > + struct mlx5_ibv_shared *sh =3D priv->sh; > struct mlx5_flow_dv_matcher *cache_matcher; > struct mlx5dv_flow_matcher_attr dv_attr =3D { > .type =3D IBV_FLOW_ATTR_NORMAL, > @@ -2957,7 +2962,7 @@ struct field_modify_info modify_tcp[] =3D { #endif >=20 > /* Lookup from cache. */ > - LIST_FOREACH(cache_matcher, &priv->matchers, next) { > + LIST_FOREACH(cache_matcher, &sh->matchers, next) { > if (matcher->crc =3D=3D cache_matcher->crc && > matcher->priority =3D=3D cache_matcher->priority && > matcher->egress =3D=3D cache_matcher->egress && @@ - > 3001,8 +3006,7 @@ struct field_modify_info modify_tcp[] =3D { > if (matcher->egress) > dv_attr.flags |=3D IBV_FLOW_ATTR_FLAGS_EGRESS; > cache_matcher->matcher_object =3D > - mlx5_glue->dv_create_flow_matcher(priv->sh->ctx, > &dv_attr, > - tbl->obj); > + mlx5_glue->dv_create_flow_matcher(sh->ctx, &dv_attr, tbl- > >obj); > if (!cache_matcher->matcher_object) { > rte_free(cache_matcher); > #ifdef HAVE_MLX5DV_DR > @@ -3013,7 +3017,7 @@ struct field_modify_info modify_tcp[] =3D { > NULL, "cannot create matcher"); > } > rte_atomic32_inc(&cache_matcher->refcnt); > - LIST_INSERT_HEAD(&priv->matchers, cache_matcher, next); > + LIST_INSERT_HEAD(&sh->matchers, cache_matcher, next); > dev_flow->dv.matcher =3D cache_matcher; > DRV_LOG(DEBUG, "priority %hd new %s matcher %p: refcnt %d", > cache_matcher->priority, > @@ -3069,10 +3073,11 @@ struct field_modify_info modify_tcp[] =3D { > struct rte_flow_error *error) > { > struct mlx5_priv *priv =3D dev->data->dev_private; > + struct mlx5_ibv_shared *sh =3D priv->sh; > struct mlx5_flow_dv_tag_resource *cache_resource; >=20 > /* Lookup a matching resource from cache. */ > - LIST_FOREACH(cache_resource, &priv->tags, next) { > + LIST_FOREACH(cache_resource, &sh->tags, next) { > if (resource->tag =3D=3D cache_resource->tag) { > DRV_LOG(DEBUG, "tag resource %p: refcnt %d++", > (void *)cache_resource, > @@ -3099,7 +3104,7 @@ struct field_modify_info modify_tcp[] =3D { > } > rte_atomic32_init(&cache_resource->refcnt); > rte_atomic32_inc(&cache_resource->refcnt); > - LIST_INSERT_HEAD(&priv->tags, cache_resource, next); > + LIST_INSERT_HEAD(&sh->tags, cache_resource, next); > dev_flow->flow->tag_resource =3D cache_resource; > DRV_LOG(DEBUG, "new tag resource %p: refcnt %d++", > (void *)cache_resource, > @@ -3676,6 +3681,7 @@ struct field_modify_info modify_tcp[] =3D { { > struct mlx5_flow_dv_matcher *matcher =3D flow->dv.matcher; > struct mlx5_priv *priv =3D dev->data->dev_private; > + struct mlx5_ibv_shared *sh =3D priv->sh; > struct mlx5_flow_tbl_resource *tbl; >=20 > assert(matcher->matcher_object); > @@ -3687,9 +3693,9 @@ struct field_modify_info modify_tcp[] =3D { > (matcher->matcher_object)); > LIST_REMOVE(matcher, next); > if (matcher->egress) > - tbl =3D &priv->tx_tbl[matcher->group]; > + tbl =3D &sh->tx_tbl[matcher->group]; > else > - tbl =3D &priv->rx_tbl[matcher->group]; > + tbl =3D &sh->rx_tbl[matcher->group]; > flow_dv_tbl_resource_release(tbl); > rte_free(matcher); > DRV_LOG(DEBUG, "port %u matcher %p: removed", > -- > 1.8.3.1