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 4F5F945459; Fri, 14 Jun 2024 08:56:30 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DD90F42686; Fri, 14 Jun 2024 08:56:11 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) by mails.dpdk.org (Postfix) with ESMTP id 4721A402B4 for ; Thu, 13 Jun 2024 08:17:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718259438; x=1749795438; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=pKpOcdBt++0NShi0k66nNK7eAjvvWxgQh96TkPplmbQ=; b=MQ9K3xrB1++EEsuLyXeqPYzDOc3wx4S6tuSghzvrx4DsyXwT1HJI3qzK QHFbLxQ/9SO8wOooKU2rZ2m7yRMmzAKuj61fIM3u0gqadlfrl52Gki+nj hF4cva0w7AU0bEOOO3fySzyBmdQxYsPcSpMsgcabLiXsvOiym8ooK0OAZ 508UCnlijJY9tmfBBOR1pWoRPg0kp//v/1CC4FKX7ovASXFgAA1G1Ws5Q aW8lsqUBYGAZJVEHBIu7qxyP3ij0mWjw5nP3LNMZVlDgvkmJNuf6O+vQ+ vensLvG6PSgyxCPJi/VkW80PlOo4qh7pTaoD+m2YH10fUoSJ49W/PXdPR g==; X-CSE-ConnectionGUID: rz77mLtKRquzx8ujd7FMEw== X-CSE-MsgGUID: uLkyQEUqQx62Nb2WLERfNQ== X-IronPort-AV: E=McAfee;i="6700,10204,11101"; a="18913187" X-IronPort-AV: E=Sophos;i="6.08,234,1712646000"; d="scan'208";a="18913187" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2024 23:17:17 -0700 X-CSE-ConnectionGUID: O2H4tYuURBSbPv9rzpi02A== X-CSE-MsgGUID: MiEy5IxQSTeezbVhqXYzAQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,234,1712646000"; d="scan'208";a="44418476" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmviesa003.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 12 Jun 2024 23:17:17 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) 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.2507.39; Wed, 12 Jun 2024 23:17:16 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Wed, 12 Jun 2024 23:17:16 -0700 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.41) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 12 Jun 2024 23:17:16 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eqQktKsYvn26wLgsJVHMx8g06rjvRW3CHQ2sK+leBjfp1mNCPmAtav+ZEZzkVUwkcWP90kqAHG7SZbdV2SuH+JSH9DPBfdKKMffQG4fNR3u4HvZHwOzw1w6JD+xWmHYcj9kGLE9L/DiTTLcwTcT72xu/8FyMgqHkM+bwNOE9/ZVdw/nryg/a1bHm/WwCS4jHASJCU3+AkVsl2Rvkl3UG9ZT3BHUaAQOH5YVO/ONeDKaeNVJ1oKstiY8Ffl2SWJnPJmcUGkX05qZ/p5zkMDLPvT53FWz1aNoCmfX5QY4NT4T6c10BXw65SjQND68MjbyFtR3ehVI/8e18twLt3+gAgw== 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=UO67tY5fucVs3b2tIGqc/mU7hveWjH5AnaAprJXUIKY=; b=LNeTujzYqEfDNFisgTdzaIuUUhSU1POT8jW7VAskppRRzxl5u64w5uTqr1X3YvcnP+hK4DdsbrGj4hbdwBqdVk2Nz1wS5D4i7Y05vDVydJwverA3PUOX1nccmqfZu7HZ5NFsD+syPpa1N3KXGAsuMOq4nAymVclIAMBQYVtbX6bK85KtGIXBjmdZT7W8X9sHy4ZUNJG5F8WesYEl+Aw9vGcA7KGxpU70SMqDxqODdMWYSXgKyJMnvOrjTLCqwV8AsNEQrUsHDG2InmZdUyBE7ff0KqS+n1a7JCB1w5LjTYxARihh7LANEl6gr5tvglARUwaEUyHHgdF3BdPlL1PEwg== 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 Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from MN6PR11MB8102.namprd11.prod.outlook.com (2603:10b6:208:46d::9) by SA2PR11MB4922.namprd11.prod.outlook.com (2603:10b6:806:111::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.21; Thu, 13 Jun 2024 06:17:09 +0000 Received: from MN6PR11MB8102.namprd11.prod.outlook.com ([fe80::15b2:ee05:2ae7:cfd6]) by MN6PR11MB8102.namprd11.prod.outlook.com ([fe80::15b2:ee05:2ae7:cfd6%6]) with mapi id 15.20.7677.019; Thu, 13 Jun 2024 06:17:09 +0000 Message-ID: <5cebb15c-f54d-43ae-8890-2b2a10b8f78c@intel.com> Date: Thu, 13 Jun 2024 08:17:04 +0200 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 012/148] net/ice/base: clean up __ice_aq_get_set_rss_lut() To: Anatoly Burakov , CC: Ian Stokes , References: <20240430154014.1026-1-ian.stokes@intel.com> From: Przemek Kitszel Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: VI1PR04CA0060.eurprd04.prod.outlook.com (2603:10a6:802:2::31) To MN6PR11MB8102.namprd11.prod.outlook.com (2603:10b6:208:46d::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN6PR11MB8102:EE_|SA2PR11MB4922:EE_ X-MS-Office365-Filtering-Correlation-Id: 12a9453b-2eba-4978-e371-08dc8b7074a6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230034|376008|1800799018|366010; X-Microsoft-Antispam-Message-Info: =?utf-8?B?ZGdRNFZWQXJheFlRYkhHOC9rQm1yNjN3SzVPYTZZb1ZhL0RCcTRNeVd0QldY?= =?utf-8?B?dFRCV2RobjJDWng5c2U2L3lDNStNMkhSV1JPTkVYOHhtbmhqdnJ4a29SSExU?= =?utf-8?B?NCtIQ2paU1RlSmQ4ZkdxOXEyOHdNQnRoOHJBNVRvb3hhQ2xrMmtseHA4Rmx0?= =?utf-8?B?bmlqQm9Ua2FEUU5RUUdFKytZRERJZzVlZ3cwMXFFeVRjZVBrYVpucGE5V1or?= =?utf-8?B?VS9pYS9jMUFRSTE0YVBTM3k0Rlc0emdPRmtHSGFMWTdlYzJhK0RkSU9rYW45?= =?utf-8?B?NGpLZFYwb3E3cXBTZU5rSW9SSVlhMXUza3dqdVc1eDVXZlh0NklNSFJsWmd4?= =?utf-8?B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l5?= =?utf-8?B?aUFnZjFMQUJGby8zUVpmaG1PM1d3QjZBb1o5T2JxTTZacTFIa3h5TnY2ODFL?= =?utf-8?B?SGtWQytvNVFFTEtzZ0Y0aWZvZS9GS3JEUC9wNCtBbm90RmdYdWphV3pqdGdS?= =?utf-8?B?aGRvY3JEWWgycnBaMXRZRUdZak9NQ25uQ1BXWXY5K3JvQzBQTm1CT1NEUlMr?= =?utf-8?B?UlIrWWhWZ2hZdEpNcW1KMllBeUNXL1dORDFHaEczV3BjR2FyU1NBdHhoTHJX?= =?utf-8?B?cjQva0E2S0F4QkFyckVCbi9TTkZrL3BRVmpIRm92WFlRSFJxNVZuQURkYkE0?= =?utf-8?B?dStnUlVjbHp4Vm5DbnVzMXd0NUNjeThreFBDbnVOUVR6U0JXbTVTTGFjSXdP?= =?utf-8?B?M3N3Z2x5ZnpXRGp0QTYyR0oyY2lIMS9kYysra3hQTm9WSnIrSlAvSmtsK1ZU?= =?utf-8?B?WnZRYlBNajJmWUw3dEVIUlIvUHphTVdCWXF3cGJjeFpUNVBsSG41dm5pR3Z1?= =?utf-8?Q?2qRidKsACJeZffyYPIGwS/gLiMgCY+PDVA9jfeJ?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN6PR11MB8102.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230034)(376008)(1800799018)(366010); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Si9JOVFmRE5IU3d0cHJicDJseW9oRE5sbitha1k4ckNwL2pxclMzTEg2QmJ5?= =?utf-8?B?UGNaOTRMY1l4UFIzUWgwb250a0JyWllqQ0FFdXFyMzkxdndNb21jNDUzOGQ2?= =?utf-8?B?U2VCVHJUaWdSYWdLME5IYWFVcG14SG1lTEdEMHd4YzdKU0VjSHhYVGg3Vml6?= =?utf-8?B?TF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MXNKY1hBeXY1L1hGVURPbDVwOVBSYU44ODJU?= =?utf-8?B?MG5Zb3pVLytxZVlFVm5IcDhEN0d4ck03Uzl3WFovWWl3Wkk0SWNZbExvTnRo?= =?utf-8?B?SE5CakJ0WjhlRTMxeVlaTThVRUw5cU1Rbys2c05jRUtaSmNsc1crbzg5SGJo?= =?utf-8?B?SXVLdkFXMVFBUUVWdENLajdVK2d6VXZIRHhTUjlkazVDdk5zREV2MVJwTm9C?= =?utf-8?B?MVE9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 12a9453b-2eba-4978-e371-08dc8b7074a6 X-MS-Exchange-CrossTenant-AuthSource: MN6PR11MB8102.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2024 06:17:09.1398 (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: EHnrqRVrr0pdNihMgXPjG3JIxiIZvnIDfbUlCBOx68HX1zQ7onDIb7BDogTjMXZJ/Z2UwfpOoOrY2W2YqzKE4VJIXbJWv218Q8BYCpwS0yo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR11MB4922 X-OriginatorOrg: intel.com X-Mailman-Approved-At: Fri, 14 Jun 2024 08:56:08 +0200 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 6/12/24 17:00, Anatoly Burakov wrote: > From: Ian Stokes > > Refactor __ice_aq_get_set_rss_lut(): > get: > - make use params->lut_size only as a size of params->lut; > - return LUT size via params->lut_size; > set: > - remove option to set RSS LUT smaller than available > (eg forbid PF LUT sized 512); > both: > - clean up code. > > Signed-off-by: Przemek Kitszel > Signed-off-by: Ian Stokes I have not much interest in DPDK, but when you CC me on code authored by me, it would be nice to also apply proper authorship (the From: line). > --- > drivers/net/ice/base/ice_adminq_cmd.h | 17 +++- > drivers/net/ice/base/ice_common.c | 126 ++++++++++++++------------ > drivers/net/ice/base/ice_common.h | 1 + > 3 files changed, 82 insertions(+), 62 deletions(-) > > diff --git a/drivers/net/ice/base/ice_adminq_cmd.h b/drivers/net/ice/base/ice_adminq_cmd.h > index 56c9a4813e..a6a8210dd5 100644 > --- a/drivers/net/ice/base/ice_adminq_cmd.h > +++ b/drivers/net/ice/base/ice_adminq_cmd.h > @@ -2225,6 +2225,19 @@ struct ice_aqc_get_set_rss_keys { > u8 extended_hash_key[ICE_AQC_GET_SET_RSS_KEY_DATA_HASH_KEY_SIZE]; > }; > > +enum ice_lut_type { > + ICE_LUT_VSI = 0, > + ICE_LUT_PF = 1, > + ICE_LUT_GLOBAL = 2, > + ICE_LUT_TYPE_MASK = 3 > +}; > + > +enum ice_lut_size { > + ICE_LUT_VSI_SIZE = 64, > + ICE_LUT_GLOBAL_SIZE = 512, > + ICE_LUT_PF_SIZE = 2048, > +}; > + > /* Get/Set RSS LUT (indirect 0x0B05/0x0B03) */ > struct ice_aqc_get_set_rss_lut { > #define ICE_AQC_GSET_RSS_LUT_VSI_VALID BIT(15) > @@ -2233,7 +2246,7 @@ struct ice_aqc_get_set_rss_lut { > __le16 vsi_id; > #define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_S 0 > #define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_M \ > - (0x3 << ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_S) > + (ICE_LUT_TYPE_MASK << ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_S) > > #define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_VSI 0 > #define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF 1 > @@ -2241,7 +2254,7 @@ struct ice_aqc_get_set_rss_lut { > > #define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_S 2 > #define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_M \ > - (0x3 << ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_S) > + (ICE_LUT_TYPE_MASK << ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_S) > > #define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_128 128 > #define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_128_FLAG 0 > diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c > index 1fe9bebe7d..314d1bffb4 100644 > --- a/drivers/net/ice/base/ice_common.c > +++ b/drivers/net/ice/base/ice_common.c > @@ -4127,6 +4127,51 @@ ice_aq_read_topo_dev_nvm(struct ice_hw *hw, > return 0; > } > > +static u16 ice_lut_type_to_size(u16 lut_type) > +{ > + switch (lut_type) { > + case ICE_LUT_VSI: > + return ICE_LUT_VSI_SIZE; > + case ICE_LUT_GLOBAL: > + return ICE_LUT_GLOBAL_SIZE; > + case ICE_LUT_PF: > + return ICE_LUT_PF_SIZE; > + default: > + return 0; > + } > +} > + > +static u16 ice_lut_size_to_flag(u16 lut_size) > +{ > + u16 f = 0; > + > + switch (lut_size) { > + case ICE_LUT_GLOBAL_SIZE: > + f = ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_512_FLAG; > + break; > + case ICE_LUT_PF_SIZE: > + f = ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_2K_FLAG; > + break; > + default: > + break; > + } > + return f << ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_S; > +} > + > +int ice_lut_size_to_type(int lut_size) > +{ > + switch (lut_size) { > + case ICE_LUT_VSI_SIZE: > + return ICE_LUT_VSI; > + case ICE_LUT_GLOBAL_SIZE: > + return ICE_LUT_GLOBAL; > + case ICE_LUT_PF_SIZE: > + return ICE_LUT_PF; > + default: > + return -1; > + } > +} > + > /** > * __ice_aq_get_set_rss_lut > * @hw: pointer to the hardware structure > @@ -4138,7 +4183,7 @@ ice_aq_read_topo_dev_nvm(struct ice_hw *hw, > static int > __ice_aq_get_set_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params *params, bool set) > { > - u16 flags = 0, vsi_id, lut_type, lut_size, glob_lut_idx, vsi_handle; > + u16 flags, vsi_id, lut_type, lut_size, glob_lut_idx = 0, vsi_handle; > struct ice_aqc_get_set_rss_lut *cmd_resp; > struct ice_aq_desc desc; > int status; > @@ -4149,16 +4194,22 @@ __ice_aq_get_set_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params > > vsi_handle = params->vsi_handle; > lut = params->lut; > - > - if (!ice_is_vsi_valid(hw, vsi_handle) || !lut) > - return ICE_ERR_PARAM; > - > - lut_size = params->lut_size; > lut_type = params->lut_type; > - glob_lut_idx = params->global_lut_id; > - vsi_id = ice_get_hw_vsi_num(hw, vsi_handle); > - > + lut_size = ice_lut_type_to_size(lut_type); > cmd_resp = &desc.params.get_set_rss_lut; > + if (lut_type == ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_GLOBAL) > + glob_lut_idx = params->global_lut_id; > + > + if (!lut || !lut_size || !ice_is_vsi_valid(hw, vsi_handle)) > + return ICE_ERR_PARAM; > + > + if (lut_size > params->lut_size) > + return ICE_ERR_INVAL_SIZE; > + > + if (set && lut_size != params->lut_size) > + return ICE_ERR_PARAM; > + > + vsi_id = ice_get_hw_vsi_num(hw, vsi_handle); > > if (set) { > ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_set_rss_lut); > @@ -4172,61 +4223,16 @@ __ice_aq_get_set_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params > ICE_AQC_GSET_RSS_LUT_VSI_ID_M) | > ICE_AQC_GSET_RSS_LUT_VSI_VALID); > > - switch (lut_type) { > - case ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_VSI: > - case ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF: > - case ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_GLOBAL: > - flags |= ((lut_type << ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_S) & > - ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_M); > - break; > - default: > - status = ICE_ERR_PARAM; > - goto ice_aq_get_set_rss_lut_exit; > - } > + flags = ice_lut_size_to_flag(lut_size) | > + ((lut_type << ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_S) & > + ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_M) | > + ((glob_lut_idx << ICE_AQC_GSET_RSS_LUT_GLOBAL_IDX_S) & > + ICE_AQC_GSET_RSS_LUT_GLOBAL_IDX_M); > > - if (lut_type == ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_GLOBAL) { > - flags |= ((glob_lut_idx << ICE_AQC_GSET_RSS_LUT_GLOBAL_IDX_S) & > - ICE_AQC_GSET_RSS_LUT_GLOBAL_IDX_M); > - > - if (!set) > - goto ice_aq_get_set_rss_lut_send; > - } else if (lut_type == ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF) { > - if (!set) > - goto ice_aq_get_set_rss_lut_send; > - } else { > - goto ice_aq_get_set_rss_lut_send; > - } > - > - /* LUT size is only valid for Global and PF table types */ > - switch (lut_size) { > - case ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_128: > - flags |= (ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_128_FLAG << > - ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_S) & > - ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_M; > - break; > - case ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_512: > - flags |= (ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_512_FLAG << > - ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_S) & > - ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_M; > - break; > - case ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_2K: > - if (lut_type == ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF) { > - flags |= (ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_2K_FLAG << > - ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_S) & > - ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_M; > - break; > - } > - /* fall-through */ > - default: > - status = ICE_ERR_PARAM; > - goto ice_aq_get_set_rss_lut_exit; > - } > - > -ice_aq_get_set_rss_lut_send: > cmd_resp->flags = CPU_TO_LE16(flags); > status = ice_aq_send_cmd(hw, &desc, lut, lut_size, NULL); > > -ice_aq_get_set_rss_lut_exit: > + params->lut_size = LE16_TO_CPU(desc.datalen); > return status; > } > > diff --git a/drivers/net/ice/base/ice_common.h b/drivers/net/ice/base/ice_common.h > index 2aeb1a520a..fe99b56f8b 100644 > --- a/drivers/net/ice/base/ice_common.h > +++ b/drivers/net/ice/base/ice_common.h > @@ -101,6 +101,7 @@ ice_write_tx_drbell_q_ctx(struct ice_hw *hw, > struct ice_tx_drbell_q_ctx *tx_drbell_q_ctx, > u32 tx_drbell_q_index); > > +int ice_lut_size_to_type(int lut_size); > int > ice_aq_get_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params *get_params); > int