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 E3AE143261; Wed, 1 Nov 2023 14:19:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B80A540151; Wed, 1 Nov 2023 14:19:47 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2067.outbound.protection.outlook.com [40.107.220.67]) by mails.dpdk.org (Postfix) with ESMTP id 86AD7400EF for ; Wed, 1 Nov 2023 14:19:46 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J0IkzGfiHpLx9eybUdJ23P79f3o+E3alpdy+rkzjPAjqoth7/yoncsoRVm/fPAy8WxU/P0kOlFzTJALlEx+8sLIt/GovakydxNMDooS8ZQ4Bl1Rty9UWfx3v85Mb/+1yF5/Tmiqzx5g/+fv9azFYOe3eNQ61EC/9wjywJXUeQiL7kCZvBUd28QZ8NhE3yDTlUrlD9BcwOdIp6xdkWeyusughcWYIInUOwfXU0wyJmjCWvxRmWp31B4Q9Enx2vgtgviCPS6Q1M3Irymazry8DuavMdBKcoTrXKAetPPHUGwJ8O6Z+59ide5+qLz4aNiMlSEKPRHU7CC6Bk9pNNy9dIw== 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=vNTvuO5pQj1LQMaYpadU3XPxpRvewd+Xh/vb8vQ4dtU=; b=F0lX9uE6QGfN0nwOYHOXQLsKmdzRwyxhM8YH1E58j9Mbdx9UywveiPgJ1gBgIV4Ss44WsiDB0fHhnshNHmy8E98OVUFDvE3TCuat0X+/Q37kHgyvdCwOzYzNHNsYFoL9Cfyh6K+pWogeHvap5YRlYLspYHgGzSB5UInKwok5O7LEppy4Y2JGJH7ndYUszHT0ZJEKbIaYyNNmsgcM0lRVqXaOjYHNHMY/XXwM6osefyGkD4TxMOOAR1TQdP8v1iPqbbnUO0xBR138Hf/3jc8QvXllhPnpoEdgHUSTkvtfxczenHy1Xt5/E1t2WmASnLV4PYqC7FtJdwtQnYpivb+Vlw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vNTvuO5pQj1LQMaYpadU3XPxpRvewd+Xh/vb8vQ4dtU=; b=gxXoaUlHairPAPVaWbxyA3vtZSHCT5lh1HVWW5j94cDyLp2Mftc2WEtqgRP+j8u29dDtUP6BGkO5MpZ2kvBRHnazSxF3RWO3bDciQgcN844bj0deZ5lrj83o1kS2lKfSqoaCGbyQDnSUm/xCkqZW6hasBrTi1tdZsepHJPOhxIc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by CY8PR12MB7362.namprd12.prod.outlook.com (2603:10b6:930:52::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.29; Wed, 1 Nov 2023 13:19:43 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::2569:edb2:670f:816f]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::2569:edb2:670f:816f%6]) with mapi id 15.20.6954.019; Wed, 1 Nov 2023 13:19:43 +0000 Message-ID: Date: Wed, 1 Nov 2023 13:19:36 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v8 02/10] lib/ethdev: check RSS key length Content-Language: en-US To: Jie Hai , dev@dpdk.org, Thomas Monjalon , Andrew Rybchenko Cc: lihuisong@huawei.com, fengchengwen@huawei.com, liudongdong3@huawei.com References: <20230315110033.30143-1-liudongdong3@huawei.com> <20231101074039.3088716-1-haijie1@huawei.com> <20231101074039.3088716-3-haijie1@huawei.com> From: Ferruh Yigit Autocrypt: addr=ferruh.yigit@amd.com; keydata= xsFNBGJDD3EBEAC/M7Tk/DfQSmP1K96vyzdhfSBzlCaGtcxNXorq4fALruqVsD3oi0yfyEz9 4YN8x7py0o9EL8ZdpOX0skc0AMCDAaw033uWhCn0GLMeGRKUbfOAPvL6ecSDvGD7CJIO9j0J eZUvasBgPdM/435PEr9DmC6Ggzdzt8IuG4PoLi5jpFSfcqxZFCCxLUDEo/w0nuguk2FTuYJg B2zEZ4JTBZrw7hIHiFh8D8hr6YA6a5uTofq1tr+l048lbtdFUl8TR0aIExVzE4Z8qKZlcE+9 RQaewjK5Al1jLE4sHdmd3GN+IvgDF3D/fLsi25SKJDeGSdeHkOmaX0qGeM4WKIfU6iARRCiQ N3AmBIxZ/A7UXBKLaOyZ+/i3sE6Wb53nrO4i8+0K2Qwyh6LjTeiJAIjYKN43ppxz3DaI+QwQ vI+uyHr4Gg0Da9EPPz/YyKauSeOZCfCB5gIfICO0j6x0SCl8uQ2nLpjxcZkf0gjcwUzP3h+S 3x6NfDji9YEij0zczW/dcSpGgZ6vsFpPrtnP9ZXy6J53yp0kJtOJoOlkEFFdU2yCZnCDseum CoudmGLZVvS0/DzHDJejq+3kK3FDGktZBOxZIIpal+nFqS7lVgOZc4+huVv3jyhzoAUOEyXA XK5j6o7g8STUY+z33QNnHpdLvecMwuzmvqy0jR54yAbZ64mB9QARAQABzSNGZXJydWggWWln aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlwQTAQgAQQIbAwULCQgHAgYVCgkICwIEFgID AQIeAQIXgAIZARYhBEm7aYjps5XGsPH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83qkZQ795MTe2YScp9dIV7fsS5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk= In-Reply-To: <20231101074039.3088716-3-haijie1@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR0P281CA0135.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:97::7) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|CY8PR12MB7362:EE_ X-MS-Office365-Filtering-Correlation-Id: 84045508-ab12-48fd-a773-08dbdadd3637 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qrckl0VfUnMBJu8SQWVNro65LJXmwyVFkSuYOPvWM3e0BmLKaun88KqJiLl7L2aJnI6NH1gqP99YdXMqNYpI6DOn4CPkm44u/hEgwvWOTDOjRE5efls3kA53YUirV5gvajvqdQZlKFqjkJuhGKGbMIPtPvbjamhgHNjilb5FgtJmE8850kzxtOUbnucbSEPjsFKaOiQ4r3MTHoKrp5fOpTCERUvNMYDD64+FQzm89u8/xAA3rYi4QtzHJC64hEoBxpaoplxpmnExq5QJY51pVJZxCk3Vd7Qm3SUVyKqO6ht+QzsjoO3e5iR8e4aftnqlDGh8W6wugg/OsirnIJKek4+4r+srbsU8r2orivvCEn33HRFQ46ufs+grleGoSl409tr4kXwTrUFFBA/BlHda65vMy8C+VM7oc7xwEfVmfpxgHoYHdmiX5cRZ8+Ra6filEoR3B77WFAplfyDeH3ALvVWPBokL2xXlikp7BJXLSvqPf3vxm6cflzn8ZibZ9xw8R/GWer5dExrMPr+0X/C8TS0EU8k16r5j1pcBZ7uBn0jR4IXmfEeKpSdlF9eAuCB9rPlq+Jm32Du5Trk+9sSa+xqtqgdGlcKZY2XtGYfpEz4q4g/oV/UeGgD+XM2wivZtX5/dZ4blw49A4/iRWVOmxA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(366004)(396003)(346002)(39860400002)(136003)(230922051799003)(186009)(451199024)(64100799003)(1800799009)(4326008)(5660300002)(41300700001)(44832011)(8936002)(8676002)(31686004)(66476007)(66946007)(110136005)(316002)(66556008)(2906002)(478600001)(6486002)(6666004)(6512007)(53546011)(36756003)(83380400001)(86362001)(6506007)(31696002)(26005)(2616005)(38100700002)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NWFrQ0VwYjdFVlFhd0VWYmc4OG8zQ2ZzWkxsVUI2c2pDSmZ3UVNrclZ5LytN?= =?utf-8?B?d3oyRjVWSElUenFBL2h3V1pJMmhwOFRzSFRMdXR5UW11bVkyc3dWNGxCSUxN?= =?utf-8?B?akVjUzZkTmZCTGhpQnpReHJlZlJnUVZqNzkzK0EwVERYRWlVemttQ2VYbGl5?= =?utf-8?B?QlNRMnRLMkpuRi9FbVNKdE9NYVdVckNmdDNaSVk5Y3NxWjhYTXdleWtQeXFH?= =?utf-8?B?MHNyYldvckpNN3R1QU4rekM4V0NLUFoxTlVVcEZ0TmY3YVI4L2x2ZThaUmtw?= =?utf-8?B?UkljL3dQeHVEazI0UXIyaEZwWEhKLzIzOTBKSzlYS1ViUEV6c0FEcitzQUNV?= =?utf-8?B?SFNKYmZzMFpFc3BLT1g5TU1Fenl4MHIweitvZmhNOGFJVmN3S2UwckRRMHJh?= =?utf-8?B?a0QwR21qVE1MdjR1SFdTVEt0bFJPQUsxVUY0bnVnM2RLTUtvY3BZK0lsV1o0?= =?utf-8?B?cU1uOVo3K3BKQ1Y5UXE4cmZLOHRYb3dJeXNrUHJralJNWEJ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RTa2xlZkRuKzVtYTNTMkhBVU9nS251RmxlS1p6c0djc2lnYlpy?= =?utf-8?B?T2VqWldRaUhzSzFkMjlPbXJoY3BjWWxTMDJoRkJaWnZMelE4T3AyRTFsK0M5?= =?utf-8?B?S3hVNkppN00xbHNINGlmRm83eWx4Y0NORkk3SGwyY1FoSjI3djhFamhXY0Vi?= =?utf-8?B?NzVuOVVQUlVYdFI3Nzl6RU42eDMzYjVYSFJBQkNyWTNJUW5Gc09yZW9ObVBE?= =?utf-8?B?WDlJdER5RURPMjhwQVhyTmhKbFQwaGordHlLTkppSkdacEN2bVRTOTBVS2dX?= =?utf-8?B?Mk0vMkJDeUR3QW03OVlyOFdpN2NZR3RPd01uWTRlcEV3R0hLV2FHWGFZUCsw?= =?utf-8?B?eXhKeXcyQ1pxQ0JoWnlWWTlnd1F6Sksydko3a25BSVI0VnZGTWV6Z3NGNjZR?= =?utf-8?B?MG1hOXpWWHM4YTRxcmI2NFllNWZsWXFUUUFtZmdLc0ZUNkNrenY2YTZCc1VO?= =?utf-8?B?Ri9Jb2lhTFNVZlhwa0RQcUxWUUwzemsrZ25HeHdVbGVraU1sTGJnTXpEYXJv?= =?utf-8?B?RExEUTl5QXhaNnZvRW5qOU1sNEJhVGVJUDJacTE1Z1o4b25nZHAxL1BLUEUw?= =?utf-8?B?MVo3c3BoaDlNdmNxcUltOXpMNHdSNjJQdll0Y0pqaS9oOTdtRnBBMmdjOHgr?= =?utf-8?B?MGZVa0NkM0QzNm9mbFlOcWx2alVPbG8xeHE1dXAvaGxPM1FEVGhwZ3J2NFlE?= =?utf-8?Q?dGIgXt8Xq5PZEkaRJOczQtdkD?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 84045508-ab12-48fd-a773-08dbdadd3637 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2023 13:19:43.7630 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pYZePq5qV+KYWd/+J1oFzCKbhab3gsqOQ8RLqh/GO17ETM+wEnFxOXcV1wuYQILn X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7362 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 11/1/2023 7:40 AM, Jie Hai wrote: > In rte_eth_dev_rss_hash_conf_get(), the "rss_key_len" should be > greater than or equal to the "hash_key_size" which get from > rte_eth_dev_info_get() API. And the "rss_key" should contain at > least "hash_key_size" bytes. If these requirements are not met, > the query unreliable. > > In rte_eth_dev_rss_hash_update() or rte_eth_dev_configure(), the > "rss_key_len" indicates the length of the "rss_key" in bytes of > the array pointed by "rss_key", it should be equal to the > "hash_key_size" if "rss_key" is not NULL. > > This patch checks "rss_key_len" in ethdev level. > Can you please squash this patch and previous one, previous one clarifies the API and this one adds relevant checks, so they con be in some patch. Can you also please update release notes, 'API Changes', explaining 'rss_conf.rss_key_len' needs to be provided by user for the case "conf.rss_key != NULL", it won't be taken as default 40 bytes anymore. > Signed-off-by: Jie Hai > --- > lib/ethdev/rte_ethdev.c | 31 +++++++++++++++++++++++++++++++ > 1 file changed, 31 insertions(+) > > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c > index af23ac0ad00f..07bb35833ba6 100644 > --- a/lib/ethdev/rte_ethdev.c > +++ b/lib/ethdev/rte_ethdev.c > @@ -1500,6 +1500,16 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, > goto rollback; > } > > + if (dev_conf->rx_adv_conf.rss_conf.rss_key != NULL && > + dev_conf->rx_adv_conf.rss_conf.rss_key_len < dev_info.hash_key_size) { > Why check is "rss_key_len < dev_info.hash_key_size", is it allowed to have "rss_key_len > dev_info.hash_key_size"? Shouldn't it enforce that "rss_key_len == dev_info.hash_key_size"? > + RTE_ETHDEV_LOG(ERR, > + "Ethdev port_id=%u invalid RSS key len: %u, valid value: %u\n", > + port_id, dev_conf->rx_adv_conf.rss_conf.rss_key_len, > + dev_info.hash_key_size); > + ret = -EINVAL; > + goto rollback; > + } > + > /* > * Setup new number of Rx/Tx queues and reconfigure device. > */ > @@ -4698,6 +4708,14 @@ rte_eth_dev_rss_hash_update(uint16_t port_id, > return -ENOTSUP; > } > > + if (rss_conf->rss_key != NULL && > + rss_conf->rss_key_len != dev_info.hash_key_size) { > + RTE_ETHDEV_LOG(ERR, > + "Ethdev port_id=%u invalid RSS key len: %u, valid value: %u\n", > + port_id, rss_conf->rss_key_len, dev_info.hash_key_size); > + return -EINVAL; > + } > + > if (*dev->dev_ops->rss_hash_update == NULL) > return -ENOTSUP; > ret = eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev, > @@ -4712,6 +4730,7 @@ int > rte_eth_dev_rss_hash_conf_get(uint16_t port_id, > struct rte_eth_rss_conf *rss_conf) > { > + struct rte_eth_dev_info dev_info = { 0 }; > struct rte_eth_dev *dev; > int ret; > > @@ -4725,6 +4744,18 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id, > return -EINVAL; > } > > + ret = rte_eth_dev_info_get(port_id, &dev_info); > + if (ret != 0) > + return ret; > + > + if (rss_conf->rss_key != NULL && > + rss_conf->rss_key_len < dev_info.hash_key_size) { > + RTE_ETHDEV_LOG(ERR, > + "Ethdev port_id=%u invalid RSS key len: %u, should not be less than: %u\n", > + port_id, rss_conf->rss_key_len, dev_info.hash_key_size); > + return -EINVAL; > + } > + > if (*dev->dev_ops->rss_hash_conf_get == NULL) > return -ENOTSUP; > ret = eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev,