[PATCH v4 24/27] net/ice: avoid rte malloc in RSS RETA operations

Anatoly Burakov
2026-02-13T10:29:34Z

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/ice/ice_dcf_ethdev.c | 4 ++--
drivers/net/intel/ice/ice_ethdev.c | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/intel/ice/ice_dcf_ethdev.c b/drivers/net/intel/ice/ice_dcf_ethdev.c
index 81da5a4656..037382b336 100644
--- a/drivers/net/intel/ice/ice_dcf_ethdev.c
+++ b/drivers/net/intel/ice/ice_dcf_ethdev.c
@@ -1338,7 +1338,7 @@ ice_dcf_dev_rss_reta_update(struct rte_eth_dev *dev,
return -EINVAL;
}

- lut = rte_zmalloc("rss_lut", reta_size, 0);
+ lut = calloc(1, reta_size);
if (!lut) {
PMD_DRV_LOG(ERR, "No memory can be allocated");
return -ENOMEM;
@@ -1358,7 +1358,7 @@ ice_dcf_dev_rss_reta_update(struct rte_eth_dev *dev,
ret = ice_dcf_configure_rss_lut(hw);
if (ret) /* revert back */
rte_memcpy(hw->rss_lut, lut, reta_size);
- rte_free(lut);
+ free(lut);

return ret;
}
diff --git a/drivers/net/intel/ice/ice_ethdev.c b/drivers/net/intel/ice/ice_ethdev.c
index ade13600de..fbd7c0f2f2 100644
--- a/drivers/net/intel/ice/ice_ethdev.c
+++ b/drivers/net/intel/ice/ice_ethdev.c
@@ -5583,7 +5583,7 @@ ice_rss_reta_update(struct rte_eth_dev *dev,
/* It MUST use the current LUT size to get the RSS lookup table,
* otherwise if will fail with -100 error code.
*/
- lut = rte_zmalloc(NULL, RTE_MAX(reta_size, lut_size), 0);
+ lut = calloc(1, RTE_MAX(reta_size, lut_size));
if (!lut) {
PMD_DRV_LOG(ERR, "No memory can be allocated");
return -ENOMEM;
@@ -5607,7 +5607,7 @@ ice_rss_reta_update(struct rte_eth_dev *dev,
}

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

return ret;
}
@@ -5632,7 +5632,7 @@ ice_rss_reta_query(struct rte_eth_dev *dev,
return -EINVAL;
}

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

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

return ret;
}
--
2.47.3