Module Name: src Committed By: msaitoh Date: Wed Jul 10 03:23:02 UTC 2024
Modified Files: src/sys/dev/pci/ixgbe: ixgbe.c ixv.c Log Message: ixgbe: ixgbe is always MP-safe, so remove IXGBE_MPSAFE macro. Before this change, IXGBE_MPSAFE is not defined if NET_MPSAFE is not set. In this case, the PCI_INTR_MPSAFE flag is not set by pci_intr_setattr() and interrupt_distribute() fails on arm. Always enable IXGBE_MPSAFE funciton by removing the macro. To generate a diff of this commit: cvs rdiff -u -r1.352 -r1.353 src/sys/dev/pci/ixgbe/ixgbe.c cvs rdiff -u -r1.196 -r1.197 src/sys/dev/pci/ixgbe/ixv.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/ixgbe/ixgbe.c diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.352 src/sys/dev/pci/ixgbe/ixgbe.c:1.353 --- src/sys/dev/pci/ixgbe/ixgbe.c:1.352 Sat Jun 29 12:11:12 2024 +++ src/sys/dev/pci/ixgbe/ixgbe.c Wed Jul 10 03:23:02 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe.c,v 1.352 2024/06/29 12:11:12 riastradh Exp $ */ +/* $NetBSD: ixgbe.c,v 1.353 2024/07/10 03:23:02 msaitoh Exp $ */ /****************************************************************************** @@ -64,7 +64,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.352 2024/06/29 12:11:12 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.353 2024/07/10 03:23:02 msaitoh Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -412,7 +412,6 @@ static int (*ixgbe_ring_empty)(struct if #endif #ifdef NET_MPSAFE -#define IXGBE_MPSAFE 1 #define IXGBE_CALLOUT_FLAGS CALLOUT_MPSAFE #define IXGBE_SOFTINT_FLAGS SOFTINT_MPSAFE #define IXGBE_WORKQUEUE_FLAGS WQ_PERCPU | WQ_MPSAFE @@ -1385,9 +1384,7 @@ ixgbe_setup_interface(device_t dev, stru ifp->if_stop = ixgbe_ifstop; ifp->if_softc = sc; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; -#ifdef IXGBE_MPSAFE ifp->if_extflags = IFEF_MPSAFE; -#endif ifp->if_ioctl = ixgbe_ioctl; #if __FreeBSD_version >= 1100045 /* TSO parameters */ @@ -6929,10 +6926,9 @@ ixgbe_allocate_msix(struct ixgbe_softc * device_xname(dev), i); intrstr = pci_intr_string(pc, sc->osdep.intrs[i], intrbuf, sizeof(intrbuf)); -#ifdef IXGBE_MPSAFE pci_intr_setattr(pc, &sc->osdep.intrs[i], PCI_INTR_MPSAFE, true); -#endif + /* Set the handler function */ que->res = sc->osdep.ihs[i] = pci_intr_establish_xname(pc, sc->osdep.intrs[i], IPL_NET, ixgbe_msix_que, que, @@ -7034,10 +7030,8 @@ ixgbe_allocate_msix(struct ixgbe_softc * sc->vector = vector; intrstr = pci_intr_string(pc, sc->osdep.intrs[vector], intrbuf, sizeof(intrbuf)); -#ifdef IXGBE_MPSAFE - pci_intr_setattr(pc, &sc->osdep.intrs[vector], PCI_INTR_MPSAFE, - true); -#endif + pci_intr_setattr(pc, &sc->osdep.intrs[vector], PCI_INTR_MPSAFE, true); + /* Set the link handler function */ sc->osdep.ihs[vector] = pci_intr_establish_xname(pc, sc->osdep.intrs[vector], IPL_NET, ixgbe_msix_admin, sc, Index: src/sys/dev/pci/ixgbe/ixv.c diff -u src/sys/dev/pci/ixgbe/ixv.c:1.196 src/sys/dev/pci/ixgbe/ixv.c:1.197 --- src/sys/dev/pci/ixgbe/ixv.c:1.196 Wed Nov 15 03:50:22 2023 +++ src/sys/dev/pci/ixgbe/ixv.c Wed Jul 10 03:23:02 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: ixv.c,v 1.196 2023/11/15 03:50:22 msaitoh Exp $ */ +/* $NetBSD: ixv.c,v 1.197 2024/07/10 03:23:02 msaitoh Exp $ */ /****************************************************************************** @@ -35,7 +35,7 @@ /*$FreeBSD: head/sys/dev/ixgbe/if_ixv.c 331224 2018-03-19 20:55:05Z erj $*/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ixv.c,v 1.196 2023/11/15 03:50:22 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ixv.c,v 1.197 2024/07/10 03:23:02 msaitoh Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -229,7 +229,6 @@ static int ixv_enable_legacy_tx = 0; TUNABLE_INT("hw.ixv.enable_legacy_tx", &ixv_enable_legacy_tx); #ifdef NET_MPSAFE -#define IXGBE_MPSAFE 1 #define IXGBE_CALLOUT_FLAGS CALLOUT_MPSAFE #define IXGBE_SOFTINT_FLAGS SOFTINT_MPSAFE #define IXGBE_WORKQUEUE_FLAGS WQ_PERCPU | WQ_MPSAFE @@ -1657,9 +1656,7 @@ ixv_setup_interface(device_t dev, struct ifp->if_stop = ixv_ifstop; ifp->if_softc = sc; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; -#ifdef IXGBE_MPSAFE ifp->if_extflags = IFEF_MPSAFE; -#endif ifp->if_ioctl = ixv_ioctl; if (sc->feat_en & IXGBE_FEATURE_LEGACY_TX) { #if 0 @@ -3407,10 +3404,9 @@ ixv_allocate_msix(struct ixgbe_softc *sc device_xname(dev), i); intrstr = pci_intr_string(pc, sc->osdep.intrs[i], intrbuf, sizeof(intrbuf)); -#ifdef IXGBE_MPSAFE pci_intr_setattr(pc, &sc->osdep.intrs[i], PCI_INTR_MPSAFE, true); -#endif + /* Set the handler function */ que->res = sc->osdep.ihs[i] = pci_intr_establish_xname(pc, sc->osdep.intrs[i], IPL_NET, ixv_msix_que, que, @@ -3476,10 +3472,8 @@ ixv_allocate_msix(struct ixgbe_softc *sc sc->vector = vector; intrstr = pci_intr_string(pc, sc->osdep.intrs[vector], intrbuf, sizeof(intrbuf)); -#ifdef IXGBE_MPSAFE - pci_intr_setattr(pc, &sc->osdep.intrs[vector], PCI_INTR_MPSAFE, - true); -#endif + pci_intr_setattr(pc, &sc->osdep.intrs[vector], PCI_INTR_MPSAFE, true); + /* Set the mbx handler function */ sc->osdep.ihs[vector] = pci_intr_establish_xname(pc, sc->osdep.intrs[vector], IPL_NET, ixv_msix_mbx, sc, intr_xname);