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

Anatoly Burakov
2026-02-19T16:24:59Z

Currently, when processing admin queue messages, we are using rte_zmalloc
followed by an immediate rte_free. This memory does not need to be stored
in hugepage memory, so replace it with stack allocation.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
drivers/net/intel/i40e/i40e_ethdev.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/net/intel/i40e/i40e_ethdev.c b/drivers/net/intel/i40e/i40e_ethdev.c
index 72ff2ea59c..fff832fba1 100644
--- a/drivers/net/intel/i40e/i40e_ethdev.c
+++ b/drivers/net/intel/i40e/i40e_ethdev.c
@@ -6872,14 +6872,11 @@ i40e_dev_handle_aq_msg(struct rte_eth_dev *dev)
struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
struct i40e_arq_event_info info;
uint16_t pending, opcode;
+ uint8_t msg_buf[I40E_AQ_BUF_SZ] = {0};
int ret;

- info.buf_len = I40E_AQ_BUF_SZ;
- info.msg_buf = rte_zmalloc("msg_buffer", info.buf_len, 0);
- if (!info.msg_buf) {
- PMD_DRV_LOG(ERR, "Failed to allocate mem");
- return;
- }
+ info.buf_len = sizeof(msg_buf);
+ info.msg_buf = msg_buf;

pending = 1;
while (pending) {
@@ -6915,7 +6912,6 @@ i40e_dev_handle_aq_msg(struct rte_eth_dev *dev)
break;
}
}
- rte_free(info.msg_buf);
}

static void
--
2.47.3