From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>,
Anatoly Burakov <anatoly.burakov@intel.com>
Subject: [PATCH v3 1/2] net/ice: remove malloc call for admin queue msg
Date: Mon, 2 Mar 2026 11:48:41 +0000 [thread overview]
Message-ID: <20260302114842.946182-2-bruce.richardson@intel.com> (raw)
In-Reply-To: <20260302114842.946182-1-bruce.richardson@intel.com>
The max message size is defined as 4k, so we don't need a special
malloc/free (and especially not rte_malloc/rte_free) for each call into
the function - especially if no data is present. Replace the malloc
calls with a local memory buffer instead.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
drivers/net/intel/ice/ice_ethdev.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/drivers/net/intel/ice/ice_ethdev.c b/drivers/net/intel/ice/ice_ethdev.c
index 0d6b030536..a59ca2e047 100644
--- a/drivers/net/intel/ice/ice_ethdev.c
+++ b/drivers/net/intel/ice/ice_ethdev.c
@@ -1440,17 +1440,14 @@ ice_handle_aq_msg(struct rte_eth_dev *dev)
{
struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
struct ice_ctl_q_info *cq = &hw->adminq;
- struct ice_rq_event_info event;
+ unsigned char buf[ICE_AQ_MAX_BUF_LEN] = {0};
+ struct ice_rq_event_info event = {
+ .msg_buf = buf,
+ .buf_len = sizeof(buf),
+ };
uint16_t pending, opcode;
int ret;
- event.buf_len = ICE_AQ_MAX_BUF_LEN;
- event.msg_buf = rte_zmalloc(NULL, event.buf_len, 0);
- if (!event.msg_buf) {
- PMD_DRV_LOG(ERR, "Failed to allocate mem");
- return;
- }
-
pending = 1;
while (pending) {
ret = ice_clean_rq_elem(hw, cq, &event, &pending);
@@ -1477,7 +1474,6 @@ ice_handle_aq_msg(struct rte_eth_dev *dev)
break;
}
}
- rte_free(event.msg_buf);
}
#endif
--
2.51.0
next prev parent reply other threads:[~2026-03-02 11:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-27 11:02 [PATCH] net/ice: get link status updates via adminq message Bruce Richardson
2026-02-27 11:41 ` [PATCH v2] " Bruce Richardson
2026-03-02 11:48 ` [PATCH v3 0/2] " Bruce Richardson
2026-03-02 11:48 ` Bruce Richardson [this message]
2026-03-02 11:48 ` [PATCH v3 2/2] " Bruce Richardson
2026-03-03 16:21 ` [PATCH v4 0/2] " Bruce Richardson
2026-03-03 16:21 ` [PATCH v4 1/2] net/ice: remove malloc call for admin queue msg Bruce Richardson
2026-03-04 11:59 ` Loftus, Ciara
2026-03-03 16:21 ` [PATCH v4 2/2] net/ice: get link status updates via adminq message Bruce Richardson
2026-03-04 11:56 ` Loftus, Ciara
2026-03-04 9:58 ` [PATCH v4 0/2] " Bruce Richardson
2026-03-05 12:53 ` David Marchand
2026-03-05 15:15 ` Bruce Richardson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260302114842.946182-2-bruce.richardson@intel.com \
--to=bruce.richardson@intel.com \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox