Subject: Re: [PATCH net-next v2 05/14] ice: improve TCAM priority handling for RSS profiles

From: Jakub Kicinski <[email-masked]>
Date: Mon, 20 Oct 2025 18:16:44 -0700

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_* ?