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 91C92A034F; Wed, 10 Nov 2021 17:19:24 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7DBAC41144; Wed, 10 Nov 2021 17:19:24 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 2412941150; Wed, 10 Nov 2021 17:19:21 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10164"; a="232951269" X-IronPort-AV: E=Sophos;i="5.87,224,1631602800"; d="scan'208";a="232951269" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2021 08:17:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,224,1631602800"; d="scan'208";a="582760349" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by FMSMGA003.fm.intel.com with ESMTP; 10 Nov 2021 08:17:18 -0800 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 10 Nov 2021 08:17:17 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx605.amr.corp.intel.com (10.18.126.85) 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, 10 Nov 2021 08:17:16 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.100) 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; Wed, 10 Nov 2021 08:17:01 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nx/Sue8xLzQm90c9217KdgldxeX7mReDcesTU0eqPtyhkLPseryf+SItI6OXyJM6q7b+JW84XlXfUmHAvG8DloHwwW81q+9kTRsIeVMnpMBgJTl1zeePuf9FqKXlOz1Q15XwDP+x82SkUFCVNScsmUGxfgGVO646XQKJEv2PgtSISWo5NvPKUQ0CB4k0oAQmvFRaMMxFDH6NLFBAK/u7Pcmi6FyVfVsyXiFtI+t+Rw+XNoublnnLbEIALB/u3M1hgRVbwgqKYVPbSYbxC34p6zj9yEol0wKpDVGL6DYkJxz6epdYDU1qpl7ONf7arEGyS1csMGuMwJVErKn7E73INQ== 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=o20ucQjU/sfgyBWF/zUET+1eP3pVvHPRqDEWRrrOUJE=; b=gm+zavd6q1G/e3xtpnn8LBZFMhA/ySctpzZgCetY6YNObWCgXXR68JrEc6DKIDUQN+zAbvaGongpU4wLmsT9vqbG4TWAkkWcr1Xy3+X7nyJgNS0GK+ZOLaZW12zr/ttl8ZxTe9bLQn3zcepi00zdoCA1GOSd36F8yTgghBuyoH616Sh0oW7Kiz1Bgct12Y6T7aQOtDFKVR+ua9Huw3SQ6EZLWlows7cdEXryn7B1VkDfiaP3ndrF4jXAWefYTKK0wuLzN/y/b7zjlsR7GC05IrT0e0h9SSZecUzW1k9FSqTcv2Ze2MNGQh8E1zN1vYu2ixF+lELxVUFOkHKz6Dn3Dw== 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=o20ucQjU/sfgyBWF/zUET+1eP3pVvHPRqDEWRrrOUJE=; b=g5+0qupaxLROtcFTjgoPSQXaFBfwBEA3nzg7UeoAyRc1CatVQ8o25wJB+ja+a/9KZ0CjKweigJ0NmmahngMtgR1qKMbtRUfqYoLKLBKWsXQd5Rk5+mEgb6e8FZ6+U+06txk3Lv8c5qF6nVDM1Pmf0AAf0ln3IIuUoRizZPMs55s= 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 PH0PR11MB4888.namprd11.prod.outlook.com (2603:10b6:510:32::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13; Wed, 10 Nov 2021 16:17:00 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c%6]) with mapi id 15.20.4669.017; Wed, 10 Nov 2021 16:17:00 +0000 Message-ID: Date: Wed, 10 Nov 2021 16:16:54 +0000 Subject: Re: [dpdk-dev] [PATCH v2] net/mlx5: fix the RSS consistency check of meter policy Content-Language: en-US To: Bing Zhao , , CC: , , References: <20211018131612.145215-1-bingz@nvidia.com> <20211018144307.148246-1-bingz@nvidia.com> From: Ferruh Yigit X-User: ferruhy In-Reply-To: <20211018144307.148246-1-bingz@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0025.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:151::12) 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 LO4P123CA0025.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:151::12) 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, 10 Nov 2021 16:16:59 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2a8496ad-a7a5-41b2-01e3-08d9a4658681 X-MS-TrafficTypeDiagnostic: PH0PR11MB4888: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PCkzYRGNMCV/ApJxUsskmqFe5HY3AHKBF0407DkVqKwwZn1rXTVSX/ymQbOEbpcxF5zBexTjiKI61VJYkfa2/XFE12ZRf4fGJoVTrnWWeBVSD9uZ52WHy+WtkWyEQi96IQFq9HTutSu+kps7PFKe7d2KGPMpYYtROjbOa6GY0Eo5Q/z2c7/f8MfQBJUEoDEGyPtpoFm1pyArXtFAaVO+TQCZ4b+UqJnAtcKkSd0uQEC0oSBp8dPhlz4XJ7WHq7J242rasEz/TSrN6rYh3OZ3qWE1reEAj9Qjd8tJBaahT8F5m59/KN/fnN9N5AkBGy6Itw9DjMGWsvWFJEmlwPMnLGCT0zwR7yBye7xGxGYuXsecKIrgYdfGaDg2SoU6TViA5YsIPLXh5pttTn5H/Xyzwsm9nvbKCB/S31kDtJTioydlQrvZtG3l/3O2FmETa8vI8mznyN3N/YsD16xy5FDdgs7SEmkOEepRRgJB+1LX6kf1sRyOeYjj6iwemfkXNfBJfMAedz0d32fCrc16c2kFILPGV/hpskKOgaHC+GQ/spqnfIlk/4OfquNsWNHEMb7sbHsrjtLejfFv45zHQwJi8M6JUB9tG087QRAfqrTS9/EBSoqq5aUwzdOraR7RLzDx2cr3yK2wANvIVJMP/USHMvVTAFRb0Zv4INkhVEx6yTGPXNQLJ3NCfRbt/MOm7Xd5ws5t0OFLrYWVVsVsT2k1qg== 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)(36756003)(2616005)(53546011)(8676002)(44832011)(83380400001)(6666004)(6486002)(31696002)(2906002)(8936002)(186003)(38100700002)(86362001)(956004)(31686004)(5660300002)(66476007)(66556008)(16576012)(316002)(26005)(508600001)(4326008)(82960400001)(66946007)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WmZJa0NNOXVUcTMyTExKNmdhOXFwaFRqSUVMbUU5dndxOVRBdTFIaEhmNXRJ?= =?utf-8?B?NmlUdmg1OE1HYUV4a0xDVFQzeHNUb3NSUWhOOXhlblA4UTlFMGxydDlyMGdz?= =?utf-8?B?NW1qc0pSMkJhQ1V5VFFlTVg4WHQzUzRvb0NQSFdjWVRmOTk4RnpDRlVxdXVs?= =?utf-8?B?dXZXMEZwL1oycnRHeXRUSkw5cXdJakFMOUFxdDRuTXp4R0FjdG9kMHh2ZTly?= =?utf-8?B?b0dkVlBJblFTaHpDVlYrNUxCNUVoVEZmQTVnZm1qb3JaUWJDUVZZYmZnZ0tm?= =?utf-8?B?Rjk3Vm9pRE1QNnB3cXNTekJLeEoyMTU3UjVXVmNjbkZneUk3Wk51dVVOVmNz?= =?utf-8?B?OWt4VFFWV1N5MFk3NmxGNEJsMU5WcEdzQStMZWpWaytXNldjSnp2NVlPSk5S?= =?utf-8?B?SUNhY3N6Tk1sK3djRHFMWFo5UmIreWRvVWIySmh5cUVBcVB3WHl0L2FaSUZC?= =?utf-8?B?QnZQOWVSVDhOenhudzdnMi93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GpMZDRrWVY3VlM5MVpqYURvODEyb0VaR1hxTEtjNWd0Qm1u?= =?utf-8?B?UFNMU2pBbC9LeXgwcDBXcmtoWjdkTDRMcjZxQXBtdHplWkhKeStkcndzNUhC?= =?utf-8?B?RkVHeGF4NUcxcXpPanM5Vmhqenh1d2I4T0pKOHdYcVozL0o5Wjc1VHErcURv?= =?utf-8?B?dDNpcDMzdkRkNldaUjVpS0VZVFlhZzg3UlFHVDZiTFNhN0k1bHVlUUV5OWp1?= =?utf-8?B?dWNjZFBlR3FHVFFwa0QzZXdaWkxWanB6QmJ4S0VsOGVzM3lDazdxdU4vNFc3?= =?utf-8?B?YUcxU21iOURnUjBvd1FCemMvWjUzbHhmckRwTnY2ZlR3MGtidzNlNXU0aGpP?= =?utf-8?B?Z2ZKUzNwYVhVUktLU3hiQXI1eUxHTGM2V09Vek5UN2dLcC9DREtNdnhHaS9V?= =?utf-8?B?SWZhRTJwb3dwY2lQSFBNVHppZ0xWUWdsRGZ6UXNSTXc1dzBMZDcyR0JBQzNZ?= =?utf-8?B?NHc1OXdPSEI3dXBuQzYyREZWOStMTW9aTnpsUk9DYm5mQXZ1clhORmNmcTBB?= =?utf-8?B?SldUb1dyTU5qemRSVW5tUFphYWgvYU4wUE5tdFptOEJFMzRndUh3OGFJTUNP?= =?utf-8?B?QnJOU2xjak9wOEhLMEdxZVdnaHcvaVNpZlNYRzRpcUx5U3o4RFJSWTdDaldK?= =?utf-8?B?YWlyb1NURVhtWGRaeWtVT3lScy90TkM1aWV2dU5QNXRTTHBRTUZBa0FUSE9Q?= =?utf-8?B?c3FoOHFiZExaUktMK2RlbmhndGZyM2dJUzZvUFMxUkc4SVQ5S0c2WmVWbDlK?= =?utf-8?Q?40sxkWKjLOwTeo8Bh4biRDk=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 2a8496ad-a7a5-41b2-01e3-08d9a4658681 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 16:17:00.7786 (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: Ia/zn2zPWZVgAKNV2eky7Ft/sg2edN0k103upWS9nLV+aRpKMW3ytEpv8ZtPXc5LUA8xM0uygt4CH9t+NBRwWg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4888 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 On 10/18/2021 3:43 PM, Bing Zhao wrote: > After yellow color actions in the metering policy were supported, > the RSS could be used for both green and yellow colors and only the > queues attribute could be different. > > When specifying the attributes of a RSS, some fields can be ignored > and some default values will be used in PMD. For example, there is a > default RSS key in the PMD and it will be used to create the TIR if > nothing is provided by the application. > > The default value cases were missed in the current implementation > and it would cause some false positives or crashes. > > The comparison function should be adjusted to take all cases into > consideration when RSS is used for both green and yellow colors. > > Fixes: 4b7bf3ffb473 ("net/mlx5: support yellow in meter policy validation") > Cc: stable@dpdk.org > > Signed-off-by: Bing Zhao > --- > v2: remove unnecessary parenthesis > --- > drivers/net/mlx5/mlx5_flow_dv.c | 18 ++++++++++++++---- > 1 file changed, 14 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c > index 609ab43fb6..94b70bd10a 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -17412,12 +17412,22 @@ static inline int > flow_dv_mtr_policy_rss_compare(const struct rte_flow_action_rss *r1, > const struct rte_flow_action_rss *r2) > { > - if (!r1 || !r2) > + if (r1 == NULL || r2 == NULL) > return 0; > - if (r1->func != r2->func || r1->level != r2->level || > - r1->types != r2->types || r1->key_len != r2->key_len || > - memcmp(r1->key, r2->key, r1->key_len)) > + if (!(r1->level <= 1 && r2->level <= 1) && > + !(r1->level > 1 && r2->level > 1)) > return 1; > + if (r1->types != r2->types && > + !((r1->types == 0 || r1->types == ETH_RSS_IP) && > + (r2->types == 0 || r2->types == ETH_RSS_IP))) Need to use renamed macro: RTE_ETH_RSS_IP Will update in the next-net.