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 0976C4404F; Wed, 12 Jun 2024 17:08:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 83EC042686; Wed, 12 Jun 2024 17:03:51 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mails.dpdk.org (Postfix) with ESMTP id EFCF540E3E for ; Wed, 12 Jun 2024 17:03:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718204629; x=1749740629; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=++k5baTl4IWvY3MT6qSFygn0F+k+e+8+covrTMmPt8Q=; b=EZTPquKz7z+7p0oR12jdStqdmJlKdAIHWxm2JM1t+U0wDXoBlVikq5jf 6Lj1QOjZdIv4hwF1oTfv4j/mI7mtqfyLV6CCcsc8zjpHI7cXdpHOID0Ge 9Zlp9KKishypU8OiX3vuimPPIVo9bJf5/98E+BPq/8WKdVuJ/Lv9Jj4SV 87aPsOTBLD98091zfVdHZ0K59804pQc9y1q2DXB6s1nvcA8l9NNxkV1n7 IVjhd+IDWRR8Q1+r8WpWOUhctkv7MQ/L9yS8seWN0Yp1AlZ8gBDMBjRBY 1wWRDcCPBNTy00xUCQo9bq7EEOY7RlloJ/nRG6IQhMhXo1Llx2YCaUwlm A==; X-CSE-ConnectionGUID: JfHwlxtVRg+g1emRASoLIg== X-CSE-MsgGUID: sMz2pqsjTpeWq/hhEYyTOQ== X-IronPort-AV: E=McAfee;i="6700,10204,11101"; a="32459202" X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="32459202" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2024 08:03:48 -0700 X-CSE-ConnectionGUID: kIiCUcdTTT+8bY/fZ/p4mw== X-CSE-MsgGUID: I4puFs7VRlyQe8qTLhVSUQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="39924947" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 12 Jun 2024 08:03:46 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Ian Stokes , bruce.richardson@intel.com, Przemek Kitszel Subject: [PATCH v2 019/148] net/ice/base: bring back ability to use 128 as size of PF type RSS LUT Date: Wed, 12 Jun 2024 16:00:13 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: <20240430154014.1026-1-ian.stokes@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 From: Ian Stokes Allow PF RSS LUT to be sized 128. Recent refactor simplified code and made it impossible. Also clean up unused defines. Signed-off-by: Przemek Kitszel Signed-off-by: Ian Stokes --- drivers/net/ice/base/ice_adminq_cmd.h | 12 +++--------- drivers/net/ice/base/ice_common.c | 10 +++++++--- drivers/net/ice/ice_ethdev.c | 12 ++++++------ 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/drivers/net/ice/base/ice_adminq_cmd.h b/drivers/net/ice/base/ice_adminq_cmd.h index 3549fc28f1..ab3dfd8685 100644 --- a/drivers/net/ice/base/ice_adminq_cmd.h +++ b/drivers/net/ice/base/ice_adminq_cmd.h @@ -2230,11 +2230,13 @@ enum ice_lut_type { ICE_LUT_VSI = 0, ICE_LUT_PF = 1, ICE_LUT_GLOBAL = 2, - ICE_LUT_TYPE_MASK = 3 + ICE_LUT_TYPE_MASK = 3, + ICE_LUT_PF_SMALL = 5, /* yields ICE_LUT_PF when &= ICE_LUT_TYPE_MASK */ }; enum ice_lut_size { ICE_LUT_VSI_SIZE = 64, + ICE_LUT_PF_SMALL_SIZE = 128, ICE_LUT_GLOBAL_SIZE = 512, ICE_LUT_PF_SIZE = 2048, }; @@ -2249,19 +2251,11 @@ struct ice_aqc_get_set_rss_lut { #define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_M \ (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 -#define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_GLOBAL 2 - #define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_S 2 #define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_M \ (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 -#define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_512 512 #define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_512_FLAG 1 -#define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_2K 2048 #define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_2K_FLAG 2 #define ICE_AQC_GSET_RSS_LUT_GLOBAL_IDX_S 4 diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c index f88ced7a5d..34a4b74956 100644 --- a/drivers/net/ice/base/ice_common.c +++ b/drivers/net/ice/base/ice_common.c @@ -4143,6 +4143,8 @@ static u16 ice_lut_type_to_size(u16 lut_type) return ICE_LUT_GLOBAL_SIZE; case ICE_LUT_PF: return ICE_LUT_PF_SIZE; + case ICE_LUT_PF_SMALL: + return ICE_LUT_PF_SMALL_SIZE; default: return 0; } @@ -4174,6 +4176,8 @@ int ice_lut_size_to_type(int lut_size) return ICE_LUT_GLOBAL; case ICE_LUT_PF_SIZE: return ICE_LUT_PF; + case ICE_LUT_PF_SMALL_SIZE: + return ICE_LUT_PF_SMALL; default: return -1; } @@ -4201,10 +4205,10 @@ __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; - lut_type = params->lut_type; - lut_size = ice_lut_type_to_size(lut_type); + lut_size = ice_lut_type_to_size(params->lut_type); + lut_type = params->lut_type & ICE_LUT_TYPE_MASK; cmd_resp = &desc.params.get_set_rss_lut; - if (lut_type == ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_GLOBAL) + if (lut_type == ICE_LUT_GLOBAL) glob_lut_idx = params->global_lut_id; if (!lut || !lut_size || !ice_is_vsi_valid(hw, vsi_handle)) diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 87385d2649..56adc3a3d9 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -3468,7 +3468,7 @@ static int ice_init_rss(struct ice_pf *pf) lut_params.vsi_handle = vsi->idx; lut_params.lut_size = vsi->rss_lut_size; - lut_params.lut_type = ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF; + lut_params.lut_type = ICE_LUT_PF; lut_params.lut = vsi->rss_lut; lut_params.global_lut_id = 0; ret = ice_aq_set_rss_lut(hw, &lut_params); @@ -4928,7 +4928,7 @@ ice_get_rss_lut(struct ice_vsi *vsi, uint8_t *lut, uint16_t lut_size) if (pf->flags & ICE_FLAG_RSS_AQ_CAPABLE) { lut_params.vsi_handle = vsi->idx; lut_params.lut_size = lut_size; - lut_params.lut_type = ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF; + lut_params.lut_type = ICE_LUT_PF; lut_params.lut = lut; lut_params.global_lut_id = 0; ret = ice_aq_get_rss_lut(hw, &lut_params); @@ -4964,7 +4964,7 @@ ice_set_rss_lut(struct ice_vsi *vsi, uint8_t *lut, uint16_t lut_size) if (pf->flags & ICE_FLAG_RSS_AQ_CAPABLE) { lut_params.vsi_handle = vsi->idx; lut_params.lut_size = lut_size; - lut_params.lut_type = ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF; + lut_params.lut_type = ICE_LUT_PF; lut_params.lut = lut; lut_params.global_lut_id = 0; ret = ice_aq_set_rss_lut(hw, &lut_params); @@ -4996,9 +4996,9 @@ ice_rss_reta_update(struct rte_eth_dev *dev, uint8_t *lut; int ret; - if (reta_size != ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_128 && - reta_size != ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_512 && - reta_size != ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_2K) { + if (reta_size != ICE_LUT_PF_SMALL_SIZE && + reta_size != ICE_LUT_GLOBAL_SIZE && + reta_size != ICE_LUT_PF_SIZE) { PMD_DRV_LOG(ERR, "The size of hash lookup table configured (%d)" "doesn't match the number hardware can " -- 2.43.0