Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci/ixgbe Set PCI_INTR_MPSAFE, SOFTINT_MPSAFE, CALLO...
details: https://anonhg.NetBSD.org/src/rev/cda6387718bc
branches: trunk
changeset: 351878:cda6387718bc
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Fri Mar 03 04:37:05 2017 +0000
description:
Set PCI_INTR_MPSAFE, SOFTINT_MPSAFE, CALLOUT_MPSAFE and IFEF_START_MPSAFE
if NET_MPSAFE is defined.
diffstat:
sys/dev/pci/ixgbe/ixgbe.c | 81 +++++++++++++++++++++++++++++-----------------
sys/dev/pci/ixgbe/ixv.c | 39 ++++++++++++++++------
2 files changed, 78 insertions(+), 42 deletions(-)
diffs (263 lines):
diff -r 1f508e40ceb9 -r cda6387718bc sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Fri Mar 03 03:33:44 2017 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Fri Mar 03 04:37:05 2017 +0000
@@ -59,10 +59,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
/*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixgbe.c,v 1.79 2017/02/24 05:38:30 msaitoh Exp $*/
-
+/*$NetBSD: ixgbe.c,v 1.80 2017/03/03 04:37:05 msaitoh Exp $*/
+
+#ifdef _KERNEL_OPT
#include "opt_inet.h"
#include "opt_inet6.h"
+#include "opt_net_mpsafe.h"
+#endif
#include "ixgbe.h"
#include "vlan.h"
@@ -391,6 +394,15 @@
#include <dev/netmap/ixgbe_netmap.h>
#endif /* DEV_NETMAP */
+#ifdef NET_MPSAFE
+#define IXGBE_MPSAFE 1
+#define IXGBE_CALLOUT_FLAGS CALLOUT_MPSAFE
+#define IXGBE_SOFTINFT_FLAGS SOFTINT_MPSAFE
+#else
+#define IXGBE_CALLOUT_FLAGS 0
+#define IXGBE_SOFTINFT_FLAGS 0
+#endif
+
/*********************************************************************
* Device identification routine
*
@@ -489,7 +501,7 @@
IXGBE_CORE_LOCK_INIT(adapter, device_xname(dev));
/* Set up the timer callout */
- callout_init(&adapter->timer, 0);
+ callout_init(&adapter->timer, IXGBE_CALLOUT_FLAGS);
/* Determine hardware revision */
ixgbe_identify_hardware(adapter);
@@ -2615,24 +2627,26 @@
* processing contexts.
*/
#ifndef IXGBE_LEGACY_TX
- txr->txr_si = softint_establish(SOFTINT_NET, ixgbe_deferred_mq_start,
- txr);
+ txr->txr_si = softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+ ixgbe_deferred_mq_start, txr);
#endif
- que->que_si = softint_establish(SOFTINT_NET, ixgbe_handle_que, que);
+ que->que_si = softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+ ixgbe_handle_que, que);
/* Tasklets for Link, SFP and Multispeed Fiber */
- adapter->link_si =
- softint_establish(SOFTINT_NET, ixgbe_handle_link, adapter);
- adapter->mod_si =
- softint_establish(SOFTINT_NET, ixgbe_handle_mod, adapter);
- adapter->msf_si =
- softint_establish(SOFTINT_NET, ixgbe_handle_msf, adapter);
- adapter->phy_si =
- softint_establish(SOFTINT_NET, ixgbe_handle_phy, adapter);
+ adapter->link_si = softint_establish(SOFTINT_NET |IXGBE_SOFTINFT_FLAGS,
+ ixgbe_handle_link, adapter);
+ adapter->mod_si = softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+ ixgbe_handle_mod, adapter);
+ adapter->msf_si = softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+ ixgbe_handle_msf, adapter);
+ adapter->phy_si = softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+ ixgbe_handle_phy, adapter);
#ifdef IXGBE_FDIR
adapter->fdir_si =
- softint_establish(SOFTINT_NET, ixgbe_reinit_fdir, adapter);
+ softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+ ixgbe_reinit_fdir, adapter);
#endif
if (que->que_si == NULL ||
adapter->link_si == NULL ||
@@ -2712,8 +2726,8 @@
device_xname(dev), i);
intrstr = pci_intr_string(pc, adapter->osdep.intrs[i], intrbuf,
sizeof(intrbuf));
-#ifdef IXG_MPSAFE
- pci_intr_setattr(pc, adapter->osdep.intrs[i], PCI_INTR_MPSAFE,
+#ifdef IXGBE_MPSAFE
+ pci_intr_setattr(pc, &adapter->osdep.intrs[i], PCI_INTR_MPSAFE,
true);
#endif
/* Set the handler function */
@@ -2770,11 +2784,13 @@
}
aprint_normal("\n");
#ifndef IXGBE_LEGACY_TX
- txr->txr_si = softint_establish(SOFTINT_NET,
+ txr->txr_si
+ = softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
ixgbe_deferred_mq_start, txr);
#endif
- que->que_si = softint_establish(SOFTINT_NET, ixgbe_handle_que,
- que);
+ que->que_si
+ = softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+ ixgbe_handle_que, que);
if (que->que_si == NULL) {
aprint_error_dev(dev,
"could not establish software interrupt\n");
@@ -2786,7 +2802,7 @@
snprintf(intr_xname, sizeof(intr_xname), "%s link", device_xname(dev));
intrstr = pci_intr_string(pc, adapter->osdep.intrs[vector], intrbuf,
sizeof(intrbuf));
-#ifdef IXG_MPSAFE
+#ifdef IXGBE_MPSAFE
pci_intr_setattr(pc, &adapter->osdep.intrs[vector], PCI_INTR_MPSAFE,
true);
#endif
@@ -2814,20 +2830,20 @@
adapter->vector = vector;
/* Tasklets for Link, SFP and Multispeed Fiber */
- adapter->link_si =
- softint_establish(SOFTINT_NET, ixgbe_handle_link, adapter);
- adapter->mod_si =
- softint_establish(SOFTINT_NET, ixgbe_handle_mod, adapter);
- adapter->msf_si =
- softint_establish(SOFTINT_NET, ixgbe_handle_msf, adapter);
+ adapter->link_si = softint_establish(SOFTINT_NET |IXGBE_SOFTINFT_FLAGS,
+ ixgbe_handle_link, adapter);
+ adapter->mod_si = softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+ ixgbe_handle_mod, adapter);
+ adapter->msf_si = softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+ ixgbe_handle_msf, adapter);
#ifdef PCI_IOV
TASK_INIT(&adapter->mbx_task, 0, ixgbe_handle_mbx, adapter);
#endif
- adapter->phy_si =
- softint_establish(SOFTINT_NET, ixgbe_handle_phy, adapter);
+ adapter->phy_si = softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+ ixgbe_handle_phy, adapter);
#ifdef IXGBE_FDIR
- adapter->fdir_si =
- softint_establish(SOFTINT_NET, ixgbe_reinit_fdir, adapter);
+ adapter->fdir_si = softint_establish(SOFTINT_NET | XGBE_SOFTINFT_FLAGS,
+ ixgbe_reinit_fdir, adapter);
#endif
kcpuset_destroy(affinity);
@@ -3013,6 +3029,9 @@
ifp->if_stop = ixgbe_ifstop;
ifp->if_softc = adapter;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
+#ifdef IXGBE_MPSAFE
+ ifp->if_extflags = IFEF_START_MPSAFE;
+#endif
ifp->if_ioctl = ixgbe_ioctl;
#if __FreeBSD_version >= 1100045
/* TSO parameters */
diff -r 1f508e40ceb9 -r cda6387718bc sys/dev/pci/ixgbe/ixv.c
--- a/sys/dev/pci/ixgbe/ixv.c Fri Mar 03 03:33:44 2017 +0000
+++ b/sys/dev/pci/ixgbe/ixv.c Fri Mar 03 04:37:05 2017 +0000
@@ -31,10 +31,13 @@
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/if_ixv.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixv.c,v 1.54 2017/02/16 08:01:11 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.55 2017/03/03 04:37:05 msaitoh Exp $*/
+#ifdef _KERNEL_OPT
#include "opt_inet.h"
#include "opt_inet6.h"
+#include "opt_net_mpsafe.h"
+#endif
#include "ixgbe.h"
#include "vlan.h"
@@ -227,6 +230,15 @@
*/
static u32 ixv_shadow_vfta[IXGBE_VFTA_SIZE];
+#ifdef NET_MPSAFE
+#define IXGBE_MPSAFE 1
+#define IXGBE_CALLOUT_FLAGS CALLOUT_MPSAFE
+#define IXGBE_SOFTINFT_FLAGS SOFTINT_MPSAFE
+#else
+#define IXGBE_CALLOUT_FLAGS 0
+#define IXGBE_SOFTINFT_FLAGS 0
+#endif
+
/*********************************************************************
* Device identification routine
*
@@ -327,7 +339,7 @@
IXGBE_CORE_LOCK_INIT(adapter, device_xname(dev));
/* Set up the timer callout */
- callout_init(&adapter->timer, 0);
+ callout_init(&adapter->timer, IXGBE_CALLOUT_FLAGS);
/* Determine hardware revision */
ixv_identify_hardware(adapter);
@@ -1403,8 +1415,8 @@
device_xname(dev), i);
intrstr = pci_intr_string(pc, adapter->osdep.intrs[i], intrbuf,
sizeof(intrbuf));
-#ifdef IXV_MPSAFE
- pci_intr_setattr(pc, adapter->osdep.intrs[i], PCI_INTR_MPSAFE,
+#ifdef IXGBE_MPSAFE
+ pci_intr_setattr(pc, &adapter->osdep.intrs[i], PCI_INTR_MPSAFE,
true);
#endif
/* Set the handler function */
@@ -1437,11 +1449,13 @@
aprint_normal("\n");
#ifndef IXGBE_LEGACY_TX
- txr->txr_si = softint_establish(SOFTINT_NET,
- ixgbe_deferred_mq_start, txr);
+ txr->txr_si
+ = softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+ ixgbe_deferred_mq_start, txr);
#endif
- que->que_si = softint_establish(SOFTINT_NET, ixv_handle_que,
- que);
+ que->que_si
+ = softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+ ixv_handle_que, que);
if (que->que_si == NULL) {
aprint_error_dev(dev,
"could not establish software interrupt\n");
@@ -1453,7 +1467,7 @@
snprintf(intr_xname, sizeof(intr_xname), "%s link", device_xname(dev));
intrstr = pci_intr_string(pc, adapter->osdep.intrs[vector], intrbuf,
sizeof(intrbuf));
-#ifdef IXG_MPSAFE
+#ifdef IXGBE_MPSAFE
pci_intr_setattr(pc, &adapter->osdep.intrs[vector], PCI_INTR_MPSAFE,
true);
#endif
@@ -1481,8 +1495,8 @@
adapter->vector = vector;
/* Tasklets for Mailbox */
- adapter->link_si = softint_establish(SOFTINT_NET, ixv_handle_mbx,
- adapter);
+ adapter->link_si = softint_establish(SOFTINT_NET |IXGBE_SOFTINFT_FLAGS,
+ ixv_handle_mbx, adapter);
/*
** Due to a broken design QEMU will fail to properly
** enable the guest for MSIX unless the vectors in
@@ -1660,6 +1674,9 @@
ifp->if_stop = ixv_ifstop;
ifp->if_softc = adapter;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
+#ifdef IXGBE_MPSAFE
+ ifp->if_extflags = IFEF_START_MPSAFE;
+#endif
ifp->if_ioctl = ixv_ioctl;
#ifndef IXGBE_LEGACY_TX
ifp->if_transmit = ixgbe_mq_start;
Home |
Main Index |
Thread Index |
Old Index