From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id D404BC38142 for ; Mon, 23 Jan 2023 22:03:09 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A136240150; Mon, 23 Jan 2023 23:03:08 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2087.outbound.protection.outlook.com [40.107.94.87]) by mails.dpdk.org (Postfix) with ESMTP id 93DF3400EF for ; Mon, 23 Jan 2023 23:03:07 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KNgVmXVqR78Ysg4bt6WbYbTFplAOLyzyRpX5T+DQZsKzRURMu93E23CXGjAKDwTdq7ix8Dm3tEpaepj7Mkk5OocAyRr/3Y7l/+x2+5siE1q8nkWGxuFWGNVBs7sNZ4T8zlG3t1gkvCDD1J8CwL2dCaCMC6KAgLX2A8FWsu5Fekqib6oMrtnqiH9feDVcS11dyNcc+tp8krNYoJlzkUeiqzp92ueUcNmr4/K9jDma4E26OaTaiYRnGn9mc6EaGecQBNFFK9Qp6te+/Iibc59dLSCZyOqqheXvpb9Mo6JketBPySBf+dFQVGFtjIyJOa34nhP8WhtO0UrBihH4Dm+Lsg== 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=RxtEnMajGzvLEO4FJlKvT1hbW8jwT78zXYg/9BH1SQY=; b=BCK9CNxfjF/UG+S9BFIWpo+hvLK8fufWlbFkFsOyoWiS36jfqYQtEhhAvXm/fbXe2mx0iVTididVmzpd7q/sbqK+KBZTcViq06Iamz0ijIwDbKTFPa3/HhbX9JRSfa05EE9DAcsvObqjm69TplUZpmW7UeYrORTmaRxNQTAO/9DkyWnr7uhFxDVprD1MxAk6sFMYBiFaleCymZzKokXoq9RRm6xeUvryjy5QH2hWcbpjOX2vK9G4GqUG0efHal7m1+K9u9JJUkPBrb2g3WQ6ixwnrWIwFNbccGStyLTf/BjaKe2MK5dMVGBSFqcrZXBSeH8uKECmDuey7gZtsIHupQ== 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=RxtEnMajGzvLEO4FJlKvT1hbW8jwT78zXYg/9BH1SQY=; b=NhGdyfTrRP0H3Vh94o6miXBepQ9cG/kRGaryIXd3kEIzH+O1+W0WatLQuyMX2Ui/fgPEtO0I609bcYLLJTKwxbYdy4qe2HBcEgMVRbPAgncivmIRi8ZbbVYTLOQMSWREevTtBb8SHSHu1vpeKE2GwzznDBp8Aw25X0lgjUFaUMthm02rrkb78oCfkA5okj40zL/AuHmRDGfUya8DdEFFq9Hp+87aNNDK5aVupn71T3SMHY1Es2q6ZW9Y+XaEdNrUOnYmcjuCop3C69NMui6ErulurGhYigfzBee8BVfCE/66EnWRaoS+OSngUNwynavJkC3bZiC1Rsx+v/YWfI+8+A== Received: from DM5PR12MB2405.namprd12.prod.outlook.com (2603:10b6:4:b2::20) by PH8PR12MB7277.namprd12.prod.outlook.com (2603:10b6:510:223::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.33; Mon, 23 Jan 2023 22:03:04 +0000 Received: from DM5PR12MB2405.namprd12.prod.outlook.com ([fe80::9fbd:3868:3fd7:a156]) by DM5PR12MB2405.namprd12.prod.outlook.com ([fe80::9fbd:3868:3fd7:a156%7]) with mapi id 15.20.6002.028; Mon, 23 Jan 2023 22:02:57 +0000 From: Alexander Kozyrev To: "NBU-Contact-Thomas Monjalon (EXTERNAL)" CC: "dev@dpdk.org" , "ferruh.yigit@amd.com" , "andrew.rybchenko@oktetlabs.ru" , Ori Kam Subject: RE: [RFC] ethdev: add template table insertion and matching types Thread-Topic: [RFC] ethdev: add template table insertion and matching types Thread-Index: AQHZD2LKWzK3aJ4aeU6F4eD3apQhKa6kFSSAgAQQ6UCAAwL8AIABoicw Date: Mon, 23 Jan 2023 22:02:57 +0000 Message-ID: References: <20221214022110.393410-1-akozyrev@nvidia.com> <16865748.Ash8RoxBsO@thomas> <6424586.17fYzF0512@thomas> In-Reply-To: <6424586.17fYzF0512@thomas> 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=nvidia.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM5PR12MB2405:EE_|PH8PR12MB7277:EE_ x-ms-office365-filtering-correlation-id: 41a4651b-b112-4497-f242-08dafd8d963f x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1apSxqEE5q1j+3CpOw4tKmF9QKNRh3teU1e1ZJ+R54958F+AhVo/rcXrm+EsZokrKNxgHYoFkt7EOZGz5eU5FPdErehfcZPc+g1xKg0EZUOEG0m8fKRZuz2qF3gtdfeQHJRRuMus5mUwpQo+t9/5EK+VuEK8Ic5nJDRgZMDJFx2OIujvXVe3C1qIONn0iOHJRXy98xyVCxZLl1vHvzfBgoh8iaQfvnhhObOyjK8Fc64nklCSyUESlgpCah4/B0ZO2w7nsnl2gxAHzU7ooxIUTAoEEqisPTSd3ScrGpdMXUhZv/j2Hk/TdCymU/O+idywtnlHfTQlkcxn1rWX2nwQwW2VtWi/UkHzrS9t7lG2JCpfGvY0IgrZqsgI2bMfUc+6UlVEjPKGsd3dsa9Eew5f65hNr6xRERMh8wOBnmt2KLwwvhj0D3YPAo39NSJWudH6wWbpMJpqsCQMHulRF/r4oz2X0D8LDF9utAwInk8HjcNU9LuFiHpwYJd/GhIqiYUF1ONaqHL0zbLZ8rZNOrztU3L6Hyyb/aaFuuz3h9IxHWtO9GL93kDxoTOxDqR1giEMO8S4Jg+Td6NR7c3HR9IhynPWJvNKv1vnffja0T0lhMF5hyayokvv7nZlbELOi+E9NVKTf/Mr3d431ppg/UBCskTzQmEjnxVB+bryXEKkve8THBoLImxI/pCbdPFFpchNFkZXBYeq/xvvY48RCAqqrg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR12MB2405.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(346002)(136003)(376002)(39860400002)(396003)(366004)(451199015)(41300700001)(107886003)(478600001)(4326008)(6916009)(66946007)(8936002)(26005)(316002)(66476007)(66446008)(186003)(9686003)(52536014)(33656002)(66556008)(64756008)(71200400001)(7696005)(6506007)(5660300002)(8676002)(54906003)(55016003)(76116006)(86362001)(122000001)(38100700002)(38070700005)(2906002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?H7OWQp0TQQI00+Qirjka7Q7m37Us7qIFU/k55hCdp/MET5iCsex5wA3n+vO2?= =?us-ascii?Q?9WQDjeIdlHKGqyXCt3qHjCyuuJ5yUGYwCPHWA1M0O06gen/hLz9de5Z+m/mb?= =?us-ascii?Q?jD5WQSgMckLVQsOF/uN1Pw6IsV+HSncplu/VzVq7SnlZUxXaB5xVFbkf6T0l?= =?us-ascii?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+o6wpuROt6l?= =?us-ascii?Q?2oN3lQbwUdW1PLQpYgqduZbZI76chEJ9NSmn+rEhiNYj0+QbIAnfGdr+0SS/?= =?us-ascii?Q?diwSrw/XUXQW6ea4XQBkijkucy8y47A/hnGV8sSm6RDMulP31OmDHieLpZKm?= =?us-ascii?Q?8LAsn4LnLLQXD3PDV7wmE8Wc5e9KMMCN12vHEO5ZLua2QgX+o3xes3AbVA3F?= =?us-ascii?Q?/erdoIGxxFvu8KHEmmiqTQ+6bGMS/l3Y7oGakTt9kCnBm6YDSbSfZeXS77uU?= =?us-ascii?Q?BF+LJMcXFVljYWCjSQFOb4MtFhRQUOplAKJ3X9lZkoS2WoUpBenrn+MoqffX?= =?us-ascii?Q?IHVRiN8Sp3qR7qdI/G0bqSQtfNQB59/fbmFLMDOA4WSo2wAeTq/oGndgnT6a?= =?us-ascii?Q?8NT74XE42kk+jDuFOTLvvtVDtF4jRpdbToV62PHLOU+/7OWmgLLwvcD34amH?= =?us-ascii?Q?dYr9S4FJsADp+QuGbBMfsv0dnm90M2BzthmtURMAQBMof7q+5LJ4l5+SdNST?= =?us-ascii?Q?pH1miJzWvtH4auV0VJthyfFtXdZGy90nvcFWzFxR?= 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: DM5PR12MB2405.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 41a4651b-b112-4497-f242-08dafd8d963f X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jan 2023 22:02:57.9023 (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: i9sZQxrBe2biyx8/LIf7NPb8GKYc4vcG2KVt+gKWJtgftcI6BM6KSYHtKZXCYx1eEAmAs3EONQn8dxKFZD9fWA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7277 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 > 21/01/2023 00:06, Alexander Kozyrev: > > > 14/12/2022 03:21, Alexander Kozyrev: > > > > Bring more flexibility and control over both flow rule insertion > > > > and packet matching mechanisms. Introduce 2 new flow table types: > > > > > > > > 1. Allow a user to specify the insertion type used in template tabl= es. > > > > The insertion type is responsible for choosing the appropriate key > > > > value used to map inserted flow rules into a template table. > > > > > > > > Flow rules can be inserted by calculating the hash value for > > > > the pattern or inserted by index via the new create_by_index() API. > > > > The idea of the index-based insertion is to avoid additional matche= s > > > > and simply execute predefined actions after jumping to the index. > > > > > > I don't understand the idea. > > > Why is it avoiding additional matches? > > > > If you jump directly to an index in a table, you don't need to match > anything. > > For the regular pattern-based table you must calculate the hash and mat= ch > on it. >=20 > I don't get it. I think it would be simpler with an example. This is how the regular pattern-based table works: you calculate hash on 5-tuple, go to the table entry with the corresponding= hash, check if there is a collision and search for the proper entry if so, execut= e actions. Index-based table: take an index value from a specified field, go to this index, and execute a= ctions. > > > > The insertion to an already existing index is undefined and > > > > > > Why is it undefined? > > > > The behavior is up to a PMD to decide. It is free to replace the rule o= r throw > an error. >=20 > An undefined behavior of an API makes applications not portable. > Why not deciding of a behavior? You are not sure what is best? We don't want to restrict a PMD behavior here.=20 Personally, I would prefer throwing an error in this case. Do you think returning EEXIST is better?