From: Shai Brandes <shaibran@amazon.com>
To: <stephen@networkplumber.org>
Cc: <dev@dpdk.org>, Shai Brandes <shaibran@amazon.com>, <stable@dpdk.org>
Subject: [PATCH 5/8] net/ena: fix unhandled interrupt config failure
Date: Wed, 21 May 2025 17:04:32 +0300 [thread overview]
Message-ID: <20250521140432.2643-1-shaibran@amazon.com> (raw)
Fixed the device initialization routine to correctly handle
failure during the registration or enabling of interrupts
when operating in control path interrupt mode.
Fixes: ca1dfa85f0d3 ("net/ena: add control path pure polling mode")
Cc: stable@dpdk.org
Signed-off-by: Shai Brandes <shaibran@amazon.com>
Reviewed-by: Amit Bernstein <amitbern@amazon.com>
Reviewed-by: Yosef Raisman <yraisman@amazon.com>
---
doc/guides/rel_notes/release_25_07.rst | 2 ++
drivers/net/ena/ena_ethdev.c | 20 ++++++++++++++++++--
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/doc/guides/rel_notes/release_25_07.rst b/doc/guides/rel_notes/release_25_07.rst
index 07b5feabc4..e7fecace4f 100644
--- a/doc/guides/rel_notes/release_25_07.rst
+++ b/doc/guides/rel_notes/release_25_07.rst
@@ -59,6 +59,8 @@ New Features
* Added support for enabling fragment bypass mode for egress packets.
This mode bypasses the PPS limit enforced by EC2 for fragmented egress packets on every ENI.
+ * Fixed the device initialization routine to correctly handle failure during the registration
+ or enabling of interrupts when operating in control path interrupt mode.
* **Added Mucse rnp net driver.**
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 4caad9006e..f26f08ca85 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -2465,8 +2465,16 @@ static int eth_ena_dev_init(struct rte_eth_dev *eth_dev)
if (!adapter->control_path_poll_interval) {
/* Control path interrupt mode */
- rte_intr_callback_register(intr_handle, ena_control_path_handler, eth_dev);
- rte_intr_enable(intr_handle);
+ rc = rte_intr_callback_register(intr_handle, ena_control_path_handler, eth_dev);
+ if (unlikely(rc < 0)) {
+ PMD_DRV_LOG_LINE(ERR, "Failed to register control path interrupt");
+ goto err_stats_destroy;
+ }
+ rc = rte_intr_enable(intr_handle);
+ if (unlikely(rc < 0)) {
+ PMD_DRV_LOG_LINE(ERR, "Failed to enable control path interrupt");
+ goto err_control_path_destroy;
+ }
ena_com_set_admin_polling_mode(ena_dev, false);
} else {
/* Control path polling mode */
@@ -2485,6 +2493,14 @@ static int eth_ena_dev_init(struct rte_eth_dev *eth_dev)
return 0;
err_control_path_destroy:
+ if (!adapter->control_path_poll_interval) {
+ rc = rte_intr_callback_unregister_sync(intr_handle,
+ ena_control_path_handler,
+ eth_dev);
+ if (unlikely(rc < 0))
+ PMD_INIT_LOG_LINE(ERR, "Failed to unregister interrupt handler");
+ }
+err_stats_destroy:
rte_free(adapter->drv_stats);
err_indirect_table_destroy:
ena_indirect_table_release(adapter);
--
2.17.1
reply other threads:[~2025-05-21 14:05 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=20250521140432.2643-1-shaibran@amazon.com \
--to=shaibran@amazon.com \
--cc=dev@dpdk.org \
--cc=stable@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).