[PATCH v2 10/26] net/i40e: avoid rte malloc in RSS RETA operations

Anatoly Burakov
2026-02-10T16:15:14Z

Currently, when updating or querying RSS redirection table (RETA), 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@intel.com>
---
drivers/net/intel/i40e/i40e_ethdev.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/intel/i40e/i40e_ethdev.c b/drivers/net/intel/i40e/i40e_ethdev.c
index 06430e6319..654b0e5d16 100644
--- a/drivers/net/intel/i40e/i40e_ethdev.c
+++ b/drivers/net/intel/i40e/i40e_ethdev.c
@@ -4630,7 +4630,7 @@ i40e_dev_rss_reta_update(struct rte_eth_dev *dev,
return -EINVAL;
}

- lut = rte_zmalloc("i40e_rss_lut", reta_size, 0);
+ lut = calloc(1, reta_size);
if (!lut) {
PMD_DRV_LOG(ERR, "No memory can be allocated");
return -ENOMEM;
@@ -4649,7 +4649,7 @@ i40e_dev_rss_reta_update(struct rte_eth_dev *dev,
pf->adapter->rss_reta_updated = 1;

out:
- rte_free(lut);
+ free(lut);

return ret;
}
@@ -4673,7 +4673,7 @@ i40e_dev_rss_reta_query(struct rte_eth_dev *dev,
return -EINVAL;
}

- lut = rte_zmalloc("i40e_rss_lut", reta_size, 0);
+ lut = calloc(1, reta_size);
if (!lut) {
PMD_DRV_LOG(ERR, "No memory can be allocated");
return -ENOMEM;
@@ -4690,7 +4690,7 @@ i40e_dev_rss_reta_query(struct rte_eth_dev *dev,
}

out:
- rte_free(lut);
+ free(lut);

return ret;
}
--
2.47.3