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 2222BA0C47; Wed, 3 Nov 2021 22:04:32 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AB60540E0F; Wed, 3 Nov 2021 22:04:31 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 6826B40689 for ; Wed, 3 Nov 2021 22:04:29 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10157"; a="231440522" X-IronPort-AV: E=Sophos;i="5.87,206,1631602800"; d="scan'208";a="231440522" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2021 14:04:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,206,1631602800"; d="scan'208";a="578340525" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by FMSMGA003.fm.intel.com with ESMTP; 03 Nov 2021 14:04:27 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 3 Nov 2021 14:04:27 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Wed, 3 Nov 2021 14:04:27 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.173) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Wed, 3 Nov 2021 14:04:25 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AOydDfPHLWyF+32yHv65aMu3L0hbIgVq2fwYn1ofGeLXK5i2KhjBg30c8ECwwopMGb7JHlNLn5FBsSJQbzmk3yHLs9uvSTyHnsPPAPACBKjfdBTD/3/9ywKaZxbcQDFwXHvl3YPfK2cJFFJE9lC1QWAlLX1L78aNyiOn4d7Bwif5sPswOwBtm9NwqtxGIniApEceVMz3uhVRvj7hfEjCScLhv6iylFcHQebSR6gy7sS9oclT+042d7GOpVJHZVmutzn/ypneEqoSTeFpKsIbYya+4OBFJuF0WP1l24+gLx/k9Vs7a1FByAQn1uyl/YoSYGwdkyHrCPwSlkebsMrSrw== 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=OOx0zoOPOjyX2hXhcHIzi8wOj4G4jJh6zQRy42KwjKw=; b=h5XTQYO0zy10T1zmV7GqUP9i1eZsHCvsH7/aqg1RODzMXl/P8KzLCJ0YHjhQkz4QMSP/oP9sAnmWVABtGhvi9kYmG/+zs1O8y4e01OI1yxL+QYAkRvuTMZAUNxBKPJnMO+3vhaYnW9C07k9y6VqX8RU5moxvBS05+vyAut/kEAZyaUx47lVhew1ZQbEJzTSV9MkA/DPKzutoIfN501aUEXGalEER6twVC0w7IE+8mwIs8FXwzzEWqVUKORKiQIfppYiu1Md4kusQsJwAi7bQDuJNr3pbLUr4RYIHy7NQZjEwscXQZZAkYNfNs1fdWVnJ5PpqYcMJu3QTJY8kdM2mgw== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OOx0zoOPOjyX2hXhcHIzi8wOj4G4jJh6zQRy42KwjKw=; b=iA16UpPWNd6YXg/mXSnAovXObS2ghKzvco/OTndgYoSxoZ1XAZoOGVVCN5dhcvDvbQtLvEggaxH+oS19eqnMXOiPRs7q+ZEvWPfs2KYLsFwNI9LaVRGaRRunkVp+Ng4ctJC/naBVdPomaCm/M45cKuNbapW05D5aTfAPbp7lwUQ= Authentication-Results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB4966.namprd11.prod.outlook.com (2603:10b6:510:42::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Wed, 3 Nov 2021 21:04:24 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c%7]) with mapi id 15.20.4669.011; Wed, 3 Nov 2021 21:04:24 +0000 Message-ID: <5c9f54cc-8d20-a131-4376-631be940aba3@intel.com> Date: Wed, 3 Nov 2021 21:04:17 +0000 Content-Language: en-US To: Gregory Etelson , Ori Kam CC: , , Viacheslav Ovsiienko , Thomas Monjalon , "Andrew Rybchenko" , References: <20211026090554.9128-1-getelson@nvidia.com> From: Ferruh Yigit X-User: ferruhy In-Reply-To: <20211026090554.9128-1-getelson@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P123CA0054.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1::18) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 Received: from [192.168.0.206] (37.228.236.146) by LO2P123CA0054.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Wed, 3 Nov 2021 21:04:22 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f7f048d3-9c28-411f-f6d2-08d99f0d839e X-MS-TrafficTypeDiagnostic: PH0PR11MB4966: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3173; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 31Mg4lS1j+85d7iV4P/rV3COMtsBIowiKCCa7v9cLEpjst02aQbcR3g+MBUGfppHscVHRh1/kkvUpI8Az6Z0dAatv1iQTWpUQOjxIlLx3QyWrxDepzEVAvjzBytPT7WEMXPUNMaI4+Y7qYWV4DomZ8kMFjYZZlvtPSgAndIJdaJ5mFYBzR0Ju5FQ8W7CKrrirqBf7lVjrEb0ZTNdWRmqgUOqbNEYUczWlAKhctDgWdkxodrI7he4fhjYtAkDmzu9x+vcTLA8eAb/X0/DFS0qU/1n1JaO7kOSYjRKcWrECGrLP+eZpTQ2++1uGc0NnPjAq0q1m0zg5rmiA1Ug6jHz7LZOlMZTwiVjg/lYIZf8grhOZc3fr7bhTrDtT57Xhr5MJ5CoGQbfBTY20g0sKWB6sa8hBOrYNnFnbc3cR4GL0AoZSS4TMiu5+jMY8583qFOwFD6702fXx+fdyOlnGzZWbC6AXQuYPzszh3Xg+5oj1Lzpnpl4KqaaEhlOx14ADgDgFHngS3stckPq4/OF74bIT9hi5Dzf2AAlkid7qGpwZW0yMPc2/eUP7OqwMugVpv3iHgBwr/aP3Jv2vcGjA/kTcboWDiBOGOmXiTXCgFiw2xr4eRQGwMKp5KaM3I8uiLi/y8hDnQdX3PP8F8I9+AZZbWdQYdsmUS1BOWsulJyOUncI+hKyes6EUhw+e3vqAYFz+Q0TLeUspwbnFQCSdE7vyg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(110136005)(54906003)(16576012)(8936002)(316002)(5660300002)(31686004)(8676002)(31696002)(2616005)(956004)(82960400001)(6486002)(36756003)(26005)(66556008)(186003)(508600001)(86362001)(2906002)(83380400001)(44832011)(53546011)(6666004)(38100700002)(66946007)(4326008)(66476007)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aFJwTUFid0NjZTNIWVRhdEFpWnhUM3FmdFJxRWI1THpFb1BzQ1gvdzhyVzdR?= =?utf-8?B?cjNaa1MrbExERENzREtJMXZGanpUWkFmMDRhTFBTdEVvd2V4VVhPVkpuUGxp?= =?utf-8?B?Si9Gb01vN0U2bS9ubUJyN3NxWThhY3BYTzJ0N0pBMjd0cnRvaUd6M0t3SlZU?= =?utf-8?B?eGRNVzgwMGRPZXAyeFpRemlnU0NpS2c0cWRwNi9hclc4UVdLZDFNS0dsNEJh?= =?utf-8?B?YUYvU3RhOEcyWjIzclhucXhWSURGZG1mT05CKzVzRHYvSjFEdnVzOTAvOFBM?= =?utf-8?B?QnFqeTQ5Wnc3OXc1aXpycllWZi9IbmxtZ2hWSkFHR3ZYYTkwdElLOGJEak4x?= =?utf-8?B?VEdzQ0FyQml1TmRkSlRNV3dWakhNV0pQcVJqS0UyKzUxTlg0TFpZVG9LdkIz?= =?utf-8?B?NWVVbHdUcnNuQkZMamNram5tS3hLSmNBaEhRS1ZjYStqVEluVlpIRDFXQ0dO?= =?utf-8?B?bm5BVlhkOU5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prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2021 21:04:24.3968 (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: to6r2N+rqhlDMd3639njxtp7qyP9RcuolPnJClzlChT/O4C7FDY80c6KPuGkZneh7o27gxhF47PmeGtiN9KLfA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4966 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] ethdev: fix variable length flow elements support 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" On 10/26/2021 10:05 AM, Gregory Etelson wrote: > RTE flow API defines two flow items and actions types - common > and PMD private. Common RTE flow types are defined in rte_flow.h > while PMD private types restricted to specific PMD only. > RTE flow API allows PMD private types in flow rule, > but it must not try to interpret private item or acton properties. > > Current implementation tried to locate PMD private element, item or > action, in common flow elements records. > > The patch restricts access to common flow elements records for > non-private PMD types only. > > Fixes: 6cf72047332b ("ethdev: support flow elements with variable length") > > Signed-off-by: Gregory Etelson > Acked-by: Viacheslav Ovsiienko > --- > lib/ethdev/rte_flow.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c > index d268784532..a93f68abbc 100644 > --- a/lib/ethdev/rte_flow.c > +++ b/lib/ethdev/rte_flow.c > @@ -54,11 +54,13 @@ rte_flow_conv_copy(void *buf, const void *data, const size_t size, > /** > * Allow PMD private flow item > */ > - size_t sz = type >= 0 ? desc[type].size : sizeof(void *); > + bool rte_type = type >= 0; > + > + size_t sz = rte_type ? desc[type].size : sizeof(void *); > if (buf == NULL || data == NULL) > return 0; > rte_memcpy(buf, data, (size > sz ? sz : size)); > - if (desc[type].desc_fn) Was this (possible) negative array index intentional, or are you fixing it? > + if (rte_type && desc[type].desc_fn) > sz += desc[type].desc_fn(size > 0 ? buf : NULL, data); > return sz; > } >