From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id ED6E7A0C41;
	Thu, 30 Sep 2021 16:59:32 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id D583A410EF;
	Thu, 30 Sep 2021 16:59:32 +0200 (CEST)
Received: from NAM04-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam08on2079.outbound.protection.outlook.com [40.107.102.79])
 by mails.dpdk.org (Postfix) with ESMTP id 5BED6410EB
 for <dev@dpdk.org>; Thu, 30 Sep 2021 16:59:31 +0200 (CEST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=jbOo181KuSu9wOweognRx00gVtNAfj6BMB1YdA6SRFzBFZhNvNk8mT+2zTgG+4mjvODi3A7ffRxCNMC2WGieRj4O72tpYbzh6x146V6Q/sWLLsMbyHFKEt+NtzspEjiVHfZ+oBFUJGo4w7PUFswwUWi7vFVz8pVYEbSWBqFLL7TNldw9/pzRuwr8Bi7kLsWwrmJa3+TyhLEGDnilOGoImkuvgn1lJPVDR/p7gp2NoZQmGjXL43LMKjlRvQFWCJqkgv2CIy9Fwh3sBApU/+Kvu+ttkueu7QZ03IjZMJeFTgyGTSunRXPA/pAlXog4QTW1FcETYGsiFxrSWOvv3WQ5Tg==
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; 
 bh=bd/SfH3J9KHI/JQqGx8WX6TEIvdE15QC8v0t6izNraU=;
 b=WUhT7UvWXQZPdU9Jp1AZNeQzU2vkm7aqY84memMibQZO7xFNweTJUGEh2kKaLt5zDyVb4dM9ULaEFBfaV2USphda09yqCgCgUuYREVUTmQDgGr65q8kdi+wTEQ5XB9bppafdGB8zPBSY4Im75inXvJ/FdJ5T/OOSufxqgIwG/jyfa5uY226n6ebQFL2WkhgnB59Nfws0bqAUErfMbGreOqGeDrR0jEfdxbDcOhi/5pG8zYBsK7XIiobn+ESu79L5+v3SssLhkcuHravk1u5p2akFu1iz/Y3k2uc/u8RXGRBFRLLs3A24TrXdeRCqcXNxaU3uUXeF0A5rC1hFFHDe/w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com;
 dkim=pass header.d=nvidia.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;
 s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=bd/SfH3J9KHI/JQqGx8WX6TEIvdE15QC8v0t6izNraU=;
 b=ZfvO2xNTof87cR1z4xCInrnlbzICGhRKYVBVXxnvOsSYRvE20DfCS7fM63LS2JEUAoC1ELTFvc0m/0a1uEnIzErVTmRNUGQiS5A/NU5dej/9cIz+rTQ5UiBCpizevaRa0Ggpt8kyFetFXmLsI6Bo7quF5ecrQu6cv2b1H1cMFnHh0uSH08dSND3U/Oica+nF60dpLmmxuF/NpcheNyJETZAN75QRAttnQaxhw2YGwOa0iQQFgdYLpk2ezss9/fnnrf0TWhxd6etbpZHQogmyLj/i7ShEhixBJesPdoncV7hNUQIJEsHI2i3qOwaiEODE7YeidKXJZo3LvntZwwCQIQ==
Received: from DM8PR12MB5400.namprd12.prod.outlook.com (2603:10b6:8:3b::12) by
 DM4PR12MB5246.namprd12.prod.outlook.com (2603:10b6:5:399::17) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.4566.13; Thu, 30 Sep 2021 14:59:30 +0000
Received: from DM8PR12MB5400.namprd12.prod.outlook.com
 ([fe80::d03d:1f75:ca20:6a32]) by DM8PR12MB5400.namprd12.prod.outlook.com
 ([fe80::d03d:1f75:ca20:6a32%6]) with mapi id 15.20.4544.022; Thu, 30 Sep 2021
 14:59:30 +0000
From: Ori Kam <orika@nvidia.com>
To: Ivan Malov <ivan.malov@oktetlabs.ru>, "dev@dpdk.org" <dev@dpdk.org>
CC: Andy Moreton <amoreton@xilinx.com>, Andrew Rybchenko
 <andrew.rybchenko@oktetlabs.ru>, Ray Kinsella <mdr@ashroe.eu>, Jerin Jacob
 <jerinj@marvell.com>, Wisam Monther <wisamm@nvidia.com>, Xiaoyun Li
 <xiaoyun.li@intel.com>, NBU-Contact-Thomas Monjalon <thomas@monjalon.net>,
 Ferruh Yigit <ferruh.yigit@intel.com>
Thread-Topic: [PATCH v3 1/5] ethdev: add API to negotiate delivery of Rx meta
 data
Thread-Index: AQHXsG0EGYKwxu5FGk6rpb3sj4WbEKu8simg
Date: Thu, 30 Sep 2021 14:59:30 +0000
Message-ID: <DM8PR12MB54002D8D207E54DB8F41986AD6AA9@DM8PR12MB5400.namprd12.prod.outlook.com>
References: <20210902142359.28138-1-ivan.malov@oktetlabs.ru>
 <20210923112012.14595-1-ivan.malov@oktetlabs.ru>
 <20210923112012.14595-2-ivan.malov@oktetlabs.ru>
In-Reply-To: <20210923112012.14595-2-ivan.malov@oktetlabs.ru>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
authentication-results: oktetlabs.ru; dkim=none (message not signed)
 header.d=none;oktetlabs.ru; dmarc=none action=none header.from=nvidia.com;
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 748e4df8-eb67-4b0b-cad1-08d98422e7c2
x-ms-traffictypediagnostic: DM4PR12MB5246:
x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr
x-ms-exchange-transport-forked: True
x-microsoft-antispam-prvs: <DM4PR12MB5246D2144A89625316AB751FD6AA9@DM4PR12MB5246.namprd12.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:1265;
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 64pPu5LL0EhGPjV8bcjjqAhpnhqKhkNy4aikKwNJrHwwVnkpuT3i00yUIGaYFveZzCWnpn53wV5lkd+vo8xbokyHnAf3upOeTvS0uGATK4UNbng2jpUKtCWokFNsIxTBPQ2GxUUtCpuZFOCWgxurUR9X1Bx0XkrCG4UX5wNVPZVuxgFi/r2yZ4uTxAW1TnjoaCl2mUtKTi+XAZwSvb5GBwFd2fJDAUAXyd+vos9jaMvqQF2yZxoj3zVWeBpHBshxyQ/fKZAzadnFOlX0R8g0IR2yC5pdlmyhTlER5QIhmVVYVdd1DIJJhpc7gsrHQcwONow9dW7JBMxsZRXB9xJhdlcd160Eu51zwI/Tefnni/P9MhFaTCvm0iuQd8A8bo7eHrQFJhwDddO4k4Rs50NmAFlYmacP89OgBGWw13ERG2CFhJKz99ZBh/y3EsAio1e+UrCv8ham6VAwtr/FyvgZ712MUxKo0MmMZTzI2IxdgNYnLcTnflDCBuElih3FffjEmKMybATwKjlpFQznQ2Z374O2lWjItrUsGLYf1jU/V16VRD3AFZfL9LzCQHJeliNYR3yXID5Wcfm4JjEYu2gN2VBNyJ7QkcuTON15xSiitkbgSugm/UBiKQT/pvTIjM7iic7j6Io1S1UcJl8LGWrNGzi2cq+kJbHA09VBnkp5o0HeOfKjHUhh93wxDbiZJIkitUaHsJCge5zeffcbbcEvAw==
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
 IPV:NLI; SFV:NSPM; H:DM8PR12MB5400.namprd12.prod.outlook.com; PTR:; CAT:NONE;
 SFS:(4636009)(366004)(8936002)(7696005)(508600001)(9686003)(66446008)(86362001)(66476007)(66556008)(64756008)(71200400001)(66946007)(55016002)(76116006)(83380400001)(38100700002)(8676002)(5660300002)(53546011)(2906002)(30864003)(122000001)(33656002)(316002)(6506007)(110136005)(4326008)(54906003)(186003)(52536014)(38070700005);
 DIR:OUT; SFP:1101; 
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?OLvjtLH7aO9MBPTMm3CbZKEC2cq0mZlNgDAAIJnFfAkXDarI/sgLVZYiycrb?=
 =?us-ascii?Q?2ymV/CP1xxiASJf8bl3BLQNtVCuWOPL8wltmDCFQObiIaMCSUNn/YW2fblbb?=
 =?us-ascii?Q?TW1GOURLeP9kdCTP0PRDfU8GF40hsbtKVk2evzQWpvs+F3IYQDsSWcmGOvfU?=
 =?us-ascii?Q?GZdhtnlhaYD+DiP5X3+aTV7uRytH9Mf4vFX/GNNVLIRLXkaZtyG7yQfASYtK?=
 =?us-ascii?Q?a+irsIy2CXK7ytcSrUODrWOZHDvWuXL+6n48ROgyR/20RQSV8x1ncRqUaUTx?=
 =?us-ascii?Q?t7l9s97FW+eKSdfzqEzeMcZArc/a++w9rzsA9FlvrDwA3Us1qZZEFxsuQeyl?=
 =?us-ascii?Q?k95HWexU/dm+spGCjK2B+eZo9zSZVstaDktYk2wVrsrSTvTpKik4V+NXK+sf?=
 =?us-ascii?Q?5oA4h6K7rleKAnbckCu1sK9UxfdYM801dQzb1mqt3KZmHR0MMyjPXIaUomo3?=
 =?us-ascii?Q?p6oQP8LQI4R1sVL1hsDnUsEbzxdCLHAEd+S+Fy2Lo9soEWMAfzovpL1kbn89?=
 =?us-ascii?Q?N/d9Y9CdgVMZ/Jxld5YRv/VcQwXmlirPzQnoLlhnp70yQjjX5B30NvInVTbA?=
 =?us-ascii?Q?MPu6T2TOcbmoXMJDekHDX7whVaT0YD4i3GzMiiw2WiaY3KVEToYJakAuwauH?=
 =?us-ascii?Q?n30uf98b/HAjrzmBV2ZQTpLOouSLViGyslvA+T9/Wvw1d9V5NXzDi5zRmlcY?=
 =?us-ascii?Q?JVuR45TKlkC3Y49EtLjC4fMdldJ8PyiPNuN/pk1oOi0X3VaA5ohaLx9myGSi?=
 =?us-ascii?Q?MuoPRURGiAw7U88eavhro6i3KWRySUP1+30lO4tiL4zoWNe9m+mW+dlgznSs?=
 =?us-ascii?Q?44v7uxuyCHJKcTYRf+ppDzRoTqtxFoQ/XqQaQ/VBmBDHTbLTqqoRXVMGDo02?=
 =?us-ascii?Q?/ytzmI/GzRvEfjUq9/5DbgLI5Z2vNiN+E8nyOSPZEJm58l00BLyXIVgx0BnU?=
 =?us-ascii?Q?sCVPXP2eL08Lw4AP3Ei4rprFydSZbTFZSLtQwVGQbL/Hr7r02zw7ZckBrc26?=
 =?us-ascii?Q?GfYf8arcmHOFtzru7eVcLjBmVp8R90HM8NkXswo0UPBLB2zzxPl4RwC9QUVh?=
 =?us-ascii?Q?AaiW1X4g26rvTcgwVumLJh4PnMNWJADHxPmJQc7xD8KZ8ziMNOC5yxE92/Ml?=
 =?us-ascii?Q?CawsTgQB6OdyvHcm1z73Tr31Zueu6dzSS0o0blQAlWsfJXqm0IqFnwdivJTN?=
 =?us-ascii?Q?73NxMjTOMxnX2n9vrdBVpmNFEGxw/YzI2V2wUjXLZD+EsmbLmIRlx2KuoJ/K?=
 =?us-ascii?Q?hqRLw0ZU6xlbUBQO8Dz2xstWwNLFOBOONKOlSZVEsujbF5XYN+nOR73jGeX+?=
 =?us-ascii?Q?HJ1ZcapmkJVlAXszkBe2jJFjWj4L2aECLXlL/EphNhxAq9hAo1mEftie9Gx5?=
 =?us-ascii?Q?tU+MunAkOQ7Dp+cnH6ZzfnhT+raz?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: Nvidia.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: DM8PR12MB5400.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 748e4df8-eb67-4b0b-cad1-08d98422e7c2
X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Sep 2021 14:59:30.0597 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: rf09zc4rYGH26r6+d86538+dvQNt8Z4gMqUxfgiQZa+lFJLDUq1txVkV+lMXx6T4E9B1gLq8KWv1AuqL2sE7Kw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5246
Subject: Re: [dpdk-dev] [PATCH v3 1/5] ethdev: add API to negotiate delivery
 of Rx meta data
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

Hi Ivan,
Sorry for jumping in late.

I have a concern that this patch breaks other PMDs.
>From the rst file " One should negotiate flag delivery beforehand"
since you only added this function for your PMD all other PMD will fail.
I see that you added exception in the  examples, but it doesn't make sense
that applications will also need to add this exception which is not documen=
ted.

Please see more comments inline.

Thanks,
Ori

> -----Original Message-----
> From: Ivan Malov <ivan.malov@oktetlabs.ru>
> Sent: Thursday, September 23, 2021 2:20 PM
> Subject: [PATCH v3 1/5] ethdev: add API to negotiate delivery of Rx meta
> data
>=20
> Delivery of mark, flag and the likes might affect small packet performanc=
e.
> If these features are disabled by default, enabling them in started state
> without causing traffic disruption may not always be possible.
>=20
> Let applications negotiate delivery of Rx meta data beforehand.
>=20
> Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
> Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> Reviewed-by: Andy Moreton <amoreton@xilinx.com>
> Acked-by: Ray Kinsella <mdr@ashroe.eu>
> Acked-by: Jerin Jacob <jerinj@marvell.com>
> ---
>  app/test-flow-perf/main.c              | 21 ++++++++++++
>  app/test-pmd/testpmd.c                 | 26 +++++++++++++++
>  doc/guides/rel_notes/release_21_11.rst |  9 ++++++
>  lib/ethdev/ethdev_driver.h             | 19 +++++++++++
>  lib/ethdev/rte_ethdev.c                | 25 ++++++++++++++
>  lib/ethdev/rte_ethdev.h                | 45 ++++++++++++++++++++++++++
>  lib/ethdev/rte_flow.h                  | 12 +++++++
>  lib/ethdev/version.map                 |  3 ++
>  8 files changed, 160 insertions(+)
>=20
> diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index
> 9be8edc31d..48eafffb1d 100644
> --- a/app/test-flow-perf/main.c
> +++ b/app/test-flow-perf/main.c
> @@ -1760,6 +1760,27 @@ init_port(void)
>  		rte_exit(EXIT_FAILURE, "Error: can't init mbuf pool\n");
>=20
>  	for (port_id =3D 0; port_id < nr_ports; port_id++) {
> +		uint64_t rx_meta_features =3D 0;
> +
> +		rx_meta_features |=3D RTE_ETH_RX_META_USER_FLAG;
> +		rx_meta_features |=3D RTE_ETH_RX_META_USER_MARK;
> +
> +		ret =3D rte_eth_rx_meta_negotiate(port_id,
> &rx_meta_features);
> +		if (ret =3D=3D 0) {
> +			if (!(rx_meta_features &
> RTE_ETH_RX_META_USER_FLAG)) {
> +				printf(":: flow action FLAG will not affect Rx
> mbufs on port=3D%u\n",
> +				       port_id);
> +			}
> +
> +			if (!(rx_meta_features &
> RTE_ETH_RX_META_USER_MARK)) {
> +				printf(":: flow action MARK will not affect Rx
> mbufs on port=3D%u\n",
> +				       port_id);
> +			}
> +		} else if (ret !=3D -ENOTSUP) {
> +			rte_exit(EXIT_FAILURE, "Error when negotiating Rx
> meta features on port=3D%u: %s\n",
> +				 port_id, rte_strerror(-ret));
> +		}
> +
>  		ret =3D rte_eth_dev_info_get(port_id, &dev_info);
>  		if (ret !=3D 0)
>  			rte_exit(EXIT_FAILURE,
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index
> 97ae52e17e..7a8da3d7ab 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -1485,10 +1485,36 @@ static void
>  init_config_port_offloads(portid_t pid, uint32_t socket_id)  {
>  	struct rte_port *port =3D &ports[pid];
> +	uint64_t rx_meta_features =3D 0;
>  	uint16_t data_size;
>  	int ret;
>  	int i;
>=20
> +	rx_meta_features |=3D RTE_ETH_RX_META_USER_FLAG;
> +	rx_meta_features |=3D RTE_ETH_RX_META_USER_MARK;
> +	rx_meta_features |=3D RTE_ETH_RX_META_TUNNEL_ID;
> +
> +	ret =3D rte_eth_rx_meta_negotiate(pid, &rx_meta_features);
> +	if (ret =3D=3D 0) {
> +		if (!(rx_meta_features & RTE_ETH_RX_META_USER_FLAG)) {
> +			TESTPMD_LOG(INFO, "Flow action FLAG will not
> affect Rx mbufs on port %u\n",
> +				    pid);
> +		}
> +
> +		if (!(rx_meta_features & RTE_ETH_RX_META_USER_MARK))
> {
> +			TESTPMD_LOG(INFO, "Flow action MARK will not
> affect Rx mbufs on port %u\n",
> +				    pid);
> +		}
> +
> +		if (!(rx_meta_features & RTE_ETH_RX_META_TUNNEL_ID)) {
> +			TESTPMD_LOG(INFO, "Flow tunnel offload support
> might be limited or unavailable on port %u\n",
> +				    pid);
> +		}
> +	} else if (ret !=3D -ENOTSUP) {
> +		rte_exit(EXIT_FAILURE, "Error when negotiating Rx meta
> features on port %u: %s\n",
> +			 pid, rte_strerror(-ret));
> +	}
> +
>  	port->dev_conf.txmode =3D tx_mode;
>  	port->dev_conf.rxmode =3D rx_mode;
>=20
> diff --git a/doc/guides/rel_notes/release_21_11.rst
> b/doc/guides/rel_notes/release_21_11.rst
> index 19356ac53c..6674d4474c 100644
> --- a/doc/guides/rel_notes/release_21_11.rst
> +++ b/doc/guides/rel_notes/release_21_11.rst
> @@ -106,6 +106,15 @@ New Features
>    Added command-line options to specify total number of processes and
>    current process ID. Each process owns subset of Rx and Tx queues.
>=20
> +* **Added an API to negotiate delivery of specific parts of Rx meta
> +data**
> +
> +  A new API, ``rte_eth_rx_meta_negotiate()``, was added.
> +  The following parts of Rx meta data were defined:
> +
> +  * ``RTE_ETH_RX_META_USER_FLAG``
> +  * ``RTE_ETH_RX_META_USER_MARK``
> +  * ``RTE_ETH_RX_META_TUNNEL_ID``
> +
>=20
>  Removed Items
>  -------------
> diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h inde=
x
> 40e474aa7e..96e0c60cae 100644
> --- a/lib/ethdev/ethdev_driver.h
> +++ b/lib/ethdev/ethdev_driver.h
> @@ -789,6 +789,22 @@ typedef int (*eth_get_monitor_addr_t)(void *rxq,
> typedef int (*eth_representor_info_get_t)(struct rte_eth_dev *dev,
>  	struct rte_eth_representor_info *info);
>=20
> +/**
> + * @internal
> + * Negotiate delivery of specific parts of Rx meta data.
> + *
> + * @param dev
> + *   Port (ethdev) handle
> + *
> + * @param[inout] features
> + *   Feature selection buffer
> + *
> + * @return
> + *   Negative errno value on error, zero otherwise
> + */
> +typedef int (*eth_rx_meta_negotiate_t)(struct rte_eth_dev *dev,
> +				       uint64_t *features);
> +
>  /**
>   * @internal A structure containing the functions exported by an Etherne=
t
> driver.
>   */
> @@ -949,6 +965,9 @@ struct eth_dev_ops {
>=20
>  	eth_representor_info_get_t representor_info_get;
>  	/**< Get representor info. */
> +
> +	eth_rx_meta_negotiate_t rx_meta_negotiate;
> +	/**< Negotiate delivery of specific parts of Rx meta data. */
>  };
>=20
>  /**
> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index
> daf5ca9242..49cb84d64c 100644
> --- a/lib/ethdev/rte_ethdev.c
> +++ b/lib/ethdev/rte_ethdev.c
> @@ -6310,6 +6310,31 @@ rte_eth_representor_info_get(uint16_t port_id,
>  	return eth_err(port_id, (*dev->dev_ops-
> >representor_info_get)(dev, info));  }
>=20
> +int
> +rte_eth_rx_meta_negotiate(uint16_t port_id, uint64_t *features) {
> +	struct rte_eth_dev *dev;
> +
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> +	dev =3D &rte_eth_devices[port_id];
> +
> +	if (dev->data->dev_configured !=3D 0) {
> +		RTE_ETHDEV_LOG(ERR,
> +			"The port (id=3D%"PRIu16") is already configured\n",
> +			port_id);
> +		return -EBUSY;
> +	}
> +
> +	if (features =3D=3D NULL) {
> +		RTE_ETHDEV_LOG(ERR, "Invalid features (NULL)\n");
> +		return -EINVAL;
> +	}
> +
> +	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_meta_negotiate,
> -ENOTSUP);
> +	return eth_err(port_id,
> +		       (*dev->dev_ops->rx_meta_negotiate)(dev, features)); }
> +
>  RTE_LOG_REGISTER_DEFAULT(rte_eth_dev_logtype, INFO);
>=20
>  RTE_INIT(ethdev_init_telemetry)
> diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index
> 1da37896d8..8467a7a362 100644
> --- a/lib/ethdev/rte_ethdev.h
> +++ b/lib/ethdev/rte_ethdev.h
> @@ -4888,6 +4888,51 @@ __rte_experimental  int
> rte_eth_representor_info_get(uint16_t port_id,
>  				 struct rte_eth_representor_info *info);
>=20
> +/** The ethdev sees flagged packets if there are flows with action
> +FLAG. */ #define RTE_ETH_RX_META_USER_FLAG (UINT64_C(1) << 0)
> +
> +/** The ethdev sees mark IDs in packets if there are flows with action
> +MARK. */ #define RTE_ETH_RX_META_USER_MARK (UINT64_C(1) << 1)
> +
> +/** The ethdev detects missed packets if there are "tunnel_set" flows
> +in use. */ #define RTE_ETH_RX_META_TUNNEL_ID (UINT64_C(1) << 2)
> +
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change without prior notice
> + *
> + * Negotiate delivery of specific parts of Rx meta data.
> + *
> + * Invoke this API before the first rte_eth_dev_configure() invocation
> + * to let the PMD make preparations that are inconvenient to do later.
> + *
> + * The negotiation process is as follows:
> + *
> + * - the application requests features intending to use at least some
> +of them;
> + * - the PMD responds with the guaranteed subset of the requested
> +feature set;
> + * - the application can retry negotiation with another set of
> +features;
> + * - the application can pass zero to clear the negotiation result;
> + * - the last negotiated result takes effect upon the ethdev start.
> + *
> + * If this API is unsupported, the application should gracefully ignore =
that.
> + *
> + * @param port_id
> + *   Port (ethdev) identifier
> + *
> + * @param[inout] features
> + *   Feature selection buffer
> + *
> + * @return
> + *   - (-EBUSY) if the port can't handle this in its current state;
> + *   - (-ENOTSUP) if the method itself is not supported by the PMD;
> + *   - (-ENODEV) if *port_id* is invalid;
> + *   - (-EINVAL) if *features* is NULL;
> + *   - (-EIO) if the device is removed;
> + *   - (0) on success
> + */
> +__rte_experimental
> +int rte_eth_rx_meta_negotiate(uint16_t port_id, uint64_t *features);

I don't think meta is the best name since we also have meta item and the wo=
rd meta can be used
in other cases.

> +
>  #include <rte_ethdev_core.h>
>=20
>  /**
> diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index
> 70f455d47d..6eb7ec0574 100644
> --- a/lib/ethdev/rte_flow.h
> +++ b/lib/ethdev/rte_flow.h
> @@ -1904,6 +1904,10 @@ enum rte_flow_action_type {
>  	 * PKT_RX_FDIR_ID mbuf flags.
>  	 *
>  	 * See struct rte_flow_action_mark.
> +	 *
> +	 * One should negotiate delivery of mark IDs beforehand.
> +	 * @see rte_eth_rx_meta_negotiate()
> +	 * @see RTE_ETH_RX_META_USER_MARK
>  	 */
>  	RTE_FLOW_ACTION_TYPE_MARK,
>=20
> @@ -1912,6 +1916,10 @@ enum rte_flow_action_type {
>  	 * sets the PKT_RX_FDIR mbuf flag.
>  	 *
>  	 * No associated configuration structure.
> +	 *
> +	 * One should negotiate flag delivery beforehand.
> +	 * @see rte_eth_rx_meta_negotiate()
> +	 * @see RTE_ETH_RX_META_USER_FLAG
>  	 */
>  	RTE_FLOW_ACTION_TYPE_FLAG,
>=20
> @@ -4223,6 +4231,10 @@ rte_flow_tunnel_match(uint16_t port_id,
>  /**
>   * Populate the current packet processing state, if exists, for the give=
n mbuf.
>   *
> + * One should negotiate the processing state information delivery
> beforehand.
> + * @see rte_eth_rx_meta_negotiate()
> + * @see RTE_ETH_RX_META_TUNNEL_ID
> + *
>   * @param port_id
>   *   Port identifier of Ethernet device.
>   * @param[in] m
> diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index
> 904bce6ea1..a8928266a9 100644
> --- a/lib/ethdev/version.map
> +++ b/lib/ethdev/version.map
> @@ -247,6 +247,9 @@ EXPERIMENTAL {
>  	rte_mtr_meter_policy_delete;
>  	rte_mtr_meter_policy_update;
>  	rte_mtr_meter_policy_validate;
> +
> +	# added in 21.11
> +	rte_eth_rx_meta_negotiate;
>  };
>=20
>  INTERNAL {
> --
> 2.20.1