From: Shai Brandes <shaibran@amazon.com>
To: <stephen@networkplumber.org>
Cc: <dev@dpdk.org>, Shai Brandes <shaibran@amazon.com>,
Amit Bernstein <amitbern@amazon.com>
Subject: [PATCH 08/21] net/ena: rework sanity checks
Date: Wed, 15 Oct 2025 10:10:24 +0300 [thread overview]
Message-ID: <20251015071024.602-1-shaibran@amazon.com> (raw)
1. Accurately check the return status of rte_intr_callback_unregister_sync
2. Add sanity checks of ring pointer on IO queue release
Signed-off-by: Amit Bernstein <amitbern@amazon.com>
Signed-off-by: Shai Brandes <shaibran@amazon.com>
Reviewed-by: Yosef Raisman <yraisman@amazon.com>
---
drivers/net/ena/ena_ethdev.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index a2863f1e22..568aca1152 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -939,8 +939,8 @@ static int ena_close(struct rte_eth_dev *dev)
if (!adapter->control_path_poll_interval) {
rte_intr_disable(intr_handle);
rc = rte_intr_callback_unregister_sync(intr_handle, ena_control_path_handler, dev);
- if (unlikely(rc != 0))
- PMD_INIT_LOG_LINE(ERR, "Failed to unregister interrupt handler");
+ if (unlikely(rc < 0))
+ PMD_INIT_LOG_LINE(ERR, "Failed to unregister interrupt handler (%d)", rc);
} else {
rte_eal_alarm_cancel(ena_control_path_poll_handler, dev);
}
@@ -1020,6 +1020,9 @@ static void ena_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid)
{
struct ena_ring *ring = dev->data->rx_queues[qid];
+ if (!ring)
+ return;
+
/* Free ring resources */
rte_free(ring->rx_buffer_info);
ring->rx_buffer_info = NULL;
@@ -1040,6 +1043,9 @@ static void ena_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid)
{
struct ena_ring *ring = dev->data->tx_queues[qid];
+ if (!ring)
+ return;
+
/* Free ring resources */
rte_free(ring->push_buf_intermediate_buf);
--
2.17.1
reply other threads:[~2025-10-15 7:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20251015071024.602-1-shaibran@amazon.com \
--to=shaibran@amazon.com \
--cc=amitbern@amazon.com \
--cc=dev@dpdk.org \
--cc=stephen@networkplumber.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;
as well as URLs for NNTP newsgroup(s).