From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0001FA0C47; Tue, 5 Oct 2021 14:03:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6458941339; Tue, 5 Oct 2021 14:03:18 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam07on2049.outbound.protection.outlook.com [40.107.95.49]) by mails.dpdk.org (Postfix) with ESMTP id 7110A4132F for ; Tue, 5 Oct 2021 14:03:17 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F6/BWjERdWiKtZjLI4uCtqwFnJ8GJ6I9/six7HS7XMKjk6zZnzuDl3cgalcSLEbzEm7nNskYAtkNoCG6j1mgdTdRqYxQW22KHGxCirIxpH2IfjUwIeasJFja9FAlIkWCJT+nEAU9CBftsScp8ZR5RXai7/iBibnJO++UKY6gVatfau42aHFAlpoEXzqVAg5n93TzyERXVLCsHFzlhfRl9uSnYfp83yPMPimrO30e0gqQMbTEfdz0vkpiDZ+9bUzZ5N33qgRtFyQl20FlUl1uoFVS+IxtQQ10Jxz0GavzLJQPd79TxM4GKepJhF21rvq8S4+S7tLtxbQVeajIs7AFPQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bM7FLmoDFP3krUDu+Lh6b42EbEuFaoC7K7wmQCylU8Q=; b=C/vj4JiLPmJDGKd4k97WM18DtpFJxEhZE3gkvaeYq610r7EmBFwEEC9pX+iUshv9Dmsw0Yr00EuG1aX8x6KBhmSLxeSX1Y3YsJSEd7T1fpuXZb9CUgFBuq/hN0EYSz89VzPud8UwDgrz5RgCHuuzssvuB/mdZZsvsAOeTO90hYeII09K7v17KBPjlGqRJJTg8aTN2edFuEaoNFECSaM5TdPGX4T5i7ChPQRWn8CGfcXkn8wD9vtLhVpqLIu8hf+i2MDU7gxToh+Oe4kpVXJxOJ8RrPDwf1FI5IgWK8YCfSU4nIMUwp79SRCFnFVVG8oUQV+8Dm5y5sDlF+1EOJTvGA== 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=bM7FLmoDFP3krUDu+Lh6b42EbEuFaoC7K7wmQCylU8Q=; b=XUGu0NfIpOn6AnhO5VkBm5zn5yFqkgaGYizeJNdsjGy//N1CM6x5MP5nqDevR8s4Izq1YqrZ760jiCLe/erKVx73C4NsgQZvC2uYh+r81+JeM9VTaJEfkTL7E5RWEupQWQRBV15uXlW3mvOaYx5fydKIZhdzPD6mnCEXPeWwps1tIGt2snmA3VDlZkYSOd5UD6ndFOaIi+5WJqZ5SR1fXJWE0zI8155AkpTzHTOkOmxPxA3dImBbbqHiNPTlQubdTyGJS92LAdtayJVE9NywGz5eByv+RRHiz4OmGvts6BcsTfub7oqZeA6qoS8OoUuCVjECrsm5VBrpPyeHwyxJAw== Received: from DM8PR12MB5400.namprd12.prod.outlook.com (2603:10b6:8:3b::12) by DM4PR12MB5168.namprd12.prod.outlook.com (2603:10b6:5:397::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.15; Tue, 5 Oct 2021 12:03:16 +0000 Received: from DM8PR12MB5400.namprd12.prod.outlook.com ([fe80::d03d:1f75:ca20:6a32]) by DM8PR12MB5400.namprd12.prod.outlook.com ([fe80::d03d:1f75:ca20:6a32%5]) with mapi id 15.20.4566.022; Tue, 5 Oct 2021 12:03:16 +0000 From: Ori Kam To: Ivan Malov , "dev@dpdk.org" CC: Ray Kinsella , Jerin Jacob , NBU-Contact-Thomas Monjalon , Ajit Khaparde , Andrew Rybchenko , Andy Moreton , Wisam Monther , Xiaoyun Li , Ferruh Yigit Thread-Topic: [PATCH v4 1/5] ethdev: negotiate delivery of packet metadata from HW to PMD Thread-Index: AQHXuXqbY+JEF3zJR0KMLmzW3zOz36vES3hA Date: Tue, 5 Oct 2021 12:03:15 +0000 Message-ID: References: <20210923112012.14595-1-ivan.malov@oktetlabs.ru> <20211004235007.12293-1-ivan.malov@oktetlabs.ru> <20211004235007.12293-2-ivan.malov@oktetlabs.ru> In-Reply-To: <20211004235007.12293-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: 3135e8dd-03f8-4f3b-2248-08d987f81d30 x-ms-traffictypediagnostic: DM4PR12MB5168: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: K6UnM3cm67xpkMClJsh+ueyabV0D9dtfLNRRNzsb0zmT4Inv/zW3yV8xVMuAH6MqPHHwpBKYHRVLDg2I9rtSItSFFp07QHijVesd2owV3Iqt/TnuX9dBkp4KI/wegABn/7zaZLEtzj7rn9A30D3jE2jHNuV+cZqk9w8vOz4oA7KaTH7KOmEiJ6v5Qd8ZC0rCzw5sINFQWCLSf7MQJ7kWjqp3VjpSn8nJElknj6BTuqXrbmcxOzjpiO+evPda8+KuStjVGU+K22UrvtpwmXf/R/hyB2zCf9mUVLvSM42aeqSngvQev3nh+CSryU3W6Oh24jOLV381Zk0QMNuxAdxxpuGxwPiS5eZpWPBv6C3e59ZuC5OuTLijyYAtImhPaNSys/uGr/VfTbQAobTZ9VxbMarklo2YtEg3L2fXhPkJBvzCkR/6APOdObav+iWFhC5+sfRhLNqWQM1hPURp5ZQRdHKzwZH/1f1mrCxL8xuNguBGJAUQ7y3eZEN+r5/9c3vvH+2AhOqc2CwRbb0Z7MQmVe1HIUzlMfEfHkAyutCkYpfOXTB761LOG9S0NV6aQxT7q001NNMoR8L3z7xGuS/P0CIrHPQwpSmMtZsupn7M4+P0S0JBR29mCktw34XDzrv7pm44BDpr1KUlq+53O+UeOeM/nHJ1/mraTr1vFPRhEvtiotBNnzNL4Hfoj4TK/tlxr8AIGwZ2drzmANCOM6ICFQ== 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)(76116006)(508600001)(2906002)(55016002)(66476007)(53546011)(66556008)(64756008)(66946007)(52536014)(71200400001)(9686003)(122000001)(33656002)(66446008)(6506007)(38100700002)(5660300002)(186003)(86362001)(8676002)(7696005)(7416002)(38070700005)(83380400001)(4326008)(316002)(54906003)(110136005)(8936002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?6n1Y426UzVrlAltsNAhVNYd9t4MEXY9uQ02cHFD3ZBvkH0EQ1a3Js9x/I0wM?= =?us-ascii?Q?cCjjrQxDtrQPtDk7+E2Y3KrFUA+8pOWGbZsZiGyOUmWCyGMGkCIBRryJPrYh?= =?us-ascii?Q?DKaKKLjt5Mr0fXZm00JI8gnIfP8qX8H3j/QeSCffIz0gXbIDjBGCejfqWaUB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omqreR2PS3tNEwMGz?= =?us-ascii?Q?/bMavsJJ9jz1T8wj6uKeT7tFc1xPKHbJWrY9vzXdnHZCUx8oIJUOh9N8NuL8?= =?us-ascii?Q?QHCzpC1a1SHxWALlKwMNE+Bfkl+QStaRkpSiHK9PvRW5MNpbeYY0h/58CYSv?= =?us-ascii?Q?ThPUkeKZHrMku0eSkOpsUpeHGOH9+m9L5mDDhv0w/0rmHrPNQ6TG1V2hc8ew?= =?us-ascii?Q?8wmp6YFIf6ClsfU7E6mkTskddbfkn6ZP/3BNiHcBeGMWWmfvKw289Ilx3vT5?= =?us-ascii?Q?1rL6Iv+EmP1z4UNHldH8q4aGve0nhfzL0ky8c0k16oT3kLx1jO+B0CFjGo6+?= =?us-ascii?Q?WwkjM9hLjv+2NcWW7w48mm8J3H1F?= 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: 3135e8dd-03f8-4f3b-2248-08d987f81d30 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Oct 2021 12:03:15.9953 (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: EyopvWgX8+pqoKuqlHFeWqfuj92JZrB5OLYeGVfUnCAFWRq3wSRmRxy2uhRFPgNjylEcOk+6JE4sgoAhovy4Jw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5168 Subject: Re: [dpdk-dev] [PATCH v4 1/5] ethdev: negotiate delivery of packet metadata from HW to PMD X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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 Ivan, Just a nit below. > -----Original Message----- > From: Ivan Malov > Sent: Tuesday, October 5, 2021 2:50 AM > Subject: [PATCH v4 1/5] ethdev: negotiate delivery of packet metadata fro= m > HW to PMD >=20 > Provide an API to let the application control the NIC's ability to delive= r specific > kinds of per-packet metadata to the PMD. >=20 > Checks for the NIC's ability to set these kinds of metadata in the first = place > (support for the flow actions) belong in flow API responsibility domain (= flow > validate mechanism). > This topic is out of scope of the new API in question. >=20 > The PMD's ability to deliver received metadata to the user by virtue of m= buf > fields should be covered by mbuf library. > It is also out of scope of the new API in question. >=20 +1 very clear. > Signed-off-by: Ivan Malov > Reviewed-by: Andrew Rybchenko > Reviewed-by: Andy Moreton > Acked-by: Ray Kinsella > Acked-by: Jerin Jacob > --- [Snip] > --- a/lib/ethdev/rte_ethdev.h > +++ b/lib/ethdev/rte_ethdev.h > @@ -4902,6 +4902,59 @@ __rte_experimental int > rte_eth_representor_info_get(uint16_t port_id, > struct rte_eth_representor_info *info); >=20 > +/** The NIC is able to deliver flag (if set) with packets to the PMD. > +*/ #define RTE_ETH_RX_METADATA_USER_FLAG (UINT64_C(1) << 0) > + > +/** The NIC is able to deliver mark ID with packets to the PMD. */ > +#define RTE_ETH_RX_METADATA_USER_MARK (UINT64_C(1) << 1) > + > +/** The NIC is able to deliver tunnel ID with packets to the PMD. */ > +#define RTE_ETH_RX_METADATA_TUNNEL_ID (UINT64_C(1) << 2) > + > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice > + * > + * Negotiate the NIC's ability to deliver specific kinds of metadata to = the PMD. > + * > + * 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. Not upon ethdev configure? > + * > + * @note > + * The PMD is supposed to first consider enabling the requested featur= e set > + * in its entirety. Only if it fails to do so, does it have the right = to > + * respond with a smaller set of the originally requested features. > + * > + * @note > + * Return code (-ENOTSUP) does not necessarily mean that the requested > + * features are unsupported. In this case, the application should just > + * assume that these features can be used without prior negotiations. > + * > + * @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_metadata_negotiate(uint16_t port_id, uint64_t > +*features); > + > #include >=20 > /** > diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index > 7b1ed7f110..75656ff9f8 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 mark delivery from the NIC to the PMD. > + * @see rte_eth_rx_metadata_negotiate() > + * @see RTE_ETH_RX_METADATA_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 from the NIC to the PMD. > + * @see rte_eth_rx_metadata_negotiate() > + * @see RTE_ETH_RX_METADATA_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 tunnel metadata delivery from the NIC to the HW. > + * @see rte_eth_rx_metadata_negotiate() > + * @see RTE_ETH_RX_METADATA_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..2e638c680e 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_metadata_negotiate; > }; >=20 > INTERNAL { > -- > 2.20.1 Best, Ori