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 8AF74A0548; Thu, 4 Nov 2021 10:10:44 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 102F440E5A; Thu, 4 Nov 2021 10:10:44 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 1A91040DFD for ; Thu, 4 Nov 2021 10:10:41 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10157"; a="211723222" X-IronPort-AV: E=Sophos;i="5.87,208,1631602800"; d="scan'208";a="211723222" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2021 02:10:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,208,1631602800"; d="scan'208";a="450135403" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga006.jf.intel.com with ESMTP; 04 Nov 2021 02:10:40 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 4 Nov 2021 02:10:40 -0700 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 4 Nov 2021 02:10:40 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Thu, 4 Nov 2021 02:10:40 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.175) 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.2242.12; Thu, 4 Nov 2021 02:10:39 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mKaNtgDdfbjCf5ZiSjk8IJYVbxcKTLO2g5Z4pF6VgFVvSKxx10e7CJcq4XOEm8lBt68fUOY0e4q+3Q1E6pNiieDQx0hKSncoQuGiCI2PUypbI4tKTEB9Ajt1qvi/F2aw3WTcCLadhZSckKUuQ/x2SsrECoBVOQ7H5waeNCfHewGRRlh5pEP+h0c4UsMeXCXGHBeQK3K0zaMAWJ4Jf6zV5Y1MM0XO6dut/N/xjat2IfZDFgtlIwagQHJu1qtkbWc0QoYWYkAxNGir9hbZL6pPojwmzH9bCAMId74W/IIF6iCHzA1nGQQ0fppUnq+cLwFRMoPwUDXv2ZSSJibwWK0P+g== 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=coYMmM9MJoY3iWlrgQuz2j3EfOOe5ZXlQyT8o5hVrTk=; b=EdCO0QrDWPKRK8s6t05KijOq00xaN2LLLFvFt474GpmIiLRK69Hs2W9sWvA5HAkJgQDMULkBfeWvTqjXxuXKmUsEOmIzgwNkcoq7E6xKrrbmrDRBXmAgWrZIlnbKr0QBWExgDHohwsUyECqFOIyVfzK4Xd/UQq792D9QQA2qTr2CUH2l1CHuLSue3ie7QEgsVrph47g+Kq9hJDPwKv8PhB/0EvWnRTjhYOO1i4hXnF23vGNvlF2c7HaDVS4zE9jgBGQk1q6CXRGLO5oqMMSMR9LkTLVt1ayHKHqc10IvChA7ByScaw/1MMO4+9btcNqQWtcfOGjxk8VKFjiTdrdipg== 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=coYMmM9MJoY3iWlrgQuz2j3EfOOe5ZXlQyT8o5hVrTk=; b=gw9/l8/X/jyCtzCmfBJpAWMhPRe6UX8/BQU9w+pv4MZlsyL+FoL9J4COfgXmAFesF+iMrkhh3I3EGPqILdbL2YSBiDhCie8WHN6mA48hTX/8AB4reXAN7q5RPf80NKWheC/B0FkjmMG0T3uvNs5unPxkN25mt6snWnibfsy2cP4= 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 PH0PR11MB5927.namprd11.prod.outlook.com (2603:10b6:510:14e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Thu, 4 Nov 2021 09:10:38 +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; Thu, 4 Nov 2021 09:10:38 +0000 Message-ID: Date: Thu, 4 Nov 2021 09:10:31 +0000 Content-Language: en-US To: Gregory Etelson , Ori Kam CC: Matan Azrad , Raslan Darawsheh , Slava Ovsiienko , NBU-Contact-Thomas Monjalon , Andrew Rybchenko , "dev@dpdk.org" References: <20211026090554.9128-1-getelson@nvidia.com> <5c9f54cc-8d20-a131-4376-631be940aba3@intel.com> From: Ferruh Yigit X-User: ferruhy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0487.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1ab::6) 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 LO4P123CA0487.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1ab::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.10 via Frontend Transport; Thu, 4 Nov 2021 09:10:36 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 92c33cfa-e1e3-4095-8421-08d99f72f7aa X-MS-TrafficTypeDiagnostic: PH0PR11MB5927: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:248; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lQxN7QY6239VHsf1/yAPFTm4BtPG/guLjmJaJEmXtUjkI4WlRAmbccs926HZN5pCAlnPErItkg1GI77DCkR7sc43FYYLmDRhRAurIKqdd2IEQhFKbWIo5/IuhQQ8dN8CJDlrd9RkTgetA0YydNxwDhCVcX2mma0Er9tA6vv+xE4bxlDfJ3PX8EA+P5i+jA16i2MXClkj8AjTV42XPDnb98/BZlARktA7kgcME7DZ2GghTEtMe6JcymZxQt6LD0d+mI2fMy/B2afdE5cVi4gpGI8I1gtp/KDbQ0Bl+/2MaW1eQ0ARigkDEvYUVLbmzNRt7IpajuF8F8meLHpweu7DkYELy3pMqM08oCzNTHSvvdfd7/yq0xuCtvDgwLiOHVgfWZh+lgwUTXVJ21pDLYltjo9BeoayB+yxEyoX8g0X3d33xoZfehAQwU0P0scsY/TS+GJub+EqsB2LTtWWgqg8RZj7qkG2+Tari2ZYHrnTwU+/k7uYNbzLKg5YPtP+XILEXU4aUs830nnYZx0xYZp9RNpUCoHxkXgEuFIG+ADYVXZVmOzi8wCHSaW57j8EdbHsUsJc2RfP5lL+zMOQAfVAC2gLa5M/847fRVDEDx9nZVysJnDMuSRkZU9o0xH/cCZ8bdLV7FbLM7zrF0FgS6L2Xp9Hhjf9AyyFyKMW2liU+iFyVPogTY7f4l+tK2M00R4vwscSGv8LlnENjP07DWMruw== 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)(82960400001)(4326008)(6486002)(31686004)(186003)(110136005)(316002)(16576012)(86362001)(54906003)(31696002)(66946007)(66476007)(8676002)(38100700002)(2616005)(8936002)(956004)(5660300002)(26005)(36756003)(6666004)(83380400001)(44832011)(53546011)(2906002)(508600001)(66556008)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VzhyQXZkVkFjMXhIRWdDQldJTFdNTktPOWhEaHRHQkZxaHA3OGo2NFQrbzRX?= =?utf-8?B?T05yWndYVXkzKzd3WU0zTFZpTFlCZ1VZbndZSE9nRXhIMGRjMEV5QTJTZm85?= =?utf-8?B?NFhuVXJPejE1bWI0T0UxSmhHYTl3eFlORTJqbGRnSHVsdGhFalhZVjBrNmIv?= =?utf-8?B?MjNGazNhdk9QYVRFU2pERS9xcnJqL0h5c2JTWGI4RDJ2RUdXWFhyd2swb0RR?= =?utf-8?B?UU4rTGRuT3RYcTI1MDYwbGlUb2NLNXpubFd1VU51d01WYlVXWXF0eTlKSXZQ?= =?utf-8?B?SkJXaFFod21QdmUwOUhacFZUOU4va1F3b09TaW95aWZrbm5JbnJDejlxalJX?= =?utf-8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YxTzg5U251NWI1bG85?= =?utf-8?Q?bbHgWiCtNxhU7IDQQorLKkc=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 92c33cfa-e1e3-4095-8421-08d99f72f7aa X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Nov 2021 09:10:38.2728 (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: HfmXkUllM+UCafyi4/gwYocuvypfLD4g4bsIYrz1naftQVjNJZmsp0I9fzNMztas6MUOXp/vEPARWmiqV/9NEg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5927 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 11/4/2021 5:33 AM, Gregory Etelson wrote: > Hello Ferruh, > >>> 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? >> > > Negative type values assigned to PMD private items and actions. > RTE allows private PMD types in flow rules since > 5d1bff8fe2 ethdev: allow negative values in flow rule types > We construct flow rules with private PMD types > to implement tunnel offload. > However, negative type must not be used as index in > rte_flow_desc_item[] and rte_flow_desc_action[] arrays. > That is what I assumed, but wasn't clear from commit log, commit log reads as it is updating an intended usage. >>> + if (rte_type && desc[type].desc_fn) >>> sz += desc[type].desc_fn(size > 0 ? buf >> : NULL, data); >>> return sz; >>> } >>> >