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 E457742F83; Wed, 2 Aug 2023 11:38:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A4BEF41153; Wed, 2 Aug 2023 11:38:04 +0200 (CEST) Received: from mgamail.intel.com (unknown [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 63BE24021D; Wed, 2 Aug 2023 11:38:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690969083; x=1722505083; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=lXB2tQ+LfchXX/w8+mJd9X9kFJda098reGAJM6CUAYc=; b=bp236R9QuIbgs+dYeks6SgQsDY8tMvIPSuixf1OmvI7ttY+K3TKKVy6l 4k2c3wn7BnkYgR6zpUNYwNO2+uxaRdJIULQSECRPx8Ij+I4FhUlBh4fFj EmpEVqIEwqT2hKt5Ib8z5Nim0Zg3LHRND7Kz2rYIl/Bf7maT5EymhU+OJ CxmjXT4BrsHQFko5HVCwZf1aI2nhplseWYAdOF+nQDRA3WVvjDBGQF4gC 4dZ4l89h6UIu+fzU+0p1hwlL4apB1tSXc62Jv/mSuXusLvs83NuuBr/Kq ByNNCyGvak1ptf3gohLhy2TdMN0E4Wz36we5URcUyl8RDnl5SNX0DOzRl Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10789"; a="349135511" X-IronPort-AV: E=Sophos;i="6.01,248,1684825200"; d="scan'208";a="349135511" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2023 02:38:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10789"; a="706113664" X-IronPort-AV: E=Sophos;i="6.01,248,1684825200"; d="scan'208";a="706113664" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga006.jf.intel.com with ESMTP; 02 Aug 2023 02:38:01 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 2 Aug 2023 02:38:01 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 2 Aug 2023 02:38:01 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Wed, 2 Aug 2023 02:38:01 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.172) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Wed, 2 Aug 2023 02:38:00 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iorXLbxLGsTs25g36QtD/8uPSJNpUsx3ZHewbP5+JZJG0scxcoxgQa3Xt3L9HWdLlj1qodE/G4c7uO7sEYYOiAqocJgq/eKWjfvjFydAvRXzvqra7b8LPss13HUVQRE0AInZMBHjILMYo3TdWVvAdIC38PSGgo5lLGvcw6JnaRzhFH/v5q9UVGa4Qr66U3RyOuf9/gQ2vC+4o+iT8q72DoqxPLjrilj1t/w5SM5djDfLC3HCkb/RB0tbR0pTOwIx4XMeI1hSv3G/tAZ1MCVz2dVE/ZkCnXddF8F2s6uQpt0WyJyog9ZLQ7woyu8PsVIl6tq1fz5jd+M70g77y3yq1g== 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=uzeCbnzYuLrZY6mCAV2VyiULso0RBW+XFK8kCqb90cg=; b=D8TsqxCsirxFbD0WWTMahdNW4zzWgBzsgw86HnmHXnbUwotrAw2ZQkDsB4DW7su68AKc5GJaUvUQd7c6zMic1P6JGFx74ZvVL+zW9I7MObavODzRyEkoOhwpUuJsn+jVrv5aCgxxyZ7qXV75Ac0eJyjV4ogkyNY8Oo3I/OXsn9ImSWuT2UkhqcHX5JVZZteO/YDy28QuXj+RnWO2WDYPFO4Ofb/XB6Qv6uoj8pRxLPQ823t9392OHYxsyGA/HkjxZX5yJmi4zMTGs3lfGTbK3LYuozOqiRc4wupGmeEsFM/m0HZJHBxQkomJlLK+XjedaYHZdazgVQT6RlffalwQtA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM4PR11MB5994.namprd11.prod.outlook.com (2603:10b6:8:5d::20) by PH0PR11MB5784.namprd11.prod.outlook.com (2603:10b6:510:129::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.45; Wed, 2 Aug 2023 09:37:53 +0000 Received: from DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::8a49:15a2:ab69:91c3]) by DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::8a49:15a2:ab69:91c3%4]) with mapi id 15.20.6631.045; Wed, 2 Aug 2023 09:37:53 +0000 From: "Zhang, Qi Z" To: "thomas@monjalon.net" , "orika@nvidia.com" , "david.marchand@redhat.com" , "Richardson, Bruce" , "jerinj@marvell.com" , "ferruh.yigit@amd.com" CC: "techboard@dpdk.org" , "Mcnamara, John" , "Zhang, Helin" , "dev@dpdk.org" , "Dumitrescu, Cristian" Subject: RE: [PATCH] ethdev: introduce generic flow item and action Thread-Topic: [PATCH] ethdev: introduce generic flow item and action Thread-Index: AQHZxSHa5TP862ajckKHF87k4bqFPK/Wvj9A Date: Wed, 2 Aug 2023 09:37:53 +0000 Message-ID: References: <20230802173451.3151646-1-qi.z.zhang@intel.com> In-Reply-To: <20230802173451.3151646-1-qi.z.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM4PR11MB5994:EE_|PH0PR11MB5784:EE_ x-ms-office365-filtering-correlation-id: 257b33cd-b532-472a-6c4d-08db933c253c x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 48cFfluBgS+9D9pqo0xG6Zu3zr8zdWGclJlktKE+lEmYJn1mhg3M022avAsBWi8xSorG97De553bpKWFALEfMQ1xHsuasxcGyOHla44F+scJ/n6KvFicoTPyY4L5XPHVUAFQy9YhOJp7EcoHLN2557rhOFw1q8JDDBDRIjPHnCtczgpCsjliXN5lB40wB/i7yRa/RhdxeKG9WibSm2WDxcxApsBSgY7OPW2O3X0vZgkvPiafpaC7zzgbnUYNBPr1KZTi8elNxafUnuD9S4N7f9i5P9KLsShl50N3g6y6lo2Z7BZlqC0oofEnxVR3Je8UG/AQ6Gi0noyP2U+YNkLK6k41A707DGBVxfhHahGyjlZqgBC5tMfu4FnsQdmYWSXjLnCPfkVxhaO6FYh5FzZ98beKj0FOBLcNMi5ackRMXEiT7bQ252j1DmqgY1/836LmxGi40qxM7G8N7FEhTY/XkO90xITNEIG632+uZnTDo/5Qei7yyGg1jFpOBHHKtRLK/7X0PvSsRYQSR6P3wKxhetGNO1N44d6HbTM9EJcDjOCIYfxqOExwxaz6ot6y/ZYa711JyYQ+jBtn1p3eLAlTho4PWj97xaixbqIFB89V8H0Buvp18pcP7DgEXc0La6fpkdtTLMjzctRPLeTZdE8KOg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5994.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(396003)(376002)(136003)(366004)(39860400002)(346002)(451199021)(41300700001)(2906002)(82960400001)(316002)(4326008)(8676002)(8936002)(38070700005)(52536014)(5660300002)(83380400001)(66556008)(66446008)(66476007)(64756008)(66946007)(76116006)(55016003)(86362001)(38100700002)(478600001)(26005)(33656002)(186003)(110136005)(9686003)(53546011)(6506007)(7696005)(122000001)(71200400001)(107886003)(54906003)(41533002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?1hrElOb1bVlrIqQJLJFQ8iqJy7xrIIIX8i8ZwZlkc9cVc5BdTRzQHm9BSftE?= =?us-ascii?Q?LDPcUXDKqJFGrCsMJ48fm5iwpIusWBbMznvT7HUjvsGPqJ2jDoTLQ6EvcPoP?= =?us-ascii?Q?ucFlonL/NDjRtM0+3zTd+fyXI3ZQJx+MbLazIyMRHWsCk1w9d4cIqAV8K/mZ?= =?us-ascii?Q?123URylcwsI+BpAecRrn4HBpOH76ItZUF/TwaaS12Sc0neyJErfLekK4z4XF?= =?us-ascii?Q?nhHwCvgesfYkDL3WY+lZEkKbLzipc5UmMRYYXgJEA6h1XIP0X5ZBHQJBFRtH?= =?us-ascii?Q?7JSggvIdbKVieLHlyWv2n9YkotCr+RMMJutkVLy1jAG5thRzrWabWbxkHLx+?= =?us-ascii?Q?SSK/ENXCp4j5PHG4M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Xt?= =?us-ascii?Q?StMpuHlEMzjgRI5i0OfhiX9MoXu7JywFJRPb2in22go0NbR0f/yx9nsxT1QL?= =?us-ascii?Q?thSsyvi6AHhI+xjYDYx3lpDQeNE3Te9qrzzJdX9V0kLjckHOYlgd+ayI0Fit?= =?us-ascii?Q?j7iXCjxhnh+ykIAsag6yfelKMygyIWd9YH534Z0rLOTZkOrD4mppee9ZwKAP?= =?us-ascii?Q?WtuoY/Vd6RtVxOvKc6yycWcn+D7ymCNGZTSBt2tWP7ZWj57thhE+AwuCZM4k?= =?us-ascii?Q?BpqxzWQbyyzUJfdnUGtAt2WpDJ/kUBB2P9lirzgkkP0XmKxpb1vow2Msdbe8?= =?us-ascii?Q?57U3uN2Lo1rtf7Rbj/XHXLspUvsf77DKhOEz6lfB?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5994.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 257b33cd-b532-472a-6c4d-08db933c253c X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Aug 2023 09:37:53.4763 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: WmdvsmfleM66U4OSoCy0Z5bcmobFWUIFW57G1arcariqD8r8y15pOThzNeAO0Iua8bAYPPCgR4udgRNdgaCqWw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5784 X-OriginatorOrg: intel.com 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 > -----Original Message----- > From: Zhang, Qi Z > Sent: Thursday, August 3, 2023 1:35 AM > To: thomas@monjalon.net; orika@nvidia.com; david.marchand@redhat.com; > Richardson, Bruce ; jerinj@marvell.com; > ferruh.yigit@amd.com > Cc: cristian.dumiterscu@intel.com; techboard@dpdk.org; Mcnamara, John > ; Zhang, Helin ; > dev@dpdk.org; Dumitrescu, Cristian ; Zhang= , > Qi Z > Subject: [PATCH] ethdev: introduce generic flow item and action Sorry, this is supposed to be an RFC >=20 > From: Cristian Dumitrescu >=20 > For network devices that are programmable through languages such as the P= 4 > language, there are no pre-defined flow items and actions. >=20 > The format of the protocol header and metadata fields that are used to sp= ecify > the flow items that make up the flow pattern, as well as the flow actions= , are > all defined by the program, with an infinity of possible combinations, as > opposed to being selected from a finite pre-defined list. >=20 > It is virtually impossible to pre-define all the flow items and the flow = actions > that programs might ever use, as these are only limited by the set of HW > resources and the program developer's imagination. >=20 > To support the programmable network devices, we are introducing: >=20 > * A generic flow item: The flow item is expressed as an array of bytes of= a given > length, whose meaning is defined by the program loaded by the network > device. The device is still expected to accept the existing pre-defined f= low items > such as Ethernet, IPv4/IPv6 headers, etc, as long as the program currentl= y > loaded on the device is defining and using flow items with identical form= at, but > the device is not limited to the current set of pre-defined RTE_FLOW flow= items. >=20 > * A generic flow action: The flow action exact processing is defined by t= he > program loaded by the network device, with the user expected to know the = set > of program actions for the purpose of assigning actions to flows. The dev= ice is > still expected to accept the existing pre-defined flow actions such as pa= cket > drop, packet redirection to output queues, packet modifications, etc, as = long as > the program currently loaded on the device is defining and using flow act= ions > that perform identical processing, but the device is not limited to the c= urrent > set of pre-defined RTE_FLOW flow actions. >=20 > Signed-off-by: Cristian Dumitrescu > Signed-off-by: Qi Zhang > --- > lib/ethdev/rte_flow.h | 82 +++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 82 insertions(+) >=20 > diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index > 3fe57140f9..f7889d7dd0 100644 > --- a/lib/ethdev/rte_flow.h > +++ b/lib/ethdev/rte_flow.h > @@ -688,6 +688,15 @@ enum rte_flow_item_type { > * @see struct rte_flow_item_ib_bth. > */ > RTE_FLOW_ITEM_TYPE_IB_BTH, > + > + /** > + * Matches a custom protocol header or metadata field represented > + * as a byte string of a given length, whose meaning is typically > + * defined by the data plane program. > + * > + * @see struct rte_flow_item_generic. > + */ > + RTE_FLOW_ITEM_TYPE_GENERIC, > }; >=20 > /** > @@ -2311,6 +2320,32 @@ static const struct rte_flow_item_tx_queue > rte_flow_item_tx_queue_mask =3D { }; #endif >=20 > +/** > + * @warning > + * @b EXPERIMENTAL: this structure may change without prior notice > + * > + * RTE_FLOW_ITEM_TYPE_GENERIC > + * > + * Matches a custom protocol header or metadata field represented as a > +byte > + * array of a given length, whose meaning is typically defined by the > +data > + * plane program. > + * > + * The field length must be non-zero. The field value must be non-NULL, > +with the > + * value bytes specified in network byte order. > + */ > +struct rte_flow_item_generic { > + uint32_t length; /**< Field length. */ > + const uint8_t *value; /**< Field value. */ }; > + > +/** Default mask for RTE_FLOW_ITEM_TYPE_GENERIC. */ #ifndef __cplusplus > +static const struct rte_flow_item_generic rte_flow_item_generic_mask =3D= { > + .length =3D 0xffffffff, > + .value =3D NULL, > +}; > +#endif > + > /** > * Action types. > * > @@ -2989,6 +3024,14 @@ enum rte_flow_action_type { > * @see struct rte_flow_action_indirect_list > */ > RTE_FLOW_ACTION_TYPE_INDIRECT_LIST, > + > + /** > + * Custom action whose processing is typically defined by the data > plane > + * program. > + * > + * @see struct rte_flow_action_generic. > + */ > + RTE_FLOW_ACTION_TYPE_GENERIC, > }; >=20 > /** > @@ -4064,6 +4107,45 @@ struct > rte_flow_indirect_update_flow_meter_mark { > enum rte_color init_color; > }; >=20 > +/** > + * @warning > + * @b EXPERIMENTAL: this structure may change without prior notice. > + * > + * Generic action argument configuration parameters. > + * > + * The action argument field length must be non-zero. The action > +argument field > + * value must be non-NULL, with the value bytes specified in network byt= e > order. > + * > + * @see struct rte_flow_action_generic > + */ > +struct rte_flow_action_generic_argument { > + /** Argument field length. */ > + uint32_t length; > + /** Argument field value. */ > + const uint8_t *value; > +}; > + > +/** > + * @warning > + * @b EXPERIMENTAL: this structure may change without prior notice. > + * > + * RTE_FLOW_ACTION_TYPE_GENERIC > + * > + * Generic action configuration parameters. > + * > + * Each action can have zero or more arguments. > + * > + * @see RTE_FLOW_ACTION_TYPE_GENERIC > + */ > +struct rte_flow_action_generic { > + /** Action ID. */ > + uint32_t action_id; > + /** Number of action arguments. */ > + uint32_t action_args_num; > + /** Action arguments array. */ > + const struct rte_flow_action_generic_argument *action_args; }; > + > /* Mbuf dynamic field offset for metadata. */ extern int32_t > rte_flow_dynf_metadata_offs; >=20 > -- > 2.31.1