From: Sepherosa Ziehau Date: Wed, 17 Sep 2008 08:51:30 +0000 (+0000) Subject: Always enable ETHER_INPUT_CHAIN support X-Git-Tag: v2.1.1~368 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/a75a1559ac221512fde49e4cc514b54921e877df Always enable ETHER_INPUT_CHAIN support --- diff --git a/sys/conf/options b/sys/conf/options index d17be1106f..dca3184c24 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -1,5 +1,5 @@ # $FreeBSD: src/sys/conf/options,v 1.191.2.53 2003/06/04 17:56:58 sam Exp $ -# $DragonFly: src/sys/conf/options,v 1.94 2008/09/16 12:30:57 sephe Exp $ +# $DragonFly: src/sys/conf/options,v 1.95 2008/09/17 08:51:28 sephe Exp $ # # On the handling of kernel options # @@ -640,6 +640,3 @@ SYSLINK opt_syslink.h # serializer profiling support PROFILE_SERIALIZER opt_serializer.h - -# ethernet options -ETHER_INPUT_CHAIN opt_ethernet.h diff --git a/sys/config/LINT b/sys/config/LINT index 9c5920245b..c16c82671b 100644 --- a/sys/config/LINT +++ b/sys/config/LINT @@ -3,7 +3,7 @@ # as much of the source tree as it can. # # $FreeBSD: src/sys/i386/conf/LINT,v 1.749.2.144 2003/06/04 17:56:59 sam Exp $ -# $DragonFly: src/sys/config/LINT,v 1.173 2008/09/16 12:30:57 sephe Exp $ +# $DragonFly: src/sys/config/LINT,v 1.174 2008/09/17 08:51:28 sephe Exp $ # # See the kernconf(5) manual page for more information on the format of # this file. @@ -2786,6 +2786,3 @@ options SCTP_MAP_LOGGING # Serializer profiling options PROFILE_SERIALIZER - -# Chain ethernet inputs -options ETHER_INPUT_CHAIN diff --git a/sys/dev/netif/bce/Makefile b/sys/dev/netif/bce/Makefile index a75b21c6cf..228347008f 100644 --- a/sys/dev/netif/bce/Makefile +++ b/sys/dev/netif/bce/Makefile @@ -1,9 +1,9 @@ -# $DragonFly: src/sys/dev/netif/bce/Makefile,v 1.2 2008/06/25 13:36:52 sephe Exp $ +# $DragonFly: src/sys/dev/netif/bce/Makefile,v 1.3 2008/09/17 08:51:29 sephe Exp $ KMOD= if_bce SRCS= if_bce.c SRCS+= miibus_if.h device_if.h bus_if.h pci_if.h -SRCS+= opt_bce.h opt_polling.h opt_ethernet.h +SRCS+= opt_bce.h opt_polling.h KMODDEPS = miibus @@ -13,9 +13,6 @@ opt_polling.h: opt_bce.h: touch ${.OBJDIR}/${.TARGET} - -opt_ethernet.h: - touch ${.OBJDIR}/${.TARGET} #endif .include diff --git a/sys/dev/netif/bce/if_bce.c b/sys/dev/netif/bce/if_bce.c index da1b2cc450..5c6c8105ae 100644 --- a/sys/dev/netif/bce/if_bce.c +++ b/sys/dev/netif/bce/if_bce.c @@ -28,7 +28,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/bce/if_bce.c,v 1.31 2007/05/16 23:34:11 davidch Exp $ - * $DragonFly: src/sys/dev/netif/bce/if_bce.c,v 1.18 2008/09/17 07:51:58 sephe Exp $ + * $DragonFly: src/sys/dev/netif/bce/if_bce.c,v 1.19 2008/09/17 08:51:29 sephe Exp $ */ /* @@ -45,7 +45,6 @@ #include "opt_bce.h" #include "opt_polling.h" -#include "opt_ethernet.h" #include #include @@ -3731,15 +3730,11 @@ bce_rx_intr(struct bce_softc *sc, int count) uint16_t hw_cons, sw_cons, sw_chain_cons, sw_prod, sw_chain_prod; uint32_t sw_prod_bseq; int i; -#ifdef ETHER_INPUT_CHAIN struct mbuf_chain chain[MAXCPU]; -#endif ASSERT_SERIALIZED(ifp->if_serializer); -#ifdef ETHER_INPUT_CHAIN ether_input_chain_init(chain); -#endif DBRUNIF(1, sc->rx_interrupts++); @@ -3987,11 +3982,7 @@ bce_rx_int_next_rx: m->m_pkthdr.ether_vlantag = l2fhdr->l2_fhdr_vlan_tag; } -#ifdef ETHER_INPUT_CHAIN ether_input_chain(ifp, m, chain); -#else - ifp->if_input(ifp, m); -#endif DBRUNIF(1, sc->rx_mbuf_alloc--); } @@ -4015,9 +4006,7 @@ bce_rx_int_next_rx: BUS_SPACE_BARRIER_READ); } -#ifdef ETHER_INPUT_CHAIN ether_input_dispatch(chain); -#endif for (i = 0; i < RX_PAGES; i++) { bus_dmamap_sync(sc->rx_bd_chain_tag, diff --git a/sys/dev/netif/bfe/Makefile b/sys/dev/netif/bfe/Makefile index 1791f426de..aaf4660502 100644 --- a/sys/dev/netif/bfe/Makefile +++ b/sys/dev/netif/bfe/Makefile @@ -1,14 +1,8 @@ -# $DragonFly: src/sys/dev/netif/bfe/Makefile,v 1.3 2008/06/26 12:05:19 sephe Exp $ +# $DragonFly: src/sys/dev/netif/bfe/Makefile,v 1.4 2008/09/17 08:51:29 sephe Exp $ KMOD= if_bfe SRCS= if_bfe.c SRCS+= miibus_if.h device_if.h bus_if.h pci_if.h -SRCS+= opt_ethernet.h KMODDEPS = miibus -.ifndef BUILDING_WITH_KERNEL -opt_ethernet.h: - touch ${.OBJDIR}/${.TARGET} -.endif - .include diff --git a/sys/dev/netif/bfe/if_bfe.c b/sys/dev/netif/bfe/if_bfe.c index f825f124d3..ecd4ad6e1f 100644 --- a/sys/dev/netif/bfe/if_bfe.c +++ b/sys/dev/netif/bfe/if_bfe.c @@ -29,9 +29,8 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/bfe/if_bfe.c 1.4.4.7 2004/03/02 08:41:33 julian Exp v - * $DragonFly: src/sys/dev/netif/bfe/if_bfe.c,v 1.39 2008/09/17 07:51:58 sephe Exp $ + * $DragonFly: src/sys/dev/netif/bfe/if_bfe.c,v 1.40 2008/09/17 08:51:29 sephe Exp $ */ -#include "opt_ethernet.h" #include #include @@ -1098,17 +1097,13 @@ bfe_rxeof(struct bfe_softc *sc) struct bfe_rxheader *rxheader; struct bfe_data *r; uint32_t cons, status, current, len, flags; -#ifdef ETHER_INPUT_CHAIN struct mbuf_chain chain[MAXCPU]; -#endif cons = sc->bfe_rx_cons; status = CSR_READ_4(sc, BFE_DMARX_STAT); current = (status & BFE_STAT_CDMASK) / sizeof(struct bfe_desc); -#ifdef ETHER_INPUT_CHAIN ether_input_chain_init(chain); -#endif while (current != cons) { r = &sc->bfe_rx_ring[cons]; @@ -1147,17 +1142,11 @@ bfe_rxeof(struct bfe_softc *sc) ifp->if_ipackets++; m->m_pkthdr.rcvif = ifp; -#ifdef ETHER_INPUT_CHAIN ether_input_chain(ifp, m, chain); -#else - ifp->if_input(ifp, m); -#endif BFE_INC(cons, BFE_RX_LIST_CNT); } -#ifdef ETHER_INPUT_CHAIN ether_input_dispatch(chain); -#endif sc->bfe_rx_cons = cons; } diff --git a/sys/dev/netif/bge/Makefile b/sys/dev/netif/bge/Makefile index 94efe71ec6..dc370dcbd2 100644 --- a/sys/dev/netif/bge/Makefile +++ b/sys/dev/netif/bge/Makefile @@ -1,18 +1,15 @@ # $FreeBSD: src/sys/modules/bge/Makefile,v 1.1.2.2 2001/12/04 20:01:53 brooks Exp $ -# $DragonFly: src/sys/dev/netif/bge/Makefile,v 1.9 2008/06/25 13:00:09 sephe Exp $ +# $DragonFly: src/sys/dev/netif/bge/Makefile,v 1.10 2008/09/17 08:51:29 sephe Exp $ KMOD= if_bge SRCS= if_bge.c SRCS+= miibus_if.h device_if.h bus_if.h pci_if.h -SRCS+= opt_polling.h opt_ktr.h opt_ethernet.h +SRCS+= opt_polling.h opt_ktr.h KMODDEPS = miibus .ifndef BUILDING_WITH_KERNEL opt_polling.h: echo '#define DEVICE_POLLING 1' > ${.OBJDIR}/${.TARGET} - -opt_ethernet.h: - touch ${.OBJDIR}/${.TARGET} .endif .include diff --git a/sys/dev/netif/bge/if_bge.c b/sys/dev/netif/bge/if_bge.c index b733b2f2b7..7a62ef699e 100644 --- a/sys/dev/netif/bge/if_bge.c +++ b/sys/dev/netif/bge/if_bge.c @@ -31,7 +31,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/bge/if_bge.c,v 1.3.2.39 2005/07/03 03:41:18 silby Exp $ - * $DragonFly: src/sys/dev/netif/bge/if_bge.c,v 1.106 2008/09/17 07:51:58 sephe Exp $ + * $DragonFly: src/sys/dev/netif/bge/if_bge.c,v 1.107 2008/09/17 08:51:29 sephe Exp $ * */ @@ -73,7 +73,6 @@ */ #include "opt_polling.h" -#include "opt_ethernet.h" #include #include @@ -2231,17 +2230,13 @@ bge_rxeof(struct bge_softc *sc) { struct ifnet *ifp; int stdcnt = 0, jumbocnt = 0; -#ifdef ETHER_INPUT_CHAIN struct mbuf_chain chain[MAXCPU]; -#endif if (sc->bge_rx_saved_considx == sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx) return; -#ifdef ETHER_INPUT_CHAIN ether_input_chain_init(chain); -#endif ifp = &sc->arpcom.ac_if; @@ -2355,16 +2350,10 @@ bge_rxeof(struct bge_softc *sc) m->m_pkthdr.ether_vlantag = vlan_tag; have_tag = vlan_tag = 0; } -#ifdef ETHER_INPUT_CHAIN ether_input_chain(ifp, m, chain); -#else - ifp->if_input(ifp, m); -#endif } -#ifdef ETHER_INPUT_CHAIN ether_input_dispatch(chain); -#endif if (stdcnt > 0) { bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, diff --git a/sys/dev/netif/em/Makefile b/sys/dev/netif/em/Makefile index da62bdbf31..b9922d1292 100644 --- a/sys/dev/netif/em/Makefile +++ b/sys/dev/netif/em/Makefile @@ -1,10 +1,10 @@ #$FreeBSD: src/sys/modules/em/Makefile,v 1.1.2.3 2002/06/18 21:00:56 pdeuskar Exp $ -#$DragonFly: src/sys/dev/netif/em/Makefile,v 1.9 2008/05/02 07:40:32 sephe Exp $ +#$DragonFly: src/sys/dev/netif/em/Makefile,v 1.10 2008/09/17 08:51:29 sephe Exp $ KMOD= if_em SRCS= if_em.c if_em_hw.c SRCS+= device_if.h bus_if.h pci_if.h -SRCS+= opt_polling.h opt_inet.h opt_ktr.h opt_serializer.h opt_ethernet.h +SRCS+= opt_polling.h opt_inet.h opt_ktr.h opt_serializer.h .ifndef BUILDING_WITH_KERNEL opt_polling.h: @@ -15,9 +15,6 @@ opt_inet.h: opt_serializer.h: touch ${.OBJDIR}/${.TARGET} - -opt_ethernet.h: - touch ${.OBJDIR}/${.TARGET} .endif .include diff --git a/sys/dev/netif/em/if_em.c b/sys/dev/netif/em/if_em.c index e01eee746f..f170c7ac70 100644 --- a/sys/dev/netif/em/if_em.c +++ b/sys/dev/netif/em/if_em.c @@ -64,7 +64,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/dev/netif/em/if_em.c,v 1.79 2008/09/17 07:51:58 sephe Exp $ + * $DragonFly: src/sys/dev/netif/em/if_em.c,v 1.80 2008/09/17 08:51:29 sephe Exp $ * $FreeBSD$ */ /* @@ -96,7 +96,6 @@ #include "opt_polling.h" #include "opt_inet.h" #include "opt_serializer.h" -#include "opt_ethernet.h" #include #include @@ -2984,9 +2983,7 @@ em_rxeof(struct adapter *adapter, int count) uint8_t eop = 0; uint16_t len, desc_len, prev_len_adj; int i; -#ifdef ETHER_INPUT_CHAIN struct mbuf_chain chain[MAXCPU]; -#endif /* Pointer to the receive descriptor being examined. */ struct em_rx_desc *current_desc; @@ -3001,9 +2998,7 @@ em_rxeof(struct adapter *adapter, int count) if (!(current_desc->status & E1000_RXD_STAT_DD)) return; -#ifdef ETHER_INPUT_CHAIN ether_input_chain_init(chain); -#endif while ((current_desc->status & E1000_RXD_STAT_DD) && count != 0) { logif(pkt_receive); @@ -3099,11 +3094,7 @@ em_rxeof(struct adapter *adapter, int count) (current_desc->special & E1000_RXD_SPC_VLAN_MASK); } -#ifdef ETHER_INPUT_CHAIN ether_input_chain(ifp, adapter->fmp, chain); -#else - ifp->if_input(ifp, adapter->fmp); -#endif adapter->fmp = NULL; adapter->lmp = NULL; } @@ -3129,9 +3120,7 @@ skip: } } -#ifdef ETHER_INPUT_CHAIN ether_input_dispatch(chain); -#endif bus_dmamap_sync(adapter->rxdma.dma_tag, adapter->rxdma.dma_map, BUS_DMASYNC_PREWRITE); diff --git a/sys/dev/netif/et/Makefile b/sys/dev/netif/et/Makefile index e3cda8240a..1420b9dd06 100644 --- a/sys/dev/netif/et/Makefile +++ b/sys/dev/netif/et/Makefile @@ -1,14 +1,8 @@ -# $DragonFly: src/sys/dev/netif/et/Makefile,v 1.2 2008/07/08 14:36:02 sephe Exp $ +# $DragonFly: src/sys/dev/netif/et/Makefile,v 1.3 2008/09/17 08:51:29 sephe Exp $ KMOD= if_et SRCS= if_et.c SRCS+= miibus_if.h device_if.h bus_if.h pci_if.h -SRCS+= opt_ethernet.h KMODDEPS= miibus -.ifndef BUILDING_WITH_KERNEL -opt_ethernet.h: - touch ${.OBJDIR}/${.TARGET} -.endif - .include diff --git a/sys/dev/netif/et/if_et.c b/sys/dev/netif/et/if_et.c index 2d31d869bb..0388c7e642 100644 --- a/sys/dev/netif/et/if_et.c +++ b/sys/dev/netif/et/if_et.c @@ -31,11 +31,9 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/dev/netif/et/if_et.c,v 1.16 2008/09/17 07:51:59 sephe Exp $ + * $DragonFly: src/sys/dev/netif/et/if_et.c,v 1.17 2008/09/17 08:51:29 sephe Exp $ */ -#include "opt_ethernet.h" - #include #include #include @@ -1909,9 +1907,7 @@ et_rxeof(struct et_softc *sc) struct et_rxstat_ring *rxst_ring = &sc->sc_rxstat_ring; uint32_t rxs_stat_ring; int rxst_wrap, rxst_index; -#ifdef ETHER_INPUT_CHAIN struct mbuf_chain chain[MAXCPU]; -#endif if ((sc->sc_flags & ET_FLAG_TXRX_ENABLED) == 0) return; @@ -1925,9 +1921,7 @@ et_rxeof(struct et_softc *sc) rxst_wrap = (rxs_stat_ring & ET_RXS_STATRING_WRAP) ? 1 : 0; rxst_index = __SHIFTOUT(rxs_stat_ring, ET_RXS_STATRING_INDEX); -#ifdef ETHER_INPUT_CHAIN ether_input_chain_init(chain); -#endif while (rxst_index != rxst_ring->rsr_index || rxst_wrap != rxst_ring->rsr_wrap) { @@ -1980,11 +1974,7 @@ et_rxeof(struct et_softc *sc) m_adj(m, -ETHER_CRC_LEN); ifp->if_ipackets++; -#ifdef ETHER_INPUT_CHAIN ether_input_chain(ifp, m, chain); -#else - ifp->if_input(ifp, m); -#endif } } else { ifp->if_ierrors++; @@ -2010,9 +2000,7 @@ et_rxeof(struct et_softc *sc) CSR_WRITE_4(sc, rx_ring->rr_posreg, rxring_pos); } -#ifdef ETHER_INPUT_CHAIN ether_input_dispatch(chain); -#endif } static int diff --git a/sys/dev/netif/fxp/Makefile b/sys/dev/netif/fxp/Makefile index 04ecb21f88..e48d1cb89c 100644 --- a/sys/dev/netif/fxp/Makefile +++ b/sys/dev/netif/fxp/Makefile @@ -1,17 +1,14 @@ # $FreeBSD: src/sys/modules/fxp/Makefile,v 1.9.2.3 2001/12/04 20:01:53 brooks Exp $ -# $DragonFly: src/sys/dev/netif/fxp/Makefile,v 1.6 2008/06/25 11:56:13 sephe Exp $ +# $DragonFly: src/sys/dev/netif/fxp/Makefile,v 1.7 2008/09/17 08:51:29 sephe Exp $ KMOD = if_fxp SRCS = if_fxp.c device_if.h bus_if.h pci_if.h miibus_if.h -SRCS += opt_polling.h opt_ethernet.h +SRCS += opt_polling.h KMODDEPS = miibus .ifndef BUILDING_WITH_KERNEL opt_polling.h: echo '#define DEVICE_POLLING 1' > ${.OBJDIR}/${.TARGET} - -opt_ethernet.h: - touch ${.OBJDIR}/${.TARGET} .endif .include diff --git a/sys/dev/netif/fxp/if_fxp.c b/sys/dev/netif/fxp/if_fxp.c index 5ea9d3afd9..9dcfcf752f 100644 --- a/sys/dev/netif/fxp/if_fxp.c +++ b/sys/dev/netif/fxp/if_fxp.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/fxp/if_fxp.c,v 1.110.2.30 2003/06/12 16:47:05 mux Exp $ - * $DragonFly: src/sys/dev/netif/fxp/if_fxp.c,v 1.60 2008/09/17 07:51:59 sephe Exp $ + * $DragonFly: src/sys/dev/netif/fxp/if_fxp.c,v 1.61 2008/09/17 08:51:29 sephe Exp $ */ /* @@ -34,7 +34,6 @@ */ #include "opt_polling.h" -#include "opt_ethernet.h" #include #include @@ -1277,9 +1276,7 @@ fxp_intr_body(struct fxp_softc *sc, u_int8_t statack, int count) struct mbuf *m; struct fxp_rfa *rfa; int rnr = (statack & FXP_SCB_STATACK_RNR) ? 1 : 0; -#ifdef ETHER_INPUT_CHAIN struct mbuf_chain chain[MAXCPU]; -#endif if (rnr) fxp_rnr++; @@ -1342,9 +1339,7 @@ fxp_intr_body(struct fxp_softc *sc, u_int8_t statack, int count) if (!rnr && (statack & FXP_SCB_STATACK_FR) == 0) return; -#ifdef ETHER_INPUT_CHAIN ether_input_chain_init(chain); -#endif /* * Process receiver interrupts. If a no-resource (RNR) @@ -1406,17 +1401,11 @@ fxp_intr_body(struct fxp_softc *sc, u_int8_t statack, int count) continue; } m->m_pkthdr.len = m->m_len = total_len; -#ifdef ETHER_INPUT_CHAIN ether_input_chain(ifp, m, chain); -#else - ifp->if_input(ifp, m); -#endif } } -#ifdef ETHER_INPUT_CHAIN ether_input_dispatch(chain); -#endif if (rnr) { fxp_scb_wait(sc); diff --git a/sys/dev/netif/jme/Makefile b/sys/dev/netif/jme/Makefile index 19ea021634..0ba12828ee 100644 --- a/sys/dev/netif/jme/Makefile +++ b/sys/dev/netif/jme/Makefile @@ -1,14 +1,8 @@ -# $DragonFly: src/sys/dev/netif/jme/Makefile,v 1.1 2008/07/26 14:00:31 sephe Exp $ +# $DragonFly: src/sys/dev/netif/jme/Makefile,v 1.2 2008/09/17 08:51:29 sephe Exp $ KMOD= if_jme SRCS= if_jme.c SRCS+= miibus_if.h device_if.h bus_if.h pci_if.h -SRCS+= opt_ethernet.h KMODDEPS= miibus -.ifndef BUILDING_WITH_KERNEL -opt_ethernet.h: - touch ${.OBJDIR}/${.TARGET} -.endif - .include diff --git a/sys/dev/netif/jme/if_jme.c b/sys/dev/netif/jme/if_jme.c index d913d910e6..5d28e1dcba 100644 --- a/sys/dev/netif/jme/if_jme.c +++ b/sys/dev/netif/jme/if_jme.c @@ -25,11 +25,9 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/jme/if_jme.c,v 1.2 2008/07/18 04:20:48 yongari Exp $ - * $DragonFly: src/sys/dev/netif/jme/if_jme.c,v 1.7 2008/09/13 04:04:39 sephe Exp $ + * $DragonFly: src/sys/dev/netif/jme/if_jme.c,v 1.8 2008/09/17 08:51:29 sephe Exp $ */ -#include "opt_ethernet.h" - #include #include #include diff --git a/sys/dev/netif/msk/Makefile b/sys/dev/netif/msk/Makefile index 2438ce2d40..2eea9c8d9f 100644 --- a/sys/dev/netif/msk/Makefile +++ b/sys/dev/netif/msk/Makefile @@ -1,14 +1,8 @@ -# $DragonFly: src/sys/dev/netif/msk/Makefile,v 1.2 2008/06/26 13:08:55 sephe Exp $ +# $DragonFly: src/sys/dev/netif/msk/Makefile,v 1.3 2008/09/17 08:51:29 sephe Exp $ KMOD= if_msk SRCS= if_msk.c SRCS+= miibus_if.h device_if.h bus_if.h pci_if.h -SRCS+= opt_ethernet.h KMODDEPS = miibus -.ifndef BUILDING_WITH_KERNEL -opt_ethernet.h: - touch ${.OBJDIR}/${.TARGET} -.endif - .include diff --git a/sys/dev/netif/msk/if_msk.c b/sys/dev/netif/msk/if_msk.c index 9df3f88c32..2a83b036e0 100644 --- a/sys/dev/netif/msk/if_msk.c +++ b/sys/dev/netif/msk/if_msk.c @@ -93,14 +93,13 @@ */ /* $FreeBSD: src/sys/dev/msk/if_msk.c,v 1.26 2007/12/05 09:41:58 remko Exp $ */ -/* $DragonFly: src/sys/dev/netif/msk/if_msk.c,v 1.8 2008/09/17 07:51:59 sephe Exp $ */ +/* $DragonFly: src/sys/dev/netif/msk/if_msk.c,v 1.9 2008/09/17 08:51:29 sephe Exp $ */ /* * Device driver for the Marvell Yukon II Ethernet controller. * Due to lack of documentation, this driver is based on the code from * sk(4) and Marvell's myk(4) driver for FreeBSD 5.x. */ -#include "opt_ethernet.h" #include #include @@ -2853,11 +2852,7 @@ msk_rxeof(struct msk_if_softc *sc_if, uint32_t status, int len, } #endif -#ifdef ETHER_INPUT_CHAIN ether_input_chain(ifp, m, chain); -#else - ifp->if_input(ifp, m); -#endif } while (0); MSK_INC(sc_if->msk_cdata.msk_rx_cons, MSK_RX_RING_CNT); @@ -3190,21 +3185,13 @@ mskc_handle_events(struct msk_softc *sc) struct msk_stat_desc *sd; uint32_t control, status; int cons, idx, len, port, rxprog; -#ifdef ETHER_INPUT_CHAIN - struct mbuf_chain chain0[MAXCPU]; -#endif - struct mbuf_chain *chain; + struct mbuf_chain chain[MAXCPU]; idx = CSR_READ_2(sc, STAT_PUT_IDX); if (idx == sc->msk_stat_cons) return (0); -#ifdef ETHER_INPUT_CHAIN - chain = chain0; ether_input_chain_init(chain); -#else - chain = NULL; -#endif /* Sync status LEs. */ bus_dmamap_sync(sc->msk_stat_tag, sc->msk_stat_map, @@ -3288,10 +3275,8 @@ mskc_handle_events(struct msk_softc *sc) break; } -#ifdef ETHER_INPUT_CHAIN if (rxprog > 0) ether_input_dispatch(chain); -#endif sc->msk_stat_cons = cons; /* XXX We should sync status LEs here. See above notes. */ diff --git a/sys/dev/netif/nfe/Makefile b/sys/dev/netif/nfe/Makefile index 73460db477..82a09f8bda 100644 --- a/sys/dev/netif/nfe/Makefile +++ b/sys/dev/netif/nfe/Makefile @@ -1,17 +1,14 @@ -# $DragonFly: src/sys/dev/netif/nfe/Makefile,v 1.2 2008/06/24 13:55:17 sephe Exp $ +# $DragonFly: src/sys/dev/netif/nfe/Makefile,v 1.3 2008/09/17 08:51:29 sephe Exp $ KMOD= if_nfe SRCS= if_nfe.c SRCS+= miibus_if.h device_if.h bus_if.h pci_if.h -SRCS+= opt_polling.h opt_ethernet.h +SRCS+= opt_polling.h KMODDEPS = miibus .ifndef BUILDING_WITH_KERNEL opt_polling.h: echo '#define DEVICE_POLLING 1' > ${.OBJDIR}/${.TARGET} - -opt_ethernet.h: - touch ${.OBJDIR}/${.TARGET} .endif .include diff --git a/sys/dev/netif/nfe/if_nfe.c b/sys/dev/netif/nfe/if_nfe.c index 1c6f28a2d0..71fa950043 100644 --- a/sys/dev/netif/nfe/if_nfe.c +++ b/sys/dev/netif/nfe/if_nfe.c @@ -1,5 +1,5 @@ /* $OpenBSD: if_nfe.c,v 1.63 2006/06/17 18:00:43 brad Exp $ */ -/* $DragonFly: src/sys/dev/netif/nfe/if_nfe.c,v 1.44 2008/09/17 07:51:59 sephe Exp $ */ +/* $DragonFly: src/sys/dev/netif/nfe/if_nfe.c,v 1.45 2008/09/17 08:51:29 sephe Exp $ */ /* * Copyright (c) 2006 The DragonFly Project. All rights reserved. @@ -56,7 +56,6 @@ /* Driver for NVIDIA nForce MCP Fast Ethernet and Gigabit Ethernet */ #include "opt_polling.h" -#include "opt_ethernet.h" #include #include @@ -991,16 +990,12 @@ nfe_rxeof(struct nfe_softc *sc) struct ifnet *ifp = &sc->arpcom.ac_if; struct nfe_rx_ring *ring = &sc->rxq; int reap; -#ifdef ETHER_INPUT_CHAIN struct mbuf_chain chain[MAXCPU]; -#endif reap = 0; bus_dmamap_sync(ring->tag, ring->map, BUS_DMASYNC_POSTREAD); -#ifdef ETHER_INPUT_CHAIN ether_input_chain_init(chain); -#endif for (;;) { struct nfe_rx_data *data = &ring->data[ring->cur]; @@ -1080,11 +1075,7 @@ nfe_rxeof(struct nfe_softc *sc) } ifp->if_ipackets++; -#ifdef ETHER_INPUT_CHAIN ether_input_chain(ifp, m, chain); -#else - ifp->if_input(ifp, m); -#endif skip: nfe_set_ready_rxdesc(sc, ring, ring->cur); sc->rxq.cur = (sc->rxq.cur + 1) % sc->sc_rx_ring_count; @@ -1092,9 +1083,7 @@ skip: if (reap) { bus_dmamap_sync(ring->tag, ring->map, BUS_DMASYNC_PREWRITE); -#ifdef ETHER_INPUT_CHAIN ether_input_dispatch(chain); -#endif } return reap; } diff --git a/sys/dev/netif/re/Makefile b/sys/dev/netif/re/Makefile index 1f1039d125..80ebf55480 100644 --- a/sys/dev/netif/re/Makefile +++ b/sys/dev/netif/re/Makefile @@ -1,17 +1,14 @@ -# $DragonFly: src/sys/dev/netif/re/Makefile,v 1.3 2008/06/25 11:02:33 sephe Exp $ +# $DragonFly: src/sys/dev/netif/re/Makefile,v 1.4 2008/09/17 08:51:29 sephe Exp $ KMOD = if_re SRCS = if_re.c SRCS += device_if.h bus_if.h pci_if.h miibus_if.h -SRCS += opt_polling.h opt_ethernet.h +SRCS += opt_polling.h KMODDEPS = miibus .ifndef BUILDING_WITH_KERNEL opt_polling.h: echo '#define DEVICE_POLLING 1' > ${.OBJDIR}/${.TARGET} - -opt_ethernet.h: - touch ${.OBJDIR}/${.TARGET} .endif .include diff --git a/sys/dev/netif/re/if_re.c b/sys/dev/netif/re/if_re.c index 1f66966855..597648c657 100644 --- a/sys/dev/netif/re/if_re.c +++ b/sys/dev/netif/re/if_re.c @@ -33,7 +33,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/re/if_re.c,v 1.25 2004/06/09 14:34:01 naddy Exp $ - * $DragonFly: src/sys/dev/netif/re/if_re.c,v 1.49 2008/09/17 07:51:59 sephe Exp $ + * $DragonFly: src/sys/dev/netif/re/if_re.c,v 1.50 2008/09/17 08:51:29 sephe Exp $ */ /* @@ -112,7 +112,6 @@ */ #include "opt_polling.h" -#include "opt_ethernet.h" #include #include @@ -1481,18 +1480,14 @@ re_rxeof(struct re_softc *sc) struct re_desc *cur_rx; uint32_t rxstat, rxvlan; int i, total_len; -#ifdef ETHER_INPUT_CHAIN struct mbuf_chain chain[MAXCPU]; -#endif /* Invalidate the descriptor memory */ bus_dmamap_sync(sc->re_ldata.re_rx_list_tag, sc->re_ldata.re_rx_list_map, BUS_DMASYNC_POSTREAD); -#ifdef ETHER_INPUT_CHAIN ether_input_chain_init(chain); -#endif for (i = sc->re_ldata.re_rx_prodidx; RE_OWN(&sc->re_ldata.re_rx_list[i]) == 0 ; RE_DESC_INC(i)) { @@ -1623,16 +1618,10 @@ re_rxeof(struct re_softc *sc) m->m_pkthdr.ether_vlantag = be16toh((rxvlan & RE_RDESC_VLANCTL_DATA)); } -#ifdef ETHER_INPUT_CHAIN ether_input_chain(ifp, m, chain); -#else - ifp->if_input(ifp, m); -#endif } -#ifdef ETHER_INPUT_CHAIN ether_input_dispatch(chain); -#endif /* Flush the RX DMA ring */ diff --git a/sys/dev/netif/xl/Makefile b/sys/dev/netif/xl/Makefile index 1ab2af1905..339d617198 100644 --- a/sys/dev/netif/xl/Makefile +++ b/sys/dev/netif/xl/Makefile @@ -1,18 +1,15 @@ # $FreeBSD: src/sys/modules/xl/Makefile,v 1.9 2000/01/28 11:26:45 bde Exp $ -# $DragonFly: src/sys/dev/netif/xl/Makefile,v 1.6 2008/06/25 11:46:03 sephe Exp $ +# $DragonFly: src/sys/dev/netif/xl/Makefile,v 1.7 2008/09/17 08:51:29 sephe Exp $ KMOD = if_xl SRCS = if_xl.c device_if.h bus_if.h pci_if.h -SRCS += opt_polling.h opt_ethernet.h +SRCS += opt_polling.h SRCS += miibus_if.h KMODDEPS = miibus .ifndef BUILDING_WITH_KERNEL opt_polling.h: echo '#define DEVICE_POLLING 1' > ${.OBJDIR}/${.TARGET} - -opt_ethernet.h: - touch ${.OBJDIR}/${.TARGET} .endif .include diff --git a/sys/dev/netif/xl/if_xl.c b/sys/dev/netif/xl/if_xl.c index 81bdb57349..f388a980b7 100644 --- a/sys/dev/netif/xl/if_xl.c +++ b/sys/dev/netif/xl/if_xl.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/pci/if_xl.c,v 1.72.2.28 2003/10/08 06:01:57 murray Exp $ - * $DragonFly: src/sys/dev/netif/xl/if_xl.c,v 1.55 2008/09/17 07:51:59 sephe Exp $ + * $DragonFly: src/sys/dev/netif/xl/if_xl.c,v 1.56 2008/09/17 08:51:29 sephe Exp $ */ /* @@ -100,7 +100,6 @@ */ #include "opt_polling.h" -#include "opt_ethernet.h" #include #include @@ -2036,16 +2035,11 @@ xl_rxeof(struct xl_softc *sc, int count) struct xl_chain_onefrag *cur_rx; int total_len = 0; u_int32_t rxstat; -#ifdef ETHER_INPUT_CHAIN struct mbuf_chain chain[MAXCPU]; -#endif ifp = &sc->arpcom.ac_if; -#ifdef ETHER_INPUT_CHAIN ether_input_chain_init(chain); -#endif - again: bus_dmamap_sync(sc->xl_ldata.xl_rx_tag, sc->xl_ldata.xl_rx_dmamap, @@ -2140,11 +2134,7 @@ again: } } -#ifdef ETHER_INPUT_CHAIN ether_input_chain(ifp, m, chain); -#else - ifp->if_input(ifp, m); -#endif } if (sc->xl_type != XL_TYPE_905B) { @@ -2172,9 +2162,7 @@ again: } } -#ifdef ETHER_INPUT_CHAIN ether_input_dispatch(chain); -#endif } /* diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 8f07d63f08..b655cfdfd7 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -32,7 +32,7 @@ * * @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/net/if_ethersubr.c,v 1.70.2.33 2003/04/28 15:45:53 archie Exp $ - * $DragonFly: src/sys/net/if_ethersubr.c,v 1.88 2008/09/17 07:51:59 sephe Exp $ + * $DragonFly: src/sys/net/if_ethersubr.c,v 1.89 2008/09/17 08:51:29 sephe Exp $ */ #include "opt_atalk.h" @@ -42,7 +42,6 @@ #include "opt_mpls.h" #include "opt_netgraph.h" #include "opt_carp.h" -#include "opt_ethernet.h" #include #include @@ -956,8 +955,6 @@ ether_restore_header(struct mbuf **m0, const struct ether_header *eh, *m0 = m; } -#ifdef ETHER_INPUT_CHAIN - static void ether_input_ipifunc(void *arg) { @@ -1010,8 +1007,6 @@ ether_input_chain_init(struct mbuf_chain *chain) #endif } -#endif /* ETHER_INPUT_CHAIN */ - /* * Upper layer processing for a received Ethernet packet. */ @@ -1518,7 +1513,6 @@ ether_input_chain(struct ifnet *ifp, struct mbuf *m, struct mbuf_chain *chain) */ ether_init_netpacket(isr, m); -#ifdef ETHER_INPUT_CHAIN if (chain != NULL) { struct mbuf_chain *c; int cpuid; @@ -1534,7 +1528,7 @@ ether_input_chain(struct ifnet *ifp, struct mbuf *m, struct mbuf_chain *chain) c->mc_tail = m; } m->m_nextpkt = NULL; - } else -#endif /* ETHER_INPUT_CHAIN */ + } else { lwkt_sendmsg(port, &m->m_hdr.mh_netmsg.nm_netmsg.nm_lmsg); + } } diff --git a/sys/net/if_var.h b/sys/net/if_var.h index 1681f6d539..5c02d6114f 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -32,7 +32,7 @@ * * From: @(#)if.h 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/net/if_var.h,v 1.18.2.16 2003/04/15 18:11:19 fjoe Exp $ - * $DragonFly: src/sys/net/if_var.h,v 1.66 2008/09/17 07:51:59 sephe Exp $ + * $DragonFly: src/sys/net/if_var.h,v 1.67 2008/09/17 08:51:29 sephe Exp $ */ #ifndef _NET_IF_VAR_H_ @@ -547,10 +547,8 @@ void ether_ifdetach(struct ifnet *); void ether_demux_oncpu(struct ifnet *, struct mbuf *); void ether_input_oncpu(struct ifnet *, struct mbuf *); void ether_input_chain(struct ifnet *, struct mbuf *, struct mbuf_chain *); -#ifdef ETHER_INPUT_CHAIN void ether_input_chain_init(struct mbuf_chain *); void ether_input_dispatch(struct mbuf_chain *); -#endif int ether_output_frame(struct ifnet *, struct mbuf *); int ether_ioctl(struct ifnet *, int, caddr_t); uint32_t ether_crc32_le(const uint8_t *, size_t); diff --git a/sys/net/vlan/Makefile b/sys/net/vlan/Makefile index aa1ccdb454..88d2fb37c7 100644 --- a/sys/net/vlan/Makefile +++ b/sys/net/vlan/Makefile @@ -1,9 +1,9 @@ # $FreeBSD: src/sys/modules/if_vlan/Makefile,v 1.1.2.1 2001/12/04 20:09:32 brooks Exp $ -# $DragonFly: src/sys/net/vlan/Makefile,v 1.6 2008/06/24 11:40:56 sephe Exp $ +# $DragonFly: src/sys/net/vlan/Makefile,v 1.7 2008/09/17 08:51:30 sephe Exp $ KMOD= if_vlan SRCS= if_vlan.c -SRCS+= opt_inet.h opt_ethernet.h +SRCS+= opt_inet.h SRCS+= device_if.h bus_if.h CFLAGS+= -DNVLAN=0 NOMAN= @@ -11,9 +11,6 @@ NOMAN= .if !defined(BUILDING_WITH_KERNEL) opt_inet.h: echo "#define INET 1" > ${.TARGET} - -opt_ethernet.h: - touch ${.OBJDIR}/${.TARGET} .endif .include diff --git a/sys/net/vlan/if_vlan.c b/sys/net/vlan/if_vlan.c index f576eb56d2..33d2ea620d 100644 --- a/sys/net/vlan/if_vlan.c +++ b/sys/net/vlan/if_vlan.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/net/if_vlan.c,v 1.15.2.13 2003/02/14 22:25:58 fenner Exp $ - * $DragonFly: src/sys/net/vlan/if_vlan.c,v 1.39 2008/09/17 07:51:59 sephe Exp $ + * $DragonFly: src/sys/net/vlan/if_vlan.c,v 1.40 2008/09/17 08:51:30 sephe Exp $ */ /* @@ -46,7 +46,6 @@ #include "use_vlan.h" #endif #include "opt_inet.h" -#include "opt_ethernet.h" #include #include