DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/2] net/iavf: fix missing check for interrupt errors
@ 2025-03-10 13:11 Bruce Richardson
  2025-03-10 13:11 ` [PATCH 2/2] net/iavf: fix crash on app exit on FreeBSD Bruce Richardson
  0 siblings, 1 reply; 2+ messages in thread
From: Bruce Richardson @ 2025-03-10 13:11 UTC (permalink / raw)
  To: dev; +Cc: Vladimir Medvedkin, Bruce Richardson, stable

When registering interrupts, there was no check if the registration of
the interrupt succeeded. Add in such a check, and go to fallback path
if the check fails. This prevents errors on FreeBSD due to missed
admin queue messages.

Fixes: cd3b124955d4 ("net/iavf: enable interrupt polling")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/intel/iavf/iavf_ethdev.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/net/intel/iavf/iavf_ethdev.c b/drivers/net/intel/iavf/iavf_ethdev.c
index 9cd2b0c867..1ab84b0bfc 100644
--- a/drivers/net/intel/iavf/iavf_ethdev.c
+++ b/drivers/net/intel/iavf/iavf_ethdev.c
@@ -2825,18 +2825,16 @@ iavf_dev_init(struct rte_eth_dev *eth_dev)
 			&eth_dev->data->mac_addrs[0]);
 
 
-	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR) {
-		/* register callback func to eal lib */
-		rte_intr_callback_register(pci_dev->intr_handle,
-					   iavf_dev_interrupt_handler,
-					   (void *)eth_dev);
+	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR &&
+			/* register callback func to eal lib */
+			rte_intr_callback_register(pci_dev->intr_handle,
+				   iavf_dev_interrupt_handler, (void *)eth_dev) == 0)
 
 		/* enable uio intr after callback register */
 		rte_intr_enable(pci_dev->intr_handle);
-	} else {
+	else
 		rte_eal_alarm_set(IAVF_ALARM_INTERVAL,
 				  iavf_dev_alarm_handler, eth_dev);
-	}
 
 	/* configure and enable device interrupt */
 	iavf_enable_irq0(hw);
-- 
2.43.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 2/2] net/iavf: fix crash on app exit on FreeBSD
  2025-03-10 13:11 [PATCH 1/2] net/iavf: fix missing check for interrupt errors Bruce Richardson
@ 2025-03-10 13:11 ` Bruce Richardson
  0 siblings, 0 replies; 2+ messages in thread
From: Bruce Richardson @ 2025-03-10 13:11 UTC (permalink / raw)
  To: dev; +Cc: Vladimir Medvedkin, Bruce Richardson, stable

With the fallback interrupt path now enabled on FreeBSD there are
segmentation faults on app exit, due to the alarm interrupt trying to
access invalid pointers.  Add checks for null to fix these crashes.

Fixes: cd3b124955d4 ("net/iavf: enable interrupt polling")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/intel/iavf/iavf_ethdev.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/intel/iavf/iavf_ethdev.c b/drivers/net/intel/iavf/iavf_ethdev.c
index 1ab84b0bfc..2335746f04 100644
--- a/drivers/net/intel/iavf/iavf_ethdev.c
+++ b/drivers/net/intel/iavf/iavf_ethdev.c
@@ -2698,6 +2698,9 @@ void
 iavf_dev_alarm_handler(void *param)
 {
 	struct rte_eth_dev *dev = (struct rte_eth_dev *)param;
+	if (dev == NULL || dev->data == NULL || dev->data->dev_private == NULL)
+		return;
+
 	struct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	uint32_t icr0;
 
-- 
2.43.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-03-10 13:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-10 13:11 [PATCH 1/2] net/iavf: fix missing check for interrupt errors Bruce Richardson
2025-03-10 13:11 ` [PATCH 2/2] net/iavf: fix crash on app exit on FreeBSD Bruce Richardson

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).