[PATCH v3 06/27] net/i40e: use unsigned types for queue comparisons

Burakov, Anatoly anatoly.burakov at intel.com
Fri Feb 13 11:30:46 CET 2026


On 2/11/2026 10:03 PM, Morten Brørup wrote:
>> Currently, when we compare queue numbers against maximum traffic class
>> value of 64, we do not use unsigned values, which results in compiler
>> warning when attempting to compare `I40E_MAX_Q_PER_TC` to an unsigned
>> value. Make it unsigned, and adjust callers to use correct types. As a
>> consequence, `i40e_align_floor` now returns unsigned value as well -
>> this
>> is correct, because nothing about that function implies signed usage
>> being
>> a valid use case.
>>
>> Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
>> ---
>>   drivers/net/intel/i40e/i40e_ethdev.c | 2 +-
>>   drivers/net/intel/i40e/i40e_ethdev.h | 6 +++---
>>   drivers/net/intel/i40e/i40e_hash.c   | 4 ++--
>>   3 files changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/net/intel/i40e/i40e_ethdev.c
>> b/drivers/net/intel/i40e/i40e_ethdev.c
>> index 2deb87b01b..d5c61cd577 100644
>> --- a/drivers/net/intel/i40e/i40e_ethdev.c
>> +++ b/drivers/net/intel/i40e/i40e_ethdev.c
>> @@ -9058,7 +9058,7 @@ i40e_pf_reset_rss_reta(struct i40e_pf *pf)
>>   	struct i40e_hw *hw = &pf->adapter->hw;
>>   	uint8_t lut[RTE_ETH_RSS_RETA_SIZE_512];
>>   	uint32_t i;
>> -	int num;
>> +	size_t num;
> 
> Why not just unsigned int? size_t seems weird when not counting bytes.
> 
> Or uint16_t, considering its use.
> 


>>   	struct i40e_pf *pf;
>>   	struct i40e_hw *hw;
>>   	uint16_t i;
>> -	int max_queue;
>> +	size_t max_queue;
> 
> Why not just unsigned int? size_t seems weird when not counting bytes.
> 
> Or uint16_t, like rss_act->queue[i].
> But then I40E_MAX_Q_PER_TC should maybe also be defined as UINT16_C(64), and maybe more should be uint16_t too.

Good points. Missed this in v4 respin so will address in v5. Thanks for 
the review!

-- 
Thanks,
Anatoly


More information about the dev mailing list