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 4A9E6A04B5; Wed, 16 Sep 2020 17:47:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 88AF21C2FA; Wed, 16 Sep 2020 17:47:04 +0200 (CEST) Received: from nat-hk.nvidia.com (nat-hk.nvidia.com [203.18.50.4]) by dpdk.org (Postfix) with ESMTP id A74321C2ED for ; Wed, 16 Sep 2020 17:47:02 +0200 (CEST) Received: from hkpgpgate101.nvidia.com (Not Verified[10.18.92.77]) by nat-hk.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Wed, 16 Sep 2020 23:47:01 +0800 Received: from HKMAIL103.nvidia.com ([10.18.16.12]) by hkpgpgate101.nvidia.com (PGP Universal service); Wed, 16 Sep 2020 08:47:01 -0700 X-PGP-Universal: processed; by hkpgpgate101.nvidia.com on Wed, 16 Sep 2020 08:47:01 -0700 Received: from HKMAIL101.nvidia.com (10.18.16.10) by HKMAIL103.nvidia.com (10.18.16.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 16 Sep 2020 15:46:56 +0000 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.106) by HKMAIL101.nvidia.com (10.18.16.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Wed, 16 Sep 2020 15:46:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YF589RFof8XDEbe0o9mL2yNnAbgvxtJ2/rCEWIyj9MJRuTp3AvBXIAytRl+/BdXaK/u93S8WUFCya+LgW4fc4De0pGhorq02qbIm9q8rvGfUZeIOEOo9gMnA/QRU7Z+QlUYbbk3d/8dvETl3QtaSr2hP8jQYd0ZWmSaHd008f3o0MfxG+W+jZNd/e6a0Uf2xEdKuZIqroqCPINC5PQP01L7U1wksG+BzQ+ObiPnuHVlyNTKdNna/jM+kQxjlEwW4cr9IoU3q+RUMw+8sh/ZCfTE6vFxvv7wDJ2dx4ECCFFqxkN6kVxizLxRHUjxfDSOhthz7sBEjOI4Hpgt5pxkDDA== 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=K//KsP0NNKIV12BbQ7w8uyzym9r9hqW1RL7X5Dqx9nk=; b=hKCwkeOIrYKZo9Gsu74Xod5SHtCWre0tPr/wWSQJDcaYLV57mkGiPeQ9l/sNIrmwqrlce1qT5nA81QuNbFDSRMAuQ7akSFCI2zX90R7KF8ntmGlEZsri/A+J9ra4lY14ymX+y3vyAiheIxwgxf8bMgUfEZSq8inrxDxekRUCeEeAIrsamdNMOduCUgQr98e2RwLagEx1CZcKry2VbIP8cQvaSaQCCjp/asPFCbtajNS6lM51dB2DFrISpyDi7k8WFV62qlP9P9Y41ldAHqcEqTt0a2I7EoHSm1/yYh6k6RQiQO4N7l0KlF5LUvSvEDXs96HNjEwqOhYMKf7vkpFzSw== 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 Received: from MN2PR12MB4286.namprd12.prod.outlook.com (2603:10b6:208:199::22) by MN2PR12MB4533.namprd12.prod.outlook.com (2603:10b6:208:266::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16; Wed, 16 Sep 2020 15:46:53 +0000 Received: from MN2PR12MB4286.namprd12.prod.outlook.com ([fe80::61fd:a36e:cf4f:2d3f]) by MN2PR12MB4286.namprd12.prod.outlook.com ([fe80::61fd:a36e:cf4f:2d3f%9]) with mapi id 15.20.3370.019; Wed, 16 Sep 2020 15:46:53 +0000 From: Ori Kam To: Andrey Vesnovaty , "dev@dpdk.org" CC: "thomas@nvidia.net" , Slava Ovsiienko , "andrey.vesnovaty@gmail.com" , Oz Shlomo , Eli Britstein , Alex Rosenbaum , Roni Bar Yanai , Ori Kam , "NBU-Contact-Thomas Monjalon" , Ferruh Yigit , Andrew Rybchenko Thread-Topic: [RFC 1/3] ethdev: add item/action for SFT Thread-Index: AQHWhug5Ujcc/i9AQka5bNHDlfkvLqlrb4gQ Date: Wed, 16 Sep 2020 15:46:53 +0000 Message-ID: References: <20200909203008.25563-1-andreyv@nvidia.com> <20200909203008.25563-2-andreyv@nvidia.com> In-Reply-To: <20200909203008.25563-2-andreyv@nvidia.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [147.236.152.129] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f9bdfa07-7b76-4784-aab0-08d85a57bc22 x-ms-traffictypediagnostic: MN2PR12MB4533: 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:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: lP6WqKZ5b4dAFmezj2ygtN5CwclIAO1eZTCySCC24sVFNJK/H6PbzE4+QhwAtJcN4gPQho9K1MKZABJuYDnp9ztLjTC2mtTri7bcErIUNy1iHHbf1i5Um6OCMvOUlI3RQkYZIhO8EuKFwcaOKZFpJaSr1y9IAO0AHNtxVIpLksf08NPhh9Uf67Gxy8PZN9P/UuaWme+QOP6FvyqBQud7reBiToS6EiSscXuz4Jv9yEmLqIgvu5QMSG9TfEZZs1wfsFZKKhyo1UQRgNvSP3wNdxY2EACSyrzH3bGlO6br1/x+Tv/TZhq57apFiCBBsM3yrjrNUE+8I2w4K/AJPRY21+YoxHO74Vd7N7epFq/DYG+ZT45MQiZHxrdNs6Z264JS x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR12MB4286.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(39860400002)(366004)(136003)(396003)(4326008)(478600001)(54906003)(8936002)(110136005)(5660300002)(52536014)(8676002)(55016002)(33656002)(9686003)(64756008)(316002)(71200400001)(86362001)(2906002)(66476007)(66946007)(66556008)(66446008)(76116006)(83380400001)(7696005)(186003)(6506007)(26005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: RKRIi/dDf523uBFmdD2EZy1540DxgZ/ZY6OTCrbf1NkKPglmBYVjVGawUcUXK2okovfuTS7Nlf15xufyei/+a9YKNCDttaaizkVFEHBUbPoL1GtP0hueVV63awu2hnrWa4pnIWIWuyn2k+89Bx+lWRqwmkuBr1hB1b+8OKfshQTiZ1mt1yJhHh3HTL20YMVTjjx3GZ7/0TpXE6TsXBw3SKvUhvat7WapgLspUls37TwbZdF9A2Hfhwo9nJLAfNVIW0FnyAwSrSMqjoPzMpCtILSM5S2x9/md4eRnHJiaxcKtkg+CZjuW5P7yHUI7hJBd2lAmYkoZ+0g1Ex7LKPL2VzszNZPf9nal99o4pph88SsAC2wl+w2CAJLn4HyZKoTlya02ZQ9N3XR4g+iJIOpDu6gcmNDfAg4fgcadeyiosPIayOqryOX6WGzYmOlOZVLy3Csmzehna+7XvfcpOYLVqJcYdOop/EZBUE2+VYyCNb4T1UYyp/wpJj+0/prRNueAic+PFN81K+V8D0kIC6P71T489i2txJiqvFc+LFc53gUQhTG1JE/Y97uptXWGMPjpOZP6mRKAQmqit+sd6tmvh2DM1tJiPoBjsOgpsxMDsrhe+Otw/dCPJu2Dx2sMRTxZqG9sGF9kxmqQWjT9ZRhTXw== 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: MN2PR12MB4286.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f9bdfa07-7b76-4784-aab0-08d85a57bc22 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Sep 2020 15:46:53.5320 (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: 2Y6YJW86U6wr7B9+uXciHYDcc9fSWygjduHqoWj2d9FvMBKvvt0jLvlbTsJLSkam+lMe6ipNkhpbWuthRolQIQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4533 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1600271221; bh=K//KsP0NNKIV12BbQ7w8uyzym9r9hqW1RL7X5Dqx9nk=; h=X-PGP-Universal:ARC-Seal:ARC-Message-Signature: ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic: Thread-Index:Date:Message-ID:References:In-Reply-To: Accept-Language:Content-Language:X-MS-Has-Attach: X-MS-TNEF-Correlator:authentication-results:x-originating-ip: x-ms-publictraffictype:x-ms-office365-filtering-correlation-id: x-ms-traffictypediagnostic:x-ld-processed: x-ms-exchange-transport-forked:x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers:x-ms-exchange-senderadcheck: x-microsoft-antispam:x-microsoft-antispam-message-info: x-forefront-antispam-report:x-ms-exchange-antispam-messagedata: Content-Type:Content-Transfer-Encoding:MIME-Version: X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-AuthSource: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-originalarrivaltime: X-MS-Exchange-CrossTenant-fromentityheader: X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype: X-MS-Exchange-CrossTenant-userprincipalname: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg; b=BPQWx7NSnHa6+C+7W9o/dniiCqyq6XKoZVmuTQ1obMGO86IJ0Av+RjVVHk8IPl7cv 49HhIEPzHKsPOiyRNUhJBLgBJCWSEmoiwNHXHy5s0QRC2yuzsh2YJ7e7YY0SSHf4RW kDIgjqpF1GP3ZB/fF+8PTzI2uXDUNginbZkiI/zpLLJEzlGgeT3564lpJcrqNHKqd0 pd2fFzzisrLKV4KEwXwuQ5SUnNCf5IevnpZKN3oHok82hpmMsRd7gbkx5MiqBgwxDg sgZm4b88hBTX+6kpwmjMHM5JOFYBm3LYHET5zDdngoRTBCB0lZt9YKH1xnKcbKTxln ksoj0EwBSKPEA== Subject: Re: [dpdk-dev] [RFC 1/3] ethdev: add item/action for SFT 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 Andrey, PSB > -----Original Message----- > From: Andrey Vesnovaty > Sent: Wednesday, September 9, 2020 11:30 PM >=20 > Attach SFT flow context to packet with SFT action. > Match on SFT flow context (attached to packet), > with SFT item. >=20 > Signed-off-by: Andrey Vesnovaty > --- > lib/librte_ethdev/rte_flow.h | 84 ++++++++++++++++++++++++++++++++++++ > 1 file changed, 84 insertions(+) >=20 > diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h > index da8bfa5489..24390e6ab4 100644 > --- a/lib/librte_ethdev/rte_flow.h > +++ b/lib/librte_ethdev/rte_flow.h > @@ -537,6 +537,12 @@ enum rte_flow_item_type { > */ > RTE_FLOW_ITEM_TYPE_ECPRI, >=20 > + /** You are missing the Meta, tag not relevant for RFC but please notice for th= e patch. > + * Matches SFT context (see fields of struct rte_flow_item_sft). > + * > + * See struct rte_flow_item_sft. > + */ > + RTE_FLOW_ITEM_TYPE_SFT, > }; >=20 > /** > @@ -1579,6 +1585,54 @@ static const struct rte_flow_item_ecpri > rte_flow_item_ecpri_mask =3D { > }; > #endif >=20 > +/** > + * @warning > + * @b EXPERIMENTAL: this structure may change without prior notice > + * > + * RTE_FLOW_ITEM_TYPE_SFT > + * > + * Matches context of flow in SFT table. > + * > + * 5-tuple: src/dest IP + src/dest port + IP protocol. > + * zone: application defined value cupled with 5-tuple to identify flow, > + * example - VxLAN, VLAN. > + * SFT: Statfull flow table > + * SFT in scope of ethernet device (port) is HW offloaded lookup table > + * where key is zone + 5-tuple & value is statefull flow context. > + * Contents of the SFT maintained by SFT PMD (see SFT PMD API in rte_sft= ). > + * > + * The structure describes SFT flow context. > + * All the fields of the structure, except @p fid, should be considered = as > + * user defined. > + * The @p fid assigned by RTE SFT & used as unique flow identifier. > + * SFT context attached to packet by action ``SFT`` (see > RTE_FLOW_ACTION_SFT). > + * > + * SFT default context defined as context attached to packet when there = is no > + * entry for the flow in SFT. The @p state has application reserved valu= e > + * meaning that SFT context for the packet undefined since entry wasn't = found > + * in SFT. If state 'undefined' then @p zone should be valid othervice @= p fid > + * should be valid. > + * > + * Context considered virtual since the method of storing this info on p= acket > + * is PMD/implementation specific & may involve mapping methods if there= is > + * 'not enough bits' to store entire contents of struct rte_flow_item_sf= t. > + * > + * Maximal value/size of each field depends on HW capabilities and > considered > + * as implementation specific. > + */ > +struct rte_flow_item_sft { > + union { > + uint32_t fid; /**< SFT flow identifier. */ > + uint32_t zone; /**< Zone assigned to flow. */ > + }; > + uint8_t state; /**< User defined flow state. */ > + uint8_t fid_valid:1; /**< fid field validity bit. */ > + uint8_t zone_valid:1; /**< zone fieald validity bit. */ > + uint8_t state_valid:1; /**< state fieald validity bit. */ > + uint8_t user_data_size; /**< user_data buffer size. */ > + uint8_t *user_data; /**< Arbitrary user data. */ > +}; > + This object is only used to match and not set so why do we need the union? I understand that later when reporting to the SFT= in the application layer sometimes you will get zone while other time you will get fid. >From rte flow you are matching on given object which is 32 bit. What are the matchable fields? (fid / zone / user_data / fid_valid ... ) Do you think that some of the times the match will be on he fid other on th= e zone? If so they should not be union. I think zone is the responsibility of the application to save and to match.= So I don't see why it is needed here. > /** > * Matching pattern item definition. > * > @@ -2132,6 +2186,15 @@ enum rte_flow_action_type { > * see enum RTE_ETH_EVENT_FLOW_AGED > */ > RTE_FLOW_ACTION_TYPE_AGE, > + > + /** > + * RTE_FLOW_ACTION_TYPE_SFT > + * > + * Set SFT context and redirect to continue processing. > + * > + * See struct rte_flow_action_sft. > + */ > + RTE_FLOW_ACTION_TYPE_SFT, > }; >=20 > /** > @@ -2721,6 +2784,27 @@ rte_flow_dynf_metadata_set(struct rte_mbuf *m, > uint32_t v) > *RTE_FLOW_DYNF_METADATA(m) =3D v; > } >=20 > +/** > + * @warning > + * @b EXPERIMENTAL: this structure may change without prior notice > + * > + * RTE_FLOW_ACTION_TYPE_SFT > + * > + * Attaches an SFT context (see struct rte_flow_item_sft) to packet. > + * > + * Performs lookup by *zone* and 5-tuple in SFT; if entry found the rela= ted SFT > + * context will be attached othervise default SFT context attached (see > + * 'SFT default context' in struct rte_flow_item_sft description). > + * Adding action of type ``SFT`` to the list of rule actions may impose > + * limitations on other rule actions added to the list, depending on spe= cific > + * PMD implementation. > + * > + * For 5-tuple, zone & SFT definitions see `struct rte_flow_item_sft`. > + */ > +struct rte_flow_action_sft { > + uint32_t zone; /**< Zone for lookup in SFT */ > +}; > + > /* > * Definition of a single action. > * > -- > 2.26.2 Thanks, Ori