From patchwork Thu Jul 11 18:13:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Nguyen X-Patchwork-Id: 13730995 X-Patchwork-Delegate: kuba@kernel.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 275BD16D9A9 for ; Thu, 11 Jul 2024 18:13:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720721608; cv=none; b=Xa9kvtglwou/B7pKc1DEw160UsgPvwpbszvIl8Qq/xaE6E66ODDdHxVT990ZZQLC4Ge1CNiO/SttTsI5f3qjfyGSBvIJEU/Xi45WY2piJtGcEqmcekolpS40FjINEq7U/2tImc3//w/FjQdrq4yuksfIQqe5rk7Pv8zQx2/+ZOE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720721608; c=relaxed/simple; bh=NUdRG6Iey6b7yNi5gM6/EHiKqRwolwGjoc8/eEmCFNs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ngf6SbyeQ+kdWkTLiNkVjjAwbnK5fjh+90VkO4tF/jWu0BKtZZrVhSjqrkrUMrY2haJZH4W7DN0Q33Z18qa3jW+kqIJ18hcPK1pUZ1TDeDOXNFXzj43qQ1saJMXQs+wEE6uMVT3xBXABj6yZCXNZtv4jD9hac7dcj5ZO+ApUyF0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=azzeWEAk; arc=none smtp.client-ip=198.175.65.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="azzeWEAk" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1720721607; x=1752257607; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NUdRG6Iey6b7yNi5gM6/EHiKqRwolwGjoc8/eEmCFNs=; b=azzeWEAkeY+7O+6UcvjEwKrvj5G2Dv3zCkz3PkgvtL8FJI3g8j5CUBtD 2rfVqrh2wsjIkDEK9sdR7nUm/kY0rhJaaiNGi8jNMZWSbiIeSjYaKlbxA 0DhTgcndNcnDjFpmDqEtKmfj14p2xV4j3YJ78XYXYaoI+P/IRzNmri9QX drISE2j22RQSGvBNKftnj0ngTRDnFaBxXtYG4rzjp6cnNXK6OUG0OOwFp +BusEG/KzFX8mQoMwht4MiM/WiZiqJthV/56NW0gCiTKEctYmbxiNrd5P luFvBDTkdbaXGKztsYsCZyKv3Q/DpGcvmK66Wa0ylkI0uWQhuSwro/Gp+ A==; X-CSE-ConnectionGUID: 8lkMjI//TEONNoGpg2lJHA== X-CSE-MsgGUID: 3ez3S/qTRhKjuGkMrjaYtA== X-IronPort-AV: E=McAfee;i="6700,10204,11130"; a="28720926" X-IronPort-AV: E=Sophos;i="6.09,200,1716274800"; d="scan'208";a="28720926" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jul 2024 11:13:26 -0700 X-CSE-ConnectionGUID: 3GdjfsQrQESlUY0vsUnXkA== X-CSE-MsgGUID: GyoMB4q9Tee3DiFqhLmjXg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,200,1716274800"; d="scan'208";a="48390888" Received: from anguy11-upstream.jf.intel.com ([10.166.9.133]) by fmviesa006.fm.intel.com with ESMTP; 11 Jul 2024 11:13:25 -0700 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com, netdev@vger.kernel.org Cc: Marcin Szycik , anthony.l.nguyen@intel.com, Przemek Kitszel , Sujai Buvaneswaran Subject: [PATCH net-next 1/7] ice: Remove unused struct ice_prot_lkup_ext members Date: Thu, 11 Jul 2024 11:13:04 -0700 Message-ID: <20240711181312.2019606-2-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240711181312.2019606-1-anthony.l.nguyen@intel.com> References: <20240711181312.2019606-1-anthony.l.nguyen@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Marcin Szycik Remove field_off as it's never used. Remove done bitmap, as its value is only checked and never assigned. Reusing sub-recipes while creating new root recipes is currently not supported in the driver. Reviewed-by: Przemek Kitszel Signed-off-by: Marcin Szycik Tested-by: Sujai Buvaneswaran Signed-off-by: Tony Nguyen --- .../ethernet/intel/ice/ice_protocol_type.h | 4 -- drivers/net/ethernet/intel/ice/ice_switch.c | 44 ++++++++----------- 2 files changed, 19 insertions(+), 29 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_protocol_type.h b/drivers/net/ethernet/intel/ice/ice_protocol_type.h index 755a9c55267c..c396dabacef4 100644 --- a/drivers/net/ethernet/intel/ice/ice_protocol_type.h +++ b/drivers/net/ethernet/intel/ice/ice_protocol_type.h @@ -452,13 +452,9 @@ struct ice_prot_lkup_ext { u16 prot_type; u8 n_val_words; /* create a buffer to hold max words per recipe */ - u16 field_off[ICE_MAX_CHAIN_WORDS]; u16 field_mask[ICE_MAX_CHAIN_WORDS]; struct ice_fv_word fv_words[ICE_MAX_CHAIN_WORDS]; - - /* Indicate field offsets that have field vector indices assigned */ - DECLARE_BITMAP(done, ICE_MAX_CHAIN_WORDS); }; struct ice_pref_recipe_group { diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c index 1191031b2a43..0d58cf185698 100644 --- a/drivers/net/ethernet/intel/ice/ice_switch.c +++ b/drivers/net/ethernet/intel/ice/ice_switch.c @@ -4918,33 +4918,27 @@ ice_create_first_fit_recp_def(struct ice_hw *hw, *recp_cnt = 0; - /* Walk through every word in the rule to check if it is not done. If so - * then this word needs to be part of a new recipe. - */ - for (j = 0; j < lkup_exts->n_val_words; j++) - if (!test_bit(j, lkup_exts->done)) { - if (!grp || - grp->n_val_pairs == ICE_NUM_WORDS_RECIPE) { - struct ice_recp_grp_entry *entry; - - entry = devm_kzalloc(ice_hw_to_dev(hw), - sizeof(*entry), - GFP_KERNEL); - if (!entry) - return -ENOMEM; - list_add(&entry->l_entry, rg_list); - grp = &entry->r_group; - (*recp_cnt)++; - } - - grp->pairs[grp->n_val_pairs].prot_id = - lkup_exts->fv_words[j].prot_id; - grp->pairs[grp->n_val_pairs].off = - lkup_exts->fv_words[j].off; - grp->mask[grp->n_val_pairs] = lkup_exts->field_mask[j]; - grp->n_val_pairs++; + for (j = 0; j < lkup_exts->n_val_words; j++) { + if (!grp || grp->n_val_pairs == ICE_NUM_WORDS_RECIPE) { + struct ice_recp_grp_entry *entry; + + entry = devm_kzalloc(ice_hw_to_dev(hw), sizeof(*entry), + GFP_KERNEL); + if (!entry) + return -ENOMEM; + + list_add(&entry->l_entry, rg_list); + grp = &entry->r_group; + (*recp_cnt)++; } + grp->pairs[grp->n_val_pairs].prot_id = + lkup_exts->fv_words[j].prot_id; + grp->pairs[grp->n_val_pairs].off = lkup_exts->fv_words[j].off; + grp->mask[grp->n_val_pairs] = lkup_exts->field_mask[j]; + grp->n_val_pairs++; + } + return 0; }