On Fri, May 08, 2026 at 05:12:26AM +0200, Aleksandr Loktionov wrote:
> From: Alexander Duyck <[email protected]>
> 
> ixgbe_set_itr() clears the mode flag (IXGBE_ITR_ADAPTIVE_LATENCY, bit 7)
> with the open-coded complement expression ~IXGBE_ITR_ADAPTIVE_LATENCY.
> This is equivalent to keeping only bits [6:0], i.e. the usecs sub-field.
> 
> Add IXGBE_ITR_ADAPTIVE_MASK_USECS = IXGBE_ITR_ADAPTIVE_LATENCY - 1 =
> 0x7F to name this mask explicitly and replace the open-coded AND-NOT
> operation with the cleaner AND form.  The two expressions are
> arithmetically identical; the change improves readability.
> 
> Signed-off-by: Alexander Duyck <[email protected]>
> Signed-off-by: Aleksandr Loktionov <[email protected]>

Reviewed-by: Simon Horman <[email protected]>

...

> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c 
> b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> index ba7b013..be40655 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> @@ -2959,7 +2959,7 @@ static void ixgbe_set_itr(struct ixgbe_q_vector 
> *q_vector)
>       new_itr = min(q_vector->rx.itr, q_vector->tx.itr);

FTR: The AI-generated review of this patch points out that
     the correct comparison above should mask the above values
     first. I did not look carefully, but given my recollection
     of this function that does make sense. And perhaps it is something
     that could be considered as a follow-up. (I am not suggesting
     expanding the scope of this patch or patch-set.)

>  
>       /* Clear latency flag if set, shift into correct position */
> -     new_itr &= ~IXGBE_ITR_ADAPTIVE_LATENCY;
> +     new_itr &= IXGBE_ITR_ADAPTIVE_MASK_USECS;
>       new_itr <<= 2;
>  
>       if (new_itr != q_vector->itr) {
> -- 
> 2.52.0
> 

Reply via email to