Module Name: src Committed By: msaitoh Date: Mon Feb 13 10:13:54 UTC 2017
Modified Files: src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe.c ixgbe.h ixv.c Log Message: Use percpuq. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/dev/pci/ixgbe/ix_txrx.c cvs rdiff -u -r1.74 -r1.75 src/sys/dev/pci/ixgbe/ixgbe.c cvs rdiff -u -r1.23 -r1.24 src/sys/dev/pci/ixgbe/ixgbe.h cvs rdiff -u -r1.51 -r1.52 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/ix_txrx.c diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.19 src/sys/dev/pci/ixgbe/ix_txrx.c:1.20 --- src/sys/dev/pci/ixgbe/ix_txrx.c:1.19 Fri Feb 10 06:35:22 2017 +++ src/sys/dev/pci/ixgbe/ix_txrx.c Mon Feb 13 10:13:54 2017 @@ -59,7 +59,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ /*$FreeBSD: head/sys/dev/ixgbe/ix_txrx.c 301538 2016-06-07 04:51:50Z sephe $*/ -/*$NetBSD: ix_txrx.c,v 1.19 2017/02/10 06:35:22 msaitoh Exp $*/ +/*$NetBSD: ix_txrx.c,v 1.20 2017/02/13 10:13:54 msaitoh Exp $*/ #include "opt_inet.h" #include "opt_inet6.h" @@ -1704,10 +1704,9 @@ ixgbe_free_receive_buffers(struct rx_rin static __inline void ixgbe_rx_input(struct rx_ring *rxr, struct ifnet *ifp, struct mbuf *m, u32 ptype) { - int s; + struct adapter *adapter = ifp->if_softc; #ifdef LRO - struct adapter *adapter = ifp->if_softc; struct ethercom *ec = &adapter->osdep.ec; /* @@ -1738,9 +1737,7 @@ ixgbe_rx_input(struct rx_ring *rxr, stru IXGBE_RX_UNLOCK(rxr); - s = splnet(); - if_input(ifp, m); - splx(s); + if_percpuq_enqueue(adapter->ipq, m); IXGBE_RX_LOCK(rxr); } Index: src/sys/dev/pci/ixgbe/ixgbe.c diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.74 src/sys/dev/pci/ixgbe/ixgbe.c:1.75 --- src/sys/dev/pci/ixgbe/ixgbe.c:1.74 Mon Feb 13 06:38:45 2017 +++ src/sys/dev/pci/ixgbe/ixgbe.c Mon Feb 13 10:13:54 2017 @@ -59,7 +59,7 @@ * 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.74 2017/02/13 06:38:45 msaitoh Exp $*/ +/*$NetBSD: ixgbe.c,v 1.75 2017/02/13 10:13:54 msaitoh Exp $*/ #include "opt_inet.h" #include "opt_inet6.h" @@ -780,6 +780,7 @@ ixgbe_detach(device_t dev, int flags) bus_generic_detach(dev); #endif if_detach(adapter->ifp); + if_percpuq_destroy(adapter->ipq); sysctl_teardown(&adapter->sysctllog); evcnt_detach(&adapter->handleq); @@ -3001,6 +3002,7 @@ ixgbe_setup_interface(device_t dev, stru IFQ_SET_READY(&ifp->if_snd); if_initialize(ifp); + adapter->ipq = if_percpuq_create(&adapter->osdep.ec.ec_if); ether_ifattach(ifp, adapter->hw.mac.addr); /* * We use per TX queue softint, so if_deferred_start_init() isn't Index: src/sys/dev/pci/ixgbe/ixgbe.h diff -u src/sys/dev/pci/ixgbe/ixgbe.h:1.23 src/sys/dev/pci/ixgbe/ixgbe.h:1.24 --- src/sys/dev/pci/ixgbe/ixgbe.h:1.23 Fri Feb 10 06:35:22 2017 +++ src/sys/dev/pci/ixgbe/ixgbe.h Mon Feb 13 10:13:54 2017 @@ -59,7 +59,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ /*$FreeBSD: head/sys/dev/ixgbe/ixgbe.h 303890 2016-08-09 19:32:06Z dumbbell $*/ -/*$NetBSD: ixgbe.h,v 1.23 2017/02/10 06:35:22 msaitoh Exp $*/ +/*$NetBSD: ixgbe.h,v 1.24 2017/02/13 10:13:54 msaitoh Exp $*/ #ifndef _IXGBE_H_ @@ -475,6 +475,7 @@ struct adapter { device_t dev; struct ifnet *ifp; + struct if_percpuq *ipq; /* softint-based input queues */ struct resource *pci_mem; struct resource *msix_mem; Index: src/sys/dev/pci/ixgbe/ixv.c diff -u src/sys/dev/pci/ixgbe/ixv.c:1.51 src/sys/dev/pci/ixgbe/ixv.c:1.52 --- src/sys/dev/pci/ixgbe/ixv.c:1.51 Mon Feb 13 06:38:45 2017 +++ src/sys/dev/pci/ixgbe/ixv.c Mon Feb 13 10:13:54 2017 @@ -31,7 +31,7 @@ ******************************************************************************/ /*$FreeBSD: head/sys/dev/ixgbe/if_ixv.c 302384 2016-07-07 03:39:18Z sbruno $*/ -/*$NetBSD: ixv.c,v 1.51 2017/02/13 06:38:45 msaitoh Exp $*/ +/*$NetBSD: ixv.c,v 1.52 2017/02/13 10:13:54 msaitoh Exp $*/ #include "opt_inet.h" #include "opt_inet6.h" @@ -530,6 +530,7 @@ ixv_detach(device_t dev, int flags) bus_generic_detach(dev); #endif if_detach(adapter->ifp); + if_percpuq_destroy(adapter->ipq); sysctl_teardown(&adapter->sysctllog); evcnt_detach(&adapter->handleq); @@ -1676,6 +1677,7 @@ ixv_setup_interface(device_t dev, struct IFQ_SET_READY(&ifp->if_snd); if_initialize(ifp); + adapter->ipq = if_percpuq_create(&adapter->osdep.ec.ec_if); ether_ifattach(ifp, adapter->hw.mac.addr); /* * We use per TX queue softint, so if_deferred_start_init() isn't