[11/35] net/ionic: only allocate interrupts if required

Message ID 20221007174336.54354-12-andrew.boyer@amd.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series net/ionic: updates for 22.11 release |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Boyer, Andrew Oct. 7, 2022, 5:43 p.m. UTC
  There is no need to allocate the interrupt vector list if
datapath packet interrupts are not enabled.
This conserves resources.

Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
---
 drivers/net/ionic/ionic_ethdev.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
  

Patch

diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
index 815b7e3c9e..efea691b8f 100644
--- a/drivers/net/ionic/ionic_ethdev.c
+++ b/drivers/net/ionic/ionic_ethdev.c
@@ -1082,14 +1082,16 @@  ionic_configure_intr(struct ionic_adapter *adapter)
 		return -1;
 	}
 
-	if (rte_intr_dp_is_en(intr_handle))
+	if (rte_intr_dp_is_en(intr_handle)) {
 		IONIC_PRINT(DEBUG,
 			"Packet I/O interrupt on datapath is enabled");
 
-	if (rte_intr_vec_list_alloc(intr_handle, "intr_vec", adapter->nintrs)) {
-		IONIC_PRINT(ERR, "Failed to allocate %u vectors",
-			    adapter->nintrs);
-		return -ENOMEM;
+		if (rte_intr_vec_list_alloc(intr_handle, "intr_vec",
+						adapter->nintrs)) {
+			IONIC_PRINT(ERR, "Failed to allocate %u vectors",
+				adapter->nintrs);
+			return -ENOMEM;
+		}
 	}
 
 	err = rte_intr_callback_register(intr_handle,