[PATCH v5 13/27] net/i40e: avoid rte malloc in adminq operations

Anatoly Burakov
2026-02-17T12:16:12Z

Currently, when processing admin queue messages, we are using rte_zmalloc
followed by an immediate rte_free. This is not needed as the message
buffer is only used temporarily within the function scope, so replace it
with regular malloc/free.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
drivers/net/intel/i40e/i40e_ethdev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/intel/i40e/i40e_ethdev.c b/drivers/net/intel/i40e/i40e_ethdev.c
index 1160acc551..ac465c90a4 100644
--- a/drivers/net/intel/i40e/i40e_ethdev.c
+++ b/drivers/net/intel/i40e/i40e_ethdev.c
@@ -6896,7 +6896,7 @@ i40e_dev_handle_aq_msg(struct rte_eth_dev *dev)
int ret;

info.buf_len = I40E_AQ_BUF_SZ;
- info.msg_buf = rte_zmalloc("msg_buffer", info.buf_len, 0);
+ info.msg_buf = calloc(1, info.buf_len);
if (!info.msg_buf) {
PMD_DRV_LOG(ERR, "Failed to allocate mem");
return;
@@ -6936,7 +6936,7 @@ i40e_dev_handle_aq_msg(struct rte_eth_dev *dev)
break;
}
}
- rte_free(info.msg_buf);
+ free(info.msg_buf);
}

static void
--
2.47.3