[PATCH v4 19/27] net/iavf: avoid rte malloc in RSS configuration

Burakov, Anatoly anatoly.burakov at intel.com
Wed Feb 18 11:45:04 CET 2026


On 2/16/2026 6:24 PM, Bruce Richardson wrote:
> On Fri, Feb 13, 2026 at 10:26:30AM +0000, Anatoly Burakov wrote:
>> Currently, when configuring RSS (redirection table, lookup table, and
>> hash key), we are using rte_zmalloc followed by an immediate rte_free.
>> This is not needed as this memory is not being stored anywhere, so
>> replace it with regular malloc/free.
>>
>> Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
>> ---
>>   drivers/net/intel/iavf/iavf_ethdev.c | 4 ++--
>>   drivers/net/intel/iavf/iavf_vchnl.c  | 8 ++++----
>>   2 files changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/net/intel/iavf/iavf_ethdev.c b/drivers/net/intel/iavf/iavf_ethdev.c
>> index 70eb7e7ec5..d3fa47fd5e 100644
>> --- a/drivers/net/intel/iavf/iavf_ethdev.c
>> +++ b/drivers/net/intel/iavf/iavf_ethdev.c
>> @@ -1554,7 +1554,7 @@ iavf_dev_rss_reta_update(struct rte_eth_dev *dev,
>>   		return -EINVAL;
>>   	}
>>   
>> -	lut = rte_zmalloc("rss_lut", reta_size, 0);
>> +	lut = calloc(1, reta_size);
> 
> As with i40e, can we make this (and the key allocation below) static based
> on max sizes supported?
> 

It depends. Technically, IAVF does not specify "max size", it is 
whatever PF reports. In practice, the biggest we're going to get (i.e. 
the biggest supported by i40e and ice) is 512, so we could hardcode that.

Similarly for RSS key, technically we don't know how big an RSS key we 
can support. In practice, both ice and i40e only support 52-byte keys, 
so we could hardcode that.

So, on the one hand, hardcoding this goes against every fiber of my 
being because "IAVF doesn't know", but on the other we *know* these 
values in practice. Which voice should I be listening to? :)

-- 
Thanks,
Anatoly


More information about the dev mailing list