From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id ECFFEA0598; Tue, 21 Apr 2020 19:55:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E18381D440; Tue, 21 Apr 2020 19:55:19 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60077.outbound.protection.outlook.com [40.107.6.77]) by dpdk.org (Postfix) with ESMTP id 4BD5C1D42A; Tue, 21 Apr 2020 19:55:18 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IGKC3Njrl9KxWucZ+evZRMfF/zB6VPHsNrh6Vvf051mVP4XlHEvrY7Tum9GI6AjChk/mFo4zTD/xecncTAzr2J3sCgMbNSE5RFhdi8W+LkkWniUH8EuTYhxnVGkXcAGunYbf2ql5lFYAW84vnI8x+IciUwxV75EX5aHwPzDMK76jseKRSpZO9mH9Su5tvRKsFXuNpi5AGamXX7zy9CID+JM5gzIagNUeBrbei8wkMKm0SzFK2NSVL4AilSFS8Ha63l/b8fTX4Cd0i0kLJD8MsWyOr2vUt6HBaw106jAI/WIfmzlk/GztSr/lXrbBmvDf7zGC8RWfuDpPUe0sigCPpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RUCgRPB1OHLEqWOZCn5bf5RIMUXfbeOi87ZRA4HcO/8=; b=Tm0xkWTqYTv0AqAEnDyp/nuHFCp7WNvM/wr5H3b3O/8rEvtaGsH5X589IZ0rfV7dbPK+4htjEc9m6BpbkpSXplz+AJOqUZ6GU4tJOnmOGViRksQSnVg3WJTmRvKfLE0H5ZYSmhVs5WT/NF8Iw/9I5eHLm2vE7V4BuJThWPsTtYdrIO7yXn4wuAy+Zz2pWb6Bqn2O8kXRZLjOxoVxDxRkL/cgmf0GTWeEzJe/hSB7CsythuY4kZHimqErwdcXaS12I4TzPyrCo6NY3gRIQzJ/l9uyzLKQbKbDg42hCd5IvL1+T93o8dFUTLspG3OyAPZDCETHo1yWrhOJjWHpI30b1Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none 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=RUCgRPB1OHLEqWOZCn5bf5RIMUXfbeOi87ZRA4HcO/8=; b=pvhiK3K9G88jHh+kG7x7uWc2r6rIOsn2Y4nwqcQ1k2giyN5/Hs01YhQMtFLeSh9p5iW4qoFbnU0/PNZC9viq3ho1/9K7ODosxRdPgaax0nI3KLtDJHp1KyB/WQXU+FXetV2xJMvOyeFu0zBfVb+eP2aRv3u8sMJDmTs4R6Il/70= Received: from AM0PR05MB6707.eurprd05.prod.outlook.com (2603:10a6:20b:15b::17) by AM0PR05MB6435.eurprd05.prod.outlook.com (2603:10a6:208:146::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.25; Tue, 21 Apr 2020 17:55:16 +0000 Received: from AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::508:747b:cc12:5f6e]) by AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::508:747b:cc12:5f6e%6]) with mapi id 15.20.2921.030; Tue, 21 Apr 2020 17:55:16 +0000 From: Raslan Darawsheh To: Alexander Kozyrev , "dev@dpdk.org" CC: Slava Ovsiienko , "stable@dpdk.org" Thread-Topic: [PATCH] net/mlx5: set dynamic flow metadata in Rx queues Thread-Index: AQHWFNvNF0PBgmpO6kmiS6jLwab22KiD4jLA Date: Tue, 21 Apr 2020 17:55:15 +0000 Message-ID: References: <1587143693-22724-1-git-send-email-akozyrev@mellanox.com> In-Reply-To: <1587143693-22724-1-git-send-email-akozyrev@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=rasland@mellanox.com; x-originating-ip: [188.161.228.234] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: c8aa76ec-2b6a-4bad-e3f7-08d7e61d25e9 x-ms-traffictypediagnostic: AM0PR05MB6435:|AM0PR05MB6435: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-forefront-prvs: 038002787A x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB6707.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(366004)(76116006)(64756008)(66476007)(66946007)(66556008)(53546011)(6506007)(9686003)(52536014)(33656002)(55016002)(86362001)(30864003)(186003)(4326008)(8676002)(5660300002)(54906003)(8936002)(110136005)(7696005)(81156014)(66446008)(71200400001)(26005)(2906002)(498600001)(450100002); DIR:OUT; SFP:1101; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: zTYpI7iTKqQLgTrGHBrGIJ2LdC5/bJOR0jY+ag0OBNHtUU+ZcvD3yr+rnEM4oNlwimQ/tRJw6DR3PbtWJIg1W2oTy5p6vRhwoWdBJLQrXOs2BNwGF5PM/RiGtcZX84MnrC6kvFAlZcZclfMRlMxTuPdqdt3ZaJj4dG7QvKLFXy4NPgw7R2q30EuHc5dMc8uHmhsAlKjYczu5CBBA7r/IDcEbEmym5oZLvr7o5RmPsktG5NkRQtRJuRoC6OK66tj/5EF5npcPvf9cXOLO+C4drLASzactnLDsC6tZlur4SItyPYm4OBPbGGBrLU15aiw6Vc6HkX4jP8peFoJwK+OTZ76rs9LEcDx/sPWSNGQQhWvj5JqPYGId7RQE7QLI5NC4n8uklzQ8F2zVOPVReipFRMs/JRCFzSl+XkPXHC4Qy+0qGKpsKS4ddsCyo6wxB5v6 x-ms-exchange-antispam-messagedata: 7gUNMnG4jbL+CokszXUTabGa2+sK2vvz+Ksj8pvuJsQ1UjahwHaDxJPs2D0ZPvpUzPweiWC52NZAY0V4ziRXzVu8mnmuirprruI+aQjAT6YwTPXeMzMPg/O08jZo+eiW9uxOefmPf83g8oVJsdmzHw== 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: c8aa76ec-2b6a-4bad-e3f7-08d7e61d25e9 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Apr 2020 17:55:15.9734 (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-CrossTenant-userprincipalname: wNshra16qYks3dpIRWGmH0tEzV41BYJhIc8a58JTlS9wq+0NHLORKfZ2aVjn5x8EPpz8OAQdqwxZLzH1gNxS0Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6435 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: set dynamic flow metadata in Rx queues 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" Hi, > -----Original Message----- > From: Alexander Kozyrev > Sent: Friday, April 17, 2020 8:15 PM > To: dev@dpdk.org > Cc: Raslan Darawsheh ; Slava Ovsiienko > ; stable@dpdk.org > Subject: [PATCH] net/mlx5: set dynamic flow metadata in Rx queues >=20 > Using a global mbuf dynamic field for metadata incurs some > performance penalty on a datapath. Store this information in > the Rx queue descriptor for a better cache locality. >=20 > Fixes: a18ac6113331 ("net/mlx5: add metadata support to Rx datapath") > Cc: stable@dpdk.org >=20 > Signed-off-by: Alexander Kozyrev > Acked-by: Viacheslav Ovsiienko > --- > drivers/net/mlx5/mlx5.h | 1 + > drivers/net/mlx5/mlx5_flow.c | 29 +++++++++++++++++++ > drivers/net/mlx5/mlx5_rxtx.c | 7 +++-- > drivers/net/mlx5/mlx5_rxtx.h | 4 ++- > drivers/net/mlx5/mlx5_rxtx_vec_altivec.h | 27 +++++++++++------- > drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 49 ++++++++++++++++++------ > -------- > drivers/net/mlx5/mlx5_rxtx_vec_sse.h | 49 ++++++++++++++++++-------- > ------ > drivers/net/mlx5/mlx5_trigger.c | 2 ++ > lib/librte_ethdev/rte_flow.c | 2 +- > lib/librte_ethdev/rte_flow.h | 2 +- > 10 files changed, 113 insertions(+), 59 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h > index 318618e..16c60c8 100644 > --- a/drivers/net/mlx5/mlx5.h > +++ b/drivers/net/mlx5/mlx5.h > @@ -753,6 +753,7 @@ int mlx5_counter_query(struct rte_eth_dev *dev, > uint32_t cnt, > bool clear, uint64_t *pkts, uint64_t *bytes); > int mlx5_flow_dev_dump(struct rte_eth_dev *dev, FILE *file, > struct rte_flow_error *error); > +void mlx5_flow_rxq_dynf_metadata_set(struct rte_eth_dev *dev); >=20 > /* mlx5_mp.c */ > int mlx5_mp_primary_handle(const struct rte_mp_msg *mp_msg, const > void *peer); > diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c > index c529aa3..70e42a6 100644 > --- a/drivers/net/mlx5/mlx5_flow.c > +++ b/drivers/net/mlx5/mlx5_flow.c > @@ -894,6 +894,35 @@ uint32_t mlx5_flow_adjust_priority(struct > rte_eth_dev *dev, int32_t priority, > } > } >=20 > +/** > + * Set the Rx queue dynamic metadata (mask and offset) for a flow > + * > + * @param[in] dev > + * Pointer to the Ethernet device structure. > + */ > +void > +mlx5_flow_rxq_dynf_metadata_set(struct rte_eth_dev *dev) > +{ > + struct mlx5_priv *priv =3D dev->data->dev_private; > + struct mlx5_rxq_data *data; > + unsigned int i; > + > + for (i =3D 0; i !=3D priv->rxqs_n; ++i) { > + if (!(*priv->rxqs)[i]) > + continue; > + data =3D (*priv->rxqs)[i]; > + if (!rte_flow_dynf_metadata_avail()) { > + data->dynf_meta =3D 0; > + data->flow_meta_mask =3D 0; > + data->flow_meta_offset =3D -1; > + } else { > + data->dynf_meta =3D 1; > + data->flow_meta_mask =3D > rte_flow_dynf_metadata_mask; > + data->flow_meta_offset =3D > rte_flow_dynf_metadata_offs; > + } > + } > +} > + > /* > * return a pointer to the desired action in the list of actions. > * > diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c > index 3e583d4..0010b42 100644 > --- a/drivers/net/mlx5/mlx5_rxtx.c > +++ b/drivers/net/mlx5/mlx5_rxtx.c > @@ -1339,9 +1339,10 @@ enum mlx5_txcmp_code { > pkt->hash.fdir.hi =3D mlx5_flow_mark_get(mark); > } > } > - if (rte_flow_dynf_metadata_avail() && cqe->flow_table_metadata) > { > - pkt->ol_flags |=3D PKT_RX_DYNF_METADATA; > - *RTE_FLOW_DYNF_METADATA(pkt) =3D cqe- > >flow_table_metadata; > + if (rxq->dynf_meta && cqe->flow_table_metadata) { > + pkt->ol_flags |=3D rxq->flow_meta_mask; > + *RTE_MBUF_DYNFIELD(pkt, rxq->flow_meta_offset, > uint32_t *) =3D > + cqe->flow_table_metadata; > } > if (rxq->csum) > pkt->ol_flags |=3D rxq_cq_to_ol_flags(cqe); > diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h > index 8695218..48f2b79 100644 > --- a/drivers/net/mlx5/mlx5_rxtx.h > +++ b/drivers/net/mlx5/mlx5_rxtx.h > @@ -121,7 +121,7 @@ struct mlx5_rxq_data { > unsigned int err_state:2; /* enum mlx5_rxq_err_state. */ > unsigned int strd_scatter_en:1; /* Scattered packets from a stride. */ > unsigned int lro:1; /* Enable LRO. */ > - unsigned int :1; /* Remaining bits. */ > + unsigned int dynf_meta:1; /* Dynamic metadata is configured. */ > volatile uint32_t *rq_db; > volatile uint32_t *cq_db; > uint16_t port_id; > @@ -159,6 +159,8 @@ struct mlx5_rxq_data { > /* CQ (UAR) access lock required for 32bit implementations */ > #endif > uint32_t tunnel; /* Tunnel information. */ > + uint64_t flow_meta_mask; > + int32_t flow_meta_offset; > } __rte_cache_aligned; >=20 > enum mlx5_rxq_obj_type { > diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h > b/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h > index 0bb8b7a..03c0be2 100644 > --- a/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h > +++ b/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h > @@ -264,17 +264,22 @@ > elts[pos + 2]->hash.fdir.hi =3D flow_tag; > elts[pos + 3]->hash.fdir.hi =3D flow_tag; > } > - if (rte_flow_dynf_metadata_avail()) { > - const uint32_t meta =3D > *RTE_FLOW_DYNF_METADATA(t_pkt); > + if (!!rxq->flow_meta_mask) { > + int32_t offs =3D rxq->flow_meta_offset; > + const uint32_t meta =3D > + *RTE_MBUF_DYNFIELD(t_pkt, offs, uint32_t > *); >=20 > /* Check if title packet has valid metadata. */ > if (meta) { > - MLX5_ASSERT(t_pkt->ol_flags & > - PKT_RX_DYNF_METADATA); > - *RTE_FLOW_DYNF_METADATA(elts[pos]) =3D > meta; > - *RTE_FLOW_DYNF_METADATA(elts[pos + 1]) > =3D meta; > - *RTE_FLOW_DYNF_METADATA(elts[pos + 2]) > =3D meta; > - *RTE_FLOW_DYNF_METADATA(elts[pos + 3]) > =3D meta; > + MLX5_ASSERT(t_pkt->ol_flags & offs); > + *RTE_MBUF_DYNFIELD(elts[pos], offs, > + uint32_t *) =3D meta; > + *RTE_MBUF_DYNFIELD(elts[pos + 1], offs, > + uint32_t *) =3D meta; > + *RTE_MBUF_DYNFIELD(elts[pos + 2], offs, > + uint32_t *) =3D meta; > + *RTE_MBUF_DYNFIELD(elts[pos + 3], offs, > + uint32_t *) =3D meta; > } > } >=20 > @@ -1023,9 +1028,9 @@ > pkts[pos + 3]->timestamp =3D > rte_be_to_cpu_64(cq[pos + p3].timestamp); > } > - if (rte_flow_dynf_metadata_avail()) { > - uint64_t flag =3D rte_flow_dynf_metadata_mask; > - int offs =3D rte_flow_dynf_metadata_offs; > + if (!!rxq->flow_meta_mask) { > + uint64_t flag =3D rxq->flow_meta_mask; > + int32_t offs =3D rxq->flow_meta_offset; > uint32_t metadata; >=20 > /* This code is subject for futher optimization. */ > diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h > b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h > index 7b6c5db..d39e726 100644 > --- a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h > +++ b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h > @@ -205,17 +205,22 @@ > elts[pos + 2]->hash.fdir.hi =3D flow_tag; > elts[pos + 3]->hash.fdir.hi =3D flow_tag; > } > - if (rte_flow_dynf_metadata_avail()) { > - const uint32_t meta =3D > *RTE_FLOW_DYNF_METADATA(t_pkt); > + if (!!rxq->flow_meta_mask) { > + int32_t offs =3D rxq->flow_meta_offset; > + const uint32_t meta =3D > + *RTE_MBUF_DYNFIELD(t_pkt, offs, uint32_t > *); >=20 > /* Check if title packet has valid metadata. */ > if (meta) { > - MLX5_ASSERT(t_pkt->ol_flags & > - PKT_RX_DYNF_METADATA); > - *RTE_FLOW_DYNF_METADATA(elts[pos]) =3D > meta; > - *RTE_FLOW_DYNF_METADATA(elts[pos + 1]) > =3D meta; > - *RTE_FLOW_DYNF_METADATA(elts[pos + 2]) > =3D meta; > - *RTE_FLOW_DYNF_METADATA(elts[pos + 3]) > =3D meta; > + MLX5_ASSERT(t_pkt->ol_flags & offs); > + *RTE_MBUF_DYNFIELD(elts[pos], offs, > + uint32_t *) =3D meta; > + *RTE_MBUF_DYNFIELD(elts[pos + 1], offs, > + uint32_t *) =3D meta; > + *RTE_MBUF_DYNFIELD(elts[pos + 2], offs, > + uint32_t *) =3D meta; > + *RTE_MBUF_DYNFIELD(elts[pos + 3], offs, > + uint32_t *) =3D meta; > } > } > pos +=3D MLX5_VPMD_DESCS_PER_LOOP; > @@ -701,28 +706,30 @@ > container_of(p3, struct mlx5_cqe, > pkt_info)->timestamp); > } > - if (rte_flow_dynf_metadata_avail()) { > + if (!!rxq->flow_meta_mask) { > /* This code is subject for futher optimization. */ > - *RTE_FLOW_DYNF_METADATA(elts[pos]) =3D > + int32_t offs =3D rxq->flow_meta_offset; > + > + *RTE_MBUF_DYNFIELD(pkts[pos], offs, uint32_t *) =3D > container_of(p0, struct mlx5_cqe, > pkt_info)->flow_table_metadata; > - *RTE_FLOW_DYNF_METADATA(elts[pos + 1]) =3D > + *RTE_MBUF_DYNFIELD(pkts[pos], offs, uint32_t *) =3D > container_of(p1, struct mlx5_cqe, > pkt_info)->flow_table_metadata; > - *RTE_FLOW_DYNF_METADATA(elts[pos + 2]) =3D > + *RTE_MBUF_DYNFIELD(pkts[pos], offs, uint32_t *) =3D > container_of(p2, struct mlx5_cqe, > pkt_info)->flow_table_metadata; > - *RTE_FLOW_DYNF_METADATA(elts[pos + 3]) =3D > + *RTE_MBUF_DYNFIELD(pkts[pos], offs, uint32_t *) =3D > container_of(p3, struct mlx5_cqe, > pkt_info)->flow_table_metadata; > - if (*RTE_FLOW_DYNF_METADATA(elts[pos])) > - elts[pos]->ol_flags |=3D > PKT_RX_DYNF_METADATA; > - if (*RTE_FLOW_DYNF_METADATA(elts[pos + 1])) > - elts[pos + 1]->ol_flags |=3D > PKT_RX_DYNF_METADATA; > - if (*RTE_FLOW_DYNF_METADATA(elts[pos + 2])) > - elts[pos + 2]->ol_flags |=3D > PKT_RX_DYNF_METADATA; > - if (*RTE_FLOW_DYNF_METADATA(elts[pos + 3])) > - elts[pos + 3]->ol_flags |=3D > PKT_RX_DYNF_METADATA; > + if (*RTE_MBUF_DYNFIELD(pkts[pos], offs, uint32_t > *)) > + elts[pos]->ol_flags |=3D rxq- > >flow_meta_mask; > + if (*RTE_MBUF_DYNFIELD(pkts[pos + 1], offs, > uint32_t *)) > + elts[pos + 1]->ol_flags |=3D rxq- > >flow_meta_mask; > + if (*RTE_MBUF_DYNFIELD(pkts[pos + 2], offs, > uint32_t *)) > + elts[pos + 2]->ol_flags |=3D rxq- > >flow_meta_mask; > + if (*RTE_MBUF_DYNFIELD(pkts[pos + 3], offs, > uint32_t *)) > + elts[pos + 3]->ol_flags |=3D rxq- > >flow_meta_mask; > } > #ifdef MLX5_PMD_SOFT_COUNTERS > /* Add up received bytes count. */ > diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h > b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h > index 4b711f0..f110f73 100644 > --- a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h > +++ b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h > @@ -192,17 +192,22 @@ > elts[pos + 2]->hash.fdir.hi =3D flow_tag; > elts[pos + 3]->hash.fdir.hi =3D flow_tag; > } > - if (rte_flow_dynf_metadata_avail()) { > - const uint32_t meta =3D > *RTE_FLOW_DYNF_METADATA(t_pkt); > + if (rxq->dynf_meta) { > + int32_t offs =3D rxq->flow_meta_offset; > + const uint32_t meta =3D > + *RTE_MBUF_DYNFIELD(t_pkt, offs, uint32_t > *); >=20 > /* Check if title packet has valid metadata. */ > if (meta) { > - MLX5_ASSERT(t_pkt->ol_flags & > - PKT_RX_DYNF_METADATA); > - *RTE_FLOW_DYNF_METADATA(elts[pos]) =3D > meta; > - *RTE_FLOW_DYNF_METADATA(elts[pos + 1]) > =3D meta; > - *RTE_FLOW_DYNF_METADATA(elts[pos + 2]) > =3D meta; > - *RTE_FLOW_DYNF_METADATA(elts[pos + 3]) > =3D meta; > + MLX5_ASSERT(t_pkt->ol_flags & offs); > + *RTE_MBUF_DYNFIELD(elts[pos], offs, > + uint32_t *) =3D meta; > + *RTE_MBUF_DYNFIELD(elts[pos + 1], offs, > + uint32_t *) =3D meta; > + *RTE_MBUF_DYNFIELD(elts[pos + 2], offs, > + uint32_t *) =3D meta; > + *RTE_MBUF_DYNFIELD(elts[pos + 3], offs, > + uint32_t *) =3D meta; > } > } > pos +=3D MLX5_VPMD_DESCS_PER_LOOP; > @@ -654,24 +659,26 @@ > pkts[pos + 3]->timestamp =3D > rte_be_to_cpu_64(cq[pos + p3].timestamp); > } > - if (rte_flow_dynf_metadata_avail()) { > + if (rxq->dynf_meta) { > /* This code is subject for futher optimization. */ > - *RTE_FLOW_DYNF_METADATA(pkts[pos]) =3D > + int32_t offs =3D rxq->flow_meta_offset; > + > + *RTE_MBUF_DYNFIELD(pkts[pos], offs, uint32_t *) =3D > cq[pos].flow_table_metadata; > - *RTE_FLOW_DYNF_METADATA(pkts[pos + 1]) =3D > + *RTE_MBUF_DYNFIELD(pkts[pos + 1], offs, uint32_t > *) =3D > cq[pos + p1].flow_table_metadata; > - *RTE_FLOW_DYNF_METADATA(pkts[pos + 2]) =3D > + *RTE_MBUF_DYNFIELD(pkts[pos + 2], offs, uint32_t > *) =3D > cq[pos + p2].flow_table_metadata; > - *RTE_FLOW_DYNF_METADATA(pkts[pos + 3]) =3D > + *RTE_MBUF_DYNFIELD(pkts[pos + 3], offs, uint32_t > *) =3D > cq[pos + p3].flow_table_metadata; > - if (*RTE_FLOW_DYNF_METADATA(pkts[pos])) > - pkts[pos]->ol_flags |=3D > PKT_RX_DYNF_METADATA; > - if (*RTE_FLOW_DYNF_METADATA(pkts[pos + 1])) > - pkts[pos + 1]->ol_flags |=3D > PKT_RX_DYNF_METADATA; > - if (*RTE_FLOW_DYNF_METADATA(pkts[pos + 2])) > - pkts[pos + 2]->ol_flags |=3D > PKT_RX_DYNF_METADATA; > - if (*RTE_FLOW_DYNF_METADATA(pkts[pos + 3])) > - pkts[pos + 3]->ol_flags |=3D > PKT_RX_DYNF_METADATA; > + if (*RTE_MBUF_DYNFIELD(pkts[pos], offs, uint32_t > *)) > + pkts[pos]->ol_flags |=3D rxq- > >flow_meta_mask; > + if (*RTE_MBUF_DYNFIELD(pkts[pos + 1], offs, > uint32_t *)) > + pkts[pos + 1]->ol_flags |=3D rxq- > >flow_meta_mask; > + if (*RTE_MBUF_DYNFIELD(pkts[pos + 2], offs, > uint32_t *)) > + pkts[pos + 2]->ol_flags |=3D rxq- > >flow_meta_mask; > + if (*RTE_MBUF_DYNFIELD(pkts[pos + 3], offs, > uint32_t *)) > + pkts[pos + 3]->ol_flags |=3D rxq- > >flow_meta_mask; > } > #ifdef MLX5_PMD_SOFT_COUNTERS > /* Add up received bytes count. */ > diff --git a/drivers/net/mlx5/mlx5_trigger.c > b/drivers/net/mlx5/mlx5_trigger.c > index 7596704..feb9154 100644 > --- a/drivers/net/mlx5/mlx5_trigger.c > +++ b/drivers/net/mlx5/mlx5_trigger.c > @@ -323,6 +323,8 @@ > dev->data->port_id); > goto error; > } > + /* Set a mask and offset of dynamic metadata flows into Rx > queues*/ > + mlx5_flow_rxq_dynf_metadata_set(dev); > /* > * In non-cached mode, it only needs to start the default mreg copy > * action and no flow created by application exists anymore. > diff --git a/lib/librte_ethdev/rte_flow.c b/lib/librte_ethdev/rte_flow.c > index 3699edc..1685be5 100644 > --- a/lib/librte_ethdev/rte_flow.c > +++ b/lib/librte_ethdev/rte_flow.c > @@ -19,7 +19,7 @@ > #include "rte_flow.h" >=20 > /* Mbuf dynamic field name for metadata. */ > -int rte_flow_dynf_metadata_offs =3D -1; > +int32_t rte_flow_dynf_metadata_offs =3D -1; >=20 > /* Mbuf dynamic field flag bit number for metadata. */ > uint64_t rte_flow_dynf_metadata_mask; > diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h > index fab44f6..132b44e 100644 > --- a/lib/librte_ethdev/rte_flow.h > +++ b/lib/librte_ethdev/rte_flow.h > @@ -2653,7 +2653,7 @@ struct rte_flow_action_set_dscp { > }; >=20 > /* Mbuf dynamic field offset for metadata. */ > -extern int rte_flow_dynf_metadata_offs; > +extern int32_t rte_flow_dynf_metadata_offs; >=20 > /* Mbuf dynamic field flag mask for metadata. */ > extern uint64_t rte_flow_dynf_metadata_mask; > -- > 1.8.3.1 Patch applied to next-net-mlx, Kindest regards, Raslan Darawsheh