From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 9553418CBE1; Tue, 21 Oct 2025 01:16:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761009406; cv=none; b=KY+h42IQG2jfeHe9z6HcPeptRZ5uYrHi5R0PW6JTC5u/T1gexucts2l/POK9d20PMnPDij3nOQYYRsPYZWH+PYpqYmbnvo+p/H2/X6ojgszmfDPetO1bxcGvU1WFGhWDN2WMXWWiZJx0ffj3WcIqtd0DB/Ke1mrMSeRdOkqQxA8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761009406; c=relaxed/simple; bh=FlG+exzSWR++/edIMS0S5Y+KS4hcAr0q2UH5cA3Hx28=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=f+kyREmI0HaKSQbCR+VrESx5j3wTmIeqW2ApbzjyYyMx3miutDft7UO7E/QYTPCrYxga7FxChYH/nb50jK0ShNMuFo2u/qUUgAI62HHps0iWTi+hQ8YujTVv0/oo7+baUrHAKpAO7IkbfmwbIfeP1+QxUBol4EpjLpBOVCuIdxI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=f0uN+GWj; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="f0uN+GWj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 664A1C4CEFB; Tue, 21 Oct 2025 01:16:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761009406; bh=FlG+exzSWR++/edIMS0S5Y+KS4hcAr0q2UH5cA3Hx28=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=f0uN+GWjFLqoIVLzDdrkPOJbT42cSjN81WJxOrJIgcS2nsX1w0KLhzoX0J0NTH014 KVlPKkGOEYVYGVfS+O+5zBuHTl/YeI/EjUGjOyioazJl9ZeonnXyIyDK92Ayif48Io l9vW3HBG7tDVxsPrz6l60OXCjb43UCCgpA7zo7DMGE2oWnqNkCAfy+rFQnZxklYnHt 9UQjDk5VRVdEMOrurh1VVtXRensKY+fRyKyHmFax4XS/KiwEQS3X3oprhY3lLDAnWk 1sMtsK4L0gRQxRGOocW0GV9hGfNc2Hx0iCYmDezS790nFbVoH7VApKtg0K1egwkfxI 4n7QqZuvC2TtA== Date: Mon, 20 Oct 2025 18:16:44 -0700 From: Jakub Kicinski To: Jacob Keller Cc: Jiri Pirko , "David S. Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , Jonathan Corbet , Tony Nguyen , Przemek Kitszel , Andrew Lunn , Alexander Lobakin , netdev@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Aleksandr Loktionov , Dan Nowlin , Rafal Romanowski Subject: Re: [PATCH net-next v2 05/14] ice: improve TCAM priority handling for RSS profiles Message-ID: <20251020181644.5b651591@kernel.org> In-Reply-To: <20251016-jk-iwl-next-2025-10-15-v2-5-ff3a390d9fc6@intel.com> References: <20251016-jk-iwl-next-2025-10-15-v2-0-ff3a390d9fc6@intel.com> <20251016-jk-iwl-next-2025-10-15-v2-5-ff3a390d9fc6@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 16 Oct 2025 23:08:34 -0700 Jacob Keller wrote: > +/** > + * ice_set_tcam_flags - set TCAM flag don't care mask > + * @mask: mask for flags > + * @dc_mask: pointer to the don't care mask > + */ > +static void ice_set_tcam_flags(u16 mask, u8 dc_mask[ICE_TCAM_KEY_VAL_SZ]) > +{ > + u16 *flag_word; > + > + /* flags are lowest u16 */ > + flag_word = (u16 *)dc_mask; > + *flag_word = ~mask; Please don't cast pointers to wider types, get_unaligned() exists for a reason. BTW endian also exists, AFAIU, this will do a different thing on BE and LE. > /** > * ice_adj_prof_priorities - adjust profile based on priorities > * @hw: pointer to the HW struct > @@ -3688,10 +3733,17 @@ ice_adj_prof_priorities(struct ice_hw *hw, enum ice_block blk, u16 vsig, > struct list_head *chg) > { > DECLARE_BITMAP(ptgs_used, ICE_XLT1_CNT); > + struct ice_tcam_inf **attr_used; > struct ice_vsig_prof *t; > - int status; > + u16 attr_used_cnt = 0; > + int status = 0; > u16 idx; > > + attr_used = devm_kcalloc(ice_hw_to_dev(hw), ICE_MAX_PTG_ATTRS, attr_used is freed before exiting this function, every time. Why the devm_* ?