From e50d35e6c6c68e83fa329aff043d53ab84982fd3 Mon Sep 17 00:00:00 2001 From: Maxim Sobolev Date: Mon, 3 May 2010 07:32:50 +0000 Subject: [PATCH] Add new tunable 'net.link.ifqmaxlen' to set default send interface queue length. The default value for this parameter is 50, which is quite low for many of today's uses and the only way to modify this parameter right now is to edit if_var.h file. Also add read-only sysctl with the same name, so that it's possible to retrieve the current value. MFC after: 1 month --- sys/arm/at91/if_ate.c | 4 ++-- sys/arm/xscale/ixp425/if_npe.c | 2 +- sys/dev/ae/if_ae.c | 2 +- sys/dev/an/if_an.c | 4 ++-- sys/dev/ath/if_ath.c | 4 ++-- sys/dev/bwi/if_bwi.c | 4 ++-- sys/dev/bwn/if_bwn.c | 4 ++-- sys/dev/ce/if_ce.c | 8 ++++---- sys/dev/cm/smc90cx6.c | 2 +- sys/dev/cp/if_cp.c | 4 ++-- sys/dev/cs/if_cs.c | 2 +- sys/dev/ctau/if_ct.c | 4 ++-- sys/dev/cx/if_cx.c | 4 ++-- sys/dev/cxgb/cxgb_main.c | 2 +- sys/dev/ed/if_ed.c | 4 ++-- sys/dev/ep/if_ep.c | 4 ++-- sys/dev/ex/if_ex.c | 2 +- sys/dev/fe/if_fe.c | 2 +- sys/dev/ie/if_ie.c | 2 +- sys/dev/iicbus/if_ic.c | 2 +- sys/dev/ipw/if_ipw.c | 4 ++-- sys/dev/iwi/if_iwi.c | 4 ++-- sys/dev/iwn/if_iwn.c | 4 ++-- sys/dev/le/lance.c | 4 ++-- sys/dev/malo/if_malo.c | 4 ++-- sys/dev/mwl/if_mwl.c | 4 ++-- sys/dev/my/if_my.c | 4 ++-- sys/dev/nxge/if_nxge.c | 2 +- sys/dev/pdq/pdq_ifsubr.c | 2 +- sys/dev/ppbus/if_plip.c | 2 +- sys/dev/ral/rt2560.c | 4 ++-- sys/dev/ral/rt2661.c | 4 ++-- sys/dev/sbni/if_sbni.c | 2 +- sys/dev/smc/if_smc.c | 2 +- sys/dev/sn/if_sn.c | 4 ++-- sys/dev/snc/dp83932.c | 2 +- sys/dev/usb/net/uhso.c | 4 ++-- sys/dev/usb/net/usb_ethernet.c | 4 ++-- sys/dev/usb/wlan/if_rum.c | 4 ++-- sys/dev/usb/wlan/if_run.c | 4 ++-- sys/dev/usb/wlan/if_uath.c | 4 ++-- sys/dev/usb/wlan/if_upgt.c | 2 +- sys/dev/usb/wlan/if_ural.c | 4 ++-- sys/dev/usb/wlan/if_urtw.c | 4 ++-- sys/dev/usb/wlan/if_zyd.c | 2 +- sys/dev/vx/if_vx.c | 2 +- sys/dev/wi/if_wi.c | 4 ++-- sys/dev/wl/if_wl.c | 2 +- sys/dev/wpi/if_wpi.c | 4 ++-- sys/dev/xe/if_xe.c | 2 +- sys/mips/adm5120/if_admsw.c | 4 ++-- sys/mips/atheros/if_arge.c | 4 ++-- sys/net/if.c | 4 ++++ sys/net/if_ef.c | 2 +- sys/net/if_gif.c | 2 +- sys/net/if_gre.c | 2 +- sys/net/if_stf.c | 2 +- sys/net80211/ieee80211.c | 4 ++-- sys/netgraph/ng_eiface.c | 2 +- sys/netgraph/ng_fec.c | 2 +- sys/netgraph/ng_iface.c | 4 ++-- sys/netgraph/ng_tty.c | 2 +- sys/pci/if_rl.c | 4 ++-- 63 files changed, 103 insertions(+), 99 deletions(-) diff --git a/sys/arm/at91/if_ate.c b/sys/arm/at91/if_ate.c index 2f6b741cc10c..b0654823470a 100644 --- a/sys/arm/at91/if_ate.c +++ b/sys/arm/at91/if_ate.c @@ -272,8 +272,8 @@ ate_attach(device_t dev) ifp->if_ioctl = ateioctl; ifp->if_init = ateinit; ifp->if_baudrate = 10000000; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ifp->if_linkmib = &sc->mibdata; ifp->if_linkmiblen = sizeof(sc->mibdata); diff --git a/sys/arm/xscale/ixp425/if_npe.c b/sys/arm/xscale/ixp425/if_npe.c index 5b605aeb6d2a..3d8d670eec94 100644 --- a/sys/arm/xscale/ixp425/if_npe.c +++ b/sys/arm/xscale/ixp425/if_npe.c @@ -360,7 +360,7 @@ npe_attach(device_t dev) ifp->if_ioctl = npeioctl; ifp->if_init = npeinit; IFQ_SET_MAXLEN(&ifp->if_snd, sc->txdma.nbuf - 1); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ifp->if_linkmib = &sc->mibdata; ifp->if_linkmiblen = sizeof(sc->mibdata); diff --git a/sys/dev/ae/if_ae.c b/sys/dev/ae/if_ae.c index 68181f4b6d4d..d2812a4990bf 100644 --- a/sys/dev/ae/if_ae.c +++ b/sys/dev/ae/if_ae.c @@ -378,7 +378,7 @@ ae_attach(device_t dev) ifp->if_init = ae_init; ifp->if_capabilities = IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING; ifp->if_hwassist = 0; - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); IFQ_SET_READY(&ifp->if_snd); if (pci_find_extcap(dev, PCIY_PMG, &pmc) == 0) { diff --git a/sys/dev/an/if_an.c b/sys/dev/an/if_an.c index 6d9ef96831bd..645fe419ebea 100644 --- a/sys/dev/an/if_an.c +++ b/sys/dev/an/if_an.c @@ -767,8 +767,8 @@ an_attach(struct an_softc *sc, int flags) ifp->if_start = an_start; ifp->if_init = an_init; ifp->if_baudrate = 10000000; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); bzero(sc->an_config.an_nodename, sizeof(sc->an_config.an_nodename)); diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index 58474890e72d..15765f2b5b03 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -562,8 +562,8 @@ ath_attach(u_int16_t devid, struct ath_softc *sc) ifp->if_start = ath_start; ifp->if_ioctl = ath_ioctl; ifp->if_init = ath_init; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ic->ic_ifp = ifp; diff --git a/sys/dev/bwi/if_bwi.c b/sys/dev/bwi/if_bwi.c index 96c5cc6d3e51..724778d192c9 100644 --- a/sys/dev/bwi/if_bwi.c +++ b/sys/dev/bwi/if_bwi.c @@ -461,8 +461,8 @@ bwi_attach(struct bwi_softc *sc) ifp->if_init = bwi_init; ifp->if_ioctl = bwi_ioctl; ifp->if_start = bwi_start; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); callout_init_mtx(&sc->sc_watchdog_timer, &sc->sc_mtx, 0); diff --git a/sys/dev/bwn/if_bwn.c b/sys/dev/bwn/if_bwn.c index 5ca5098115c9..fd364035d3c0 100644 --- a/sys/dev/bwn/if_bwn.c +++ b/sys/dev/bwn/if_bwn.c @@ -1193,8 +1193,8 @@ bwn_attach_pre(struct bwn_softc *sc) ifp->if_init = bwn_init; ifp->if_ioctl = bwn_ioctl; ifp->if_start = bwn_start; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); return (0); diff --git a/sys/dev/ce/if_ce.c b/sys/dev/ce/if_ce.c index f04fd0916e64..d151b4243a8f 100644 --- a/sys/dev/ce/if_ce.c +++ b/sys/dev/ce/if_ce.c @@ -701,9 +701,9 @@ static int ce_attach (device_t dev) #endif continue; } - d->queue.ifq_maxlen = IFQ_MAXLEN; - d->hi_queue.ifq_maxlen = IFQ_MAXLEN; - d->rqueue.ifq_maxlen = IFQ_MAXLEN; + d->queue.ifq_maxlen = ifqmaxlen; + d->hi_queue.ifq_maxlen = ifqmaxlen; + d->rqueue.ifq_maxlen = ifqmaxlen; #if __FreeBSD_version >= 500000 mtx_init (&d->queue.ifq_mtx, "ce_queue", NULL, MTX_DEF); mtx_init (&d->hi_queue.ifq_mtx, "ce_queue_hi", NULL, MTX_DEF); @@ -732,7 +732,7 @@ static int ce_attach (device_t dev) d->ifp->if_ioctl = ce_sioctl; d->ifp->if_start = ce_ifstart; d->ifp->if_init = ce_initialize; - d->rqueue.ifq_maxlen = IFQ_MAXLEN; + d->rqueue.ifq_maxlen = ifqmaxlen; #if __FreeBSD_version >= 500000 mtx_init (&d->rqueue.ifq_mtx, "ce_rqueue", NULL, MTX_DEF); #endif diff --git a/sys/dev/cm/smc90cx6.c b/sys/dev/cm/smc90cx6.c index 0e9015ea17c8..719e46868a15 100644 --- a/sys/dev/cm/smc90cx6.c +++ b/sys/dev/cm/smc90cx6.c @@ -189,7 +189,7 @@ cm_attach(dev) ifp->if_ioctl = cm_ioctl; ifp->if_init = cm_init; /* XXX IFQ_SET_READY(&ifp->if_snd); */ - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX; arc_ifattach(ifp, linkaddress); diff --git a/sys/dev/cp/if_cp.c b/sys/dev/cp/if_cp.c index f6eeed5058e0..e64023098462 100644 --- a/sys/dev/cp/if_cp.c +++ b/sys/dev/cp/if_cp.c @@ -505,8 +505,8 @@ static int cp_attach (device_t dev) NG_NODE_UNREF (d->node); continue; } - d->queue.ifq_maxlen = IFQ_MAXLEN; - d->hi_queue.ifq_maxlen = IFQ_MAXLEN; + d->queue.ifq_maxlen = ifqmaxlen; + d->hi_queue.ifq_maxlen = ifqmaxlen; mtx_init (&d->queue.ifq_mtx, "cp_queue", NULL, MTX_DEF); mtx_init (&d->hi_queue.ifq_mtx, "cp_queue_hi", NULL, MTX_DEF); #else /*NETGRAPH*/ diff --git a/sys/dev/cs/if_cs.c b/sys/dev/cs/if_cs.c index b32a03d57cf0..476b9ddbb961 100644 --- a/sys/dev/cs/if_cs.c +++ b/sys/dev/cs/if_cs.c @@ -500,7 +500,7 @@ cs_attach(device_t dev) ifp->if_start=cs_start; ifp->if_ioctl=cs_ioctl; ifp->if_init=cs_init; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); ifp->if_flags=(IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); diff --git a/sys/dev/ctau/if_ct.c b/sys/dev/ctau/if_ct.c index 125dfa5ed803..dbdca97411d0 100644 --- a/sys/dev/ctau/if_ct.c +++ b/sys/dev/ctau/if_ct.c @@ -722,8 +722,8 @@ static int ct_attach (device_t dev) ct_bus_dma_mem_free (&d->dmamem); continue; } - d->queue.ifq_maxlen = IFQ_MAXLEN; - d->hi_queue.ifq_maxlen = IFQ_MAXLEN; + d->queue.ifq_maxlen = ifqmaxlen; + d->hi_queue.ifq_maxlen = ifqmaxlen; mtx_init (&d->queue.ifq_mtx, "ct_queue", NULL, MTX_DEF); mtx_init (&d->hi_queue.ifq_mtx, "ct_queue_hi", NULL, MTX_DEF); #else /*NETGRAPH*/ diff --git a/sys/dev/cx/if_cx.c b/sys/dev/cx/if_cx.c index 4e9750e14836..c8f53a00bec7 100644 --- a/sys/dev/cx/if_cx.c +++ b/sys/dev/cx/if_cx.c @@ -831,8 +831,8 @@ static int cx_attach (device_t dev) cx_bus_dma_mem_free (&d->dmamem); continue; } - d->lo_queue.ifq_maxlen = IFQ_MAXLEN; - d->hi_queue.ifq_maxlen = IFQ_MAXLEN; + d->lo_queue.ifq_maxlen = ifqmaxlen; + d->hi_queue.ifq_maxlen = ifqmaxlen; mtx_init (&d->lo_queue.ifq_mtx, "cx_queue_lo", NULL, MTX_DEF); mtx_init (&d->hi_queue.ifq_mtx, "cx_queue_hi", NULL, MTX_DEF); #else /*NETGRAPH*/ diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c index a47284fe9aec..a805b5d98268 100644 --- a/sys/dev/cxgb/cxgb_main.c +++ b/sys/dev/cxgb/cxgb_main.c @@ -1012,7 +1012,7 @@ cxgb_port_attach(device_t dev) ifp->if_ioctl = cxgb_ioctl; ifp->if_start = cxgb_start; - ifp->if_snd.ifq_drv_maxlen = cxgb_snd_queue_len; + ifp->if_snd.ifq_drv_maxlen = max(cxgb_snd_queue_len, ifqmaxlen); IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); IFQ_SET_READY(&ifp->if_snd); diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c index e065a670d5cb..839e2a52cc99 100644 --- a/sys/dev/ed/if_ed.c +++ b/sys/dev/ed/if_ed.c @@ -283,8 +283,8 @@ ed_attach(device_t dev) ifp->if_start = ed_start; ifp->if_ioctl = ed_ioctl; ifp->if_init = ed_init; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ifp->if_linkmib = &sc->mibdata; ifp->if_linkmiblen = sizeof sc->mibdata; diff --git a/sys/dev/ep/if_ep.c b/sys/dev/ep/if_ep.c index 59dd1c4cc99a..24362558ff35 100644 --- a/sys/dev/ep/if_ep.c +++ b/sys/dev/ep/if_ep.c @@ -306,8 +306,8 @@ ep_attach(struct ep_softc *sc) ifp->if_start = epstart; ifp->if_ioctl = epioctl; ifp->if_init = epinit; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); callout_init_mtx(&sc->watchdog_timer, &sc->sc_mtx, 0); diff --git a/sys/dev/ex/if_ex.c b/sys/dev/ex/if_ex.c index d9e0c98f9fa1..efd54bca0e55 100644 --- a/sys/dev/ex/if_ex.c +++ b/sys/dev/ex/if_ex.c @@ -237,7 +237,7 @@ ex_attach(device_t dev) ifp->if_start = ex_start; ifp->if_ioctl = ex_ioctl; ifp->if_init = ex_init; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); ifmedia_init(&sc->ifmedia, 0, ex_ifmedia_upd, ex_ifmedia_sts); mtx_init(&sc->lock, device_get_nameunit(dev), MTX_NETWORK_LOCK, diff --git a/sys/dev/fe/if_fe.c b/sys/dev/fe/if_fe.c index eff92b77366e..9fe1f2c2a09f 100644 --- a/sys/dev/fe/if_fe.c +++ b/sys/dev/fe/if_fe.c @@ -766,7 +766,7 @@ fe_attach (device_t dev) * Set fixed interface flags. */ ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); #if FE_SINGLE_TRANSMISSION /* Override txb config to allocate minimum. */ diff --git a/sys/dev/ie/if_ie.c b/sys/dev/ie/if_ie.c index 34c658eef3d8..172bf9e5bdfb 100644 --- a/sys/dev/ie/if_ie.c +++ b/sys/dev/ie/if_ie.c @@ -318,7 +318,7 @@ ie_attach(device_t dev) ifp->if_start = iestart; ifp->if_ioctl = ieioctl; ifp->if_init = ieinit; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); ether_ifattach(ifp, sc->enaddr); diff --git a/sys/dev/iicbus/if_ic.c b/sys/dev/iicbus/if_ic.c index bb5186cc401d..4a05b163f6bf 100644 --- a/sys/dev/iicbus/if_ic.c +++ b/sys/dev/iicbus/if_ic.c @@ -181,7 +181,7 @@ icattach(device_t dev) ifp->if_output = icoutput; ifp->if_hdrlen = 0; ifp->if_addrlen = 0; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; ic_alloc_buffers(sc, ICMTU); diff --git a/sys/dev/ipw/if_ipw.c b/sys/dev/ipw/if_ipw.c index 3315d654b1cd..2329c3377e06 100644 --- a/sys/dev/ipw/if_ipw.c +++ b/sys/dev/ipw/if_ipw.c @@ -289,8 +289,8 @@ ipw_attach(device_t dev) ifp->if_init = ipw_init; ifp->if_ioctl = ipw_ioctl; ifp->if_start = ipw_start; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ic->ic_ifp = ifp; diff --git a/sys/dev/iwi/if_iwi.c b/sys/dev/iwi/if_iwi.c index 1105425da632..4b765ef16e9c 100644 --- a/sys/dev/iwi/if_iwi.c +++ b/sys/dev/iwi/if_iwi.c @@ -363,8 +363,8 @@ iwi_attach(device_t dev) ifp->if_init = iwi_init; ifp->if_ioctl = iwi_ioctl; ifp->if_start = iwi_start; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ic->ic_ifp = ifp; diff --git a/sys/dev/iwn/if_iwn.c b/sys/dev/iwn/if_iwn.c index 09c1efdbe71b..5a17d1e3a7a9 100644 --- a/sys/dev/iwn/if_iwn.c +++ b/sys/dev/iwn/if_iwn.c @@ -627,8 +627,8 @@ iwn_attach(device_t dev) ifp->if_init = iwn_init; ifp->if_ioctl = iwn_ioctl; ifp->if_start = iwn_start; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ieee80211_ifattach(ic, macaddr); diff --git a/sys/dev/le/lance.c b/sys/dev/le/lance.c index db200995fa78..8700aa2cd436 100644 --- a/sys/dev/le/lance.c +++ b/sys/dev/le/lance.c @@ -133,8 +133,8 @@ lance_config(struct lance_softc *sc, const char* name, int unit) ifp->if_flags &= ~IFF_MULTICAST; #endif ifp->if_baudrate = IF_Mbps(10); - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); /* Initialize ifmedia structures. */ diff --git a/sys/dev/malo/if_malo.c b/sys/dev/malo/if_malo.c index 57e0d3d8fa3a..ae6ef8826521 100644 --- a/sys/dev/malo/if_malo.c +++ b/sys/dev/malo/if_malo.c @@ -275,8 +275,8 @@ malo_attach(uint16_t devid, struct malo_softc *sc) ifp->if_start = malo_start; ifp->if_ioctl = malo_ioctl; ifp->if_init = malo_init; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ic->ic_ifp = ifp; diff --git a/sys/dev/mwl/if_mwl.c b/sys/dev/mwl/if_mwl.c index e4e469b5bcfd..662f201c195e 100644 --- a/sys/dev/mwl/if_mwl.c +++ b/sys/dev/mwl/if_mwl.c @@ -404,8 +404,8 @@ mwl_attach(uint16_t devid, struct mwl_softc *sc) ifp->if_start = mwl_start; ifp->if_ioctl = mwl_ioctl; ifp->if_init = mwl_init; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ic->ic_ifp = ifp; diff --git a/sys/dev/my/if_my.c b/sys/dev/my/if_my.c index 99f6071ba200..951473a3ba7a 100644 --- a/sys/dev/my/if_my.c +++ b/sys/dev/my/if_my.c @@ -902,8 +902,8 @@ my_attach(device_t dev) ifp->if_start = my_start; ifp->if_init = my_init; ifp->if_baudrate = 10000000; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); if (sc->my_info->my_did == MTD803ID) diff --git a/sys/dev/nxge/if_nxge.c b/sys/dev/nxge/if_nxge.c index c86d7b61bad9..0e67413747ce 100644 --- a/sys/dev/nxge/if_nxge.c +++ b/sys/dev/nxge/if_nxge.c @@ -1190,7 +1190,7 @@ xge_interface_setup(device_t dev) ifnetp->if_start = xge_send; /* TODO: Check and assign optimal value */ - ifnetp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifnetp->if_snd.ifq_maxlen = ifqmaxlen; ifnetp->if_capabilities = IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM; diff --git a/sys/dev/pdq/pdq_ifsubr.c b/sys/dev/pdq/pdq_ifsubr.c index ec141502a9e8..4df00825fe4c 100644 --- a/sys/dev/pdq/pdq_ifsubr.c +++ b/sys/dev/pdq/pdq_ifsubr.c @@ -471,7 +471,7 @@ pdq_ifattach(pdq_softc_t *sc, const pdq_uint8_t *llc, pdq_type_t type) if_initname(ifp, device_get_name(sc->dev), device_get_unit(sc->dev)); ifp->if_softc = sc; ifp->if_init = pdq_ifinit; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; ifp->if_flags = IFF_BROADCAST|IFF_SIMPLEX|IFF_NOTRAILERS|IFF_MULTICAST; ifp->if_ioctl = pdq_ifioctl; diff --git a/sys/dev/ppbus/if_plip.c b/sys/dev/ppbus/if_plip.c index 3e4c1ca3b2b2..fc81aec97b81 100644 --- a/sys/dev/ppbus/if_plip.c +++ b/sys/dev/ppbus/if_plip.c @@ -262,7 +262,7 @@ lp_attach(device_t dev) ifp->if_output = lpoutput; ifp->if_hdrlen = 0; ifp->if_addrlen = 0; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; if_attach(ifp); bpfattach(ifp, DLT_NULL, sizeof(u_int32_t)); diff --git a/sys/dev/ral/rt2560.c b/sys/dev/ral/rt2560.c index 9549107005f3..8589768d4226 100644 --- a/sys/dev/ral/rt2560.c +++ b/sys/dev/ral/rt2560.c @@ -267,8 +267,8 @@ rt2560_attach(device_t dev, int id) ifp->if_init = rt2560_init; ifp->if_ioctl = rt2560_ioctl; ifp->if_start = rt2560_start; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ic->ic_ifp = ifp; diff --git a/sys/dev/ral/rt2661.c b/sys/dev/ral/rt2661.c index 9bc88385768a..9b77c23dc0e9 100644 --- a/sys/dev/ral/rt2661.c +++ b/sys/dev/ral/rt2661.c @@ -269,8 +269,8 @@ rt2661_attach(device_t dev, int id) ifp->if_init = rt2661_init; ifp->if_ioctl = rt2661_ioctl; ifp->if_start = rt2661_start; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ic->ic_ifp = ifp; diff --git a/sys/dev/sbni/if_sbni.c b/sys/dev/sbni/if_sbni.c index 8c8687c12957..7ca46d31115c 100644 --- a/sys/dev/sbni/if_sbni.c +++ b/sys/dev/sbni/if_sbni.c @@ -235,7 +235,7 @@ sbni_attach(struct sbni_softc *sc, int unit, struct sbni_flags flags) ifp->if_init = sbni_init; ifp->if_start = sbni_start; ifp->if_ioctl = sbni_ioctl; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); /* report real baud rate */ csr0 = sbni_inb(sc, CSR0); diff --git a/sys/dev/smc/if_smc.c b/sys/dev/smc/if_smc.c index f7f54076a961..6d9ba5926790 100644 --- a/sys/dev/smc/if_smc.c +++ b/sys/dev/smc/if_smc.c @@ -347,7 +347,7 @@ smc_attach(device_t dev) ifp->if_init = smc_init; ifp->if_ioctl = smc_ioctl; ifp->if_start = smc_start; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); IFQ_SET_READY(&ifp->if_snd); ifp->if_capabilities = ifp->if_capenable = 0; diff --git a/sys/dev/sn/if_sn.c b/sys/dev/sn/if_sn.c index 217d811cb0ae..0f86f92e76dd 100644 --- a/sys/dev/sn/if_sn.c +++ b/sys/dev/sn/if_sn.c @@ -207,8 +207,8 @@ sn_attach(device_t dev) ifp->if_ioctl = snioctl; ifp->if_init = sninit; ifp->if_baudrate = 10000000; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ether_ifattach(ifp, eaddr); diff --git a/sys/dev/snc/dp83932.c b/sys/dev/snc/dp83932.c index c659c82fd2c7..0b62053e2fec 100644 --- a/sys/dev/snc/dp83932.c +++ b/sys/dev/snc/dp83932.c @@ -177,7 +177,7 @@ sncconfig(sc, media, nmedia, defmedia, myea) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_init = sncinit; ifp->if_mtu = ETHERMTU; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); /* Initialize media goo. */ ifmedia_init(&sc->sc_media, 0, snc_mediachange, diff --git a/sys/dev/usb/net/uhso.c b/sys/dev/usb/net/uhso.c index a810ec48c5dd..21a23c9f6fc4 100644 --- a/sys/dev/usb/net/uhso.c +++ b/sys/dev/usb/net/uhso.c @@ -1471,8 +1471,8 @@ static int uhso_attach_ifnet(struct uhso_softc *sc, struct usb_interface *iface, ifp->if_output = uhso_if_output; ifp->if_flags = 0; ifp->if_softc = sc; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); if_attach(ifp); diff --git a/sys/dev/usb/net/usb_ethernet.c b/sys/dev/usb/net/usb_ethernet.c index 6cf446016e75..bd75cef96574 100644 --- a/sys/dev/usb/net/usb_ethernet.c +++ b/sys/dev/usb/net/usb_ethernet.c @@ -214,8 +214,8 @@ ue_attach_post_task(struct usb_proc_msg *_task) ifp->if_ioctl = uether_ioctl; ifp->if_start = ue_start; ifp->if_init = ue_init; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ue->ue_ifp = ifp; diff --git a/sys/dev/usb/wlan/if_rum.c b/sys/dev/usb/wlan/if_rum.c index 4a5fbae27795..155b76787f0a 100644 --- a/sys/dev/usb/wlan/if_rum.c +++ b/sys/dev/usb/wlan/if_rum.c @@ -478,8 +478,8 @@ rum_attach(device_t self) ifp->if_init = rum_init; ifp->if_ioctl = rum_ioctl; ifp->if_start = rum_start; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ic->ic_ifp = ifp; diff --git a/sys/dev/usb/wlan/if_run.c b/sys/dev/usb/wlan/if_run.c index 3ab607fa342b..c798c32b823e 100644 --- a/sys/dev/usb/wlan/if_run.c +++ b/sys/dev/usb/wlan/if_run.c @@ -609,8 +609,8 @@ run_attach(device_t self) ifp->if_init = run_init; ifp->if_ioctl = run_ioctl; ifp->if_start = run_start; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ic->ic_ifp = ifp; diff --git a/sys/dev/usb/wlan/if_uath.c b/sys/dev/usb/wlan/if_uath.c index 7838d5ad3533..40b7c83da10b 100644 --- a/sys/dev/usb/wlan/if_uath.c +++ b/sys/dev/usb/wlan/if_uath.c @@ -438,8 +438,8 @@ uath_attach(device_t dev) ifp->if_ioctl = uath_ioctl; ifp->if_start = uath_start; /* XXX UATH_TX_DATA_LIST_COUNT */ - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ic = ifp->if_l2com; diff --git a/sys/dev/usb/wlan/if_upgt.c b/sys/dev/usb/wlan/if_upgt.c index 20f06c6ddea7..091b9dfe45be 100644 --- a/sys/dev/usb/wlan/if_upgt.c +++ b/sys/dev/usb/wlan/if_upgt.c @@ -331,7 +331,7 @@ upgt_attach(device_t dev) ifp->if_init = upgt_init; ifp->if_ioctl = upgt_ioctl; ifp->if_start = upgt_start; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); IFQ_SET_READY(&ifp->if_snd); ic = ifp->if_l2com; diff --git a/sys/dev/usb/wlan/if_ural.c b/sys/dev/usb/wlan/if_ural.c index 4a4378b90ef3..6839bcff1b19 100644 --- a/sys/dev/usb/wlan/if_ural.c +++ b/sys/dev/usb/wlan/if_ural.c @@ -467,8 +467,8 @@ ural_attach(device_t self) ifp->if_init = ural_init; ifp->if_ioctl = ural_ioctl; ifp->if_start = ural_start; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ic->ic_ifp = ifp; diff --git a/sys/dev/usb/wlan/if_urtw.c b/sys/dev/usb/wlan/if_urtw.c index 6604268e009b..9ff16f3b137e 100644 --- a/sys/dev/usb/wlan/if_urtw.c +++ b/sys/dev/usb/wlan/if_urtw.c @@ -867,8 +867,8 @@ urtw_attach(device_t dev) ifp->if_ioctl = urtw_ioctl; ifp->if_start = urtw_start; /* XXX URTW_TX_DATA_LIST_COUNT */ - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ic = ifp->if_l2com; diff --git a/sys/dev/usb/wlan/if_zyd.c b/sys/dev/usb/wlan/if_zyd.c index a0b8179a4a33..1a298f8ff586 100644 --- a/sys/dev/usb/wlan/if_zyd.c +++ b/sys/dev/usb/wlan/if_zyd.c @@ -381,7 +381,7 @@ zyd_attach(device_t dev) ifp->if_init = zyd_init; ifp->if_ioctl = zyd_ioctl; ifp->if_start = zyd_start; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); IFQ_SET_READY(&ifp->if_snd); ic = ifp->if_l2com; diff --git a/sys/dev/vx/if_vx.c b/sys/dev/vx/if_vx.c index 0dea9bf90935..1ea0faf2b11c 100644 --- a/sys/dev/vx/if_vx.c +++ b/sys/dev/vx/if_vx.c @@ -189,7 +189,7 @@ vx_attach(device_t dev) } ifp->if_mtu = ETHERMTU; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_start = vx_start; ifp->if_ioctl = vx_ioctl; diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c index 616c5d7b3302..fe0d903d1734 100644 --- a/sys/dev/wi/if_wi.c +++ b/sys/dev/wi/if_wi.c @@ -333,8 +333,8 @@ wi_attach(device_t dev) ifp->if_ioctl = wi_ioctl; ifp->if_start = wi_start; ifp->if_init = wi_init; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ic->ic_ifp = ifp; diff --git a/sys/dev/wl/if_wl.c b/sys/dev/wl/if_wl.c index ed291ed8dbd2..a95997e4225e 100644 --- a/sys/dev/wl/if_wl.c +++ b/sys/dev/wl/if_wl.c @@ -559,7 +559,7 @@ wlattach(device_t device) ifp->if_init = wlinit; ifp->if_start = wlstart; ifp->if_ioctl = wlioctl; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; /* no entries ifp->if_done ifp->if_reset diff --git a/sys/dev/wpi/if_wpi.c b/sys/dev/wpi/if_wpi.c index 9bf9342140ab..f6edc916569c 100644 --- a/sys/dev/wpi/if_wpi.c +++ b/sys/dev/wpi/if_wpi.c @@ -661,8 +661,8 @@ wpi_attach(device_t dev) ifp->if_init = wpi_init; ifp->if_ioctl = wpi_ioctl; ifp->if_start = wpi_start; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ieee80211_ifattach(ic, macaddr); diff --git a/sys/dev/xe/if_xe.c b/sys/dev/xe/if_xe.c index f18fd9842c91..77b953ac8863 100644 --- a/sys/dev/xe/if_xe.c +++ b/sys/dev/xe/if_xe.c @@ -254,7 +254,7 @@ xe_attach(device_t dev) scp->ifp->if_ioctl = xe_ioctl; scp->ifp->if_init = xe_init; scp->ifp->if_baudrate = 100000000; - IFQ_SET_MAXLEN(&scp->ifp->if_snd, IFQ_MAXLEN); + IFQ_SET_MAXLEN(&scp->ifp->if_snd, ifqmaxlen); /* Initialise the ifmedia structure */ ifmedia_init(scp->ifm, 0, xe_media_change, xe_media_status); diff --git a/sys/mips/adm5120/if_admsw.c b/sys/mips/adm5120/if_admsw.c index 164e84008a28..472a80414a78 100644 --- a/sys/mips/adm5120/if_admsw.c +++ b/sys/mips/adm5120/if_admsw.c @@ -540,8 +540,8 @@ admsw_attach(device_t dev) ifp->if_init = admsw_init; ifp->if_mtu = ETHERMTU; ifp->if_baudrate = IF_Mbps(100); - IFQ_SET_MAXLEN(&ifp->if_snd, max(ADMSW_NTXLDESC, IFQ_MAXLEN)); - ifp->if_snd.ifq_drv_maxlen = max(ADMSW_NTXLDESC, IFQ_MAXLEN); + IFQ_SET_MAXLEN(&ifp->if_snd, max(ADMSW_NTXLDESC, ifqmaxlen)); + ifp->if_snd.ifq_drv_maxlen = max(ADMSW_NTXLDESC, ifqmaxlen); IFQ_SET_READY(&ifp->if_snd); ifp->if_capabilities |= IFCAP_VLAN_MTU; diff --git a/sys/mips/atheros/if_arge.c b/sys/mips/atheros/if_arge.c index 4367bfb001d6..eef1dcf037bf 100644 --- a/sys/mips/atheros/if_arge.c +++ b/sys/mips/atheros/if_arge.c @@ -312,8 +312,8 @@ arge_attach(device_t dev) sc->arge_if_flags = ifp->if_flags; /* XXX: add real size */ - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ifp->if_capenable = ifp->if_capabilities; diff --git a/sys/net/if.c b/sys/net/if.c index 1acfb24dc511..780f2c291aac 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -104,6 +104,10 @@ struct ifindex_entry { SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW, 0, "Link layers"); SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW, 0, "Generic link-management"); +TUNABLE_INT("net.link.ifqmaxlen", &ifqmaxlen); +SYSCTL_UINT(_net_link, OID_AUTO, ifqmaxlen, CTLFLAG_RDTUN, + &ifqmaxlen, 0, "max send queue size"); + /* Log link state change events */ static int log_link_state_change = 1; diff --git a/sys/net/if_ef.c b/sys/net/if_ef.c index 94fb03d13a45..61f7cb7933fd 100644 --- a/sys/net/if_ef.c +++ b/sys/net/if_ef.c @@ -129,7 +129,7 @@ ef_attach(struct efnet *sc) ifp->if_start = ef_start; ifp->if_init = ef_init; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; ifp->if_flags = (IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); /* * Attach the interface diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c index ae0ff4e33690..76838396bc44 100644 --- a/sys/net/if_gif.c +++ b/sys/net/if_gif.c @@ -185,7 +185,7 @@ gif_clone_create(ifc, unit, params) GIF2IFP(sc)->if_ioctl = gif_ioctl; GIF2IFP(sc)->if_start = gif_start; GIF2IFP(sc)->if_output = gif_output; - GIF2IFP(sc)->if_snd.ifq_maxlen = IFQ_MAXLEN; + GIF2IFP(sc)->if_snd.ifq_maxlen = ifqmaxlen; if_attach(GIF2IFP(sc)); bpfattach(GIF2IFP(sc), DLT_NULL, sizeof(u_int32_t)); if (ng_gif_attach_p != NULL) diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c index bac3d7954fa1..1f1e1082d9b3 100644 --- a/sys/net/if_gre.c +++ b/sys/net/if_gre.c @@ -184,7 +184,7 @@ gre_clone_create(ifc, unit, params) GRE2IFP(sc)->if_softc = sc; if_initname(GRE2IFP(sc), ifc->ifc_name, unit); - GRE2IFP(sc)->if_snd.ifq_maxlen = IFQ_MAXLEN; + GRE2IFP(sc)->if_snd.ifq_maxlen = ifqmaxlen; GRE2IFP(sc)->if_addrlen = 0; GRE2IFP(sc)->if_hdrlen = 24; /* IP + GRE */ GRE2IFP(sc)->if_mtu = GREMTU; diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c index 5c082c4926a6..1ef5581ae629 100644 --- a/sys/net/if_stf.c +++ b/sys/net/if_stf.c @@ -252,7 +252,7 @@ stf_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) ifp->if_mtu = IPV6_MMTU; ifp->if_ioctl = stf_ioctl; ifp->if_output = stf_output; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; if_attach(ifp); bpfattach(ifp, DLT_NULL, sizeof(u_int32_t)); return (0); diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c index 3d5669caec58..97ff7c21ad49 100644 --- a/sys/net80211/ieee80211.c +++ b/sys/net80211/ieee80211.c @@ -394,8 +394,8 @@ ieee80211_vap_setup(struct ieee80211com *ic, struct ieee80211vap *vap, ifp->if_ioctl = ieee80211_ioctl; ifp->if_init = ieee80211_init; /* NB: input+output filled in by ether_ifattach */ - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); vap->iv_ifp = ifp; diff --git a/sys/netgraph/ng_eiface.c b/sys/netgraph/ng_eiface.c index 72cc55caae22..4239328967ef 100644 --- a/sys/netgraph/ng_eiface.c +++ b/sys/netgraph/ng_eiface.c @@ -369,7 +369,7 @@ ng_eiface_constructor(node_p node) ifp->if_output = ether_output; ifp->if_start = ng_eiface_start; ifp->if_ioctl = ng_eiface_ioctl; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; ifp->if_flags = (IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST); /* Give this node the same name as the interface (if possible) */ diff --git a/sys/netgraph/ng_fec.c b/sys/netgraph/ng_fec.c index 919947acab42..ce5a2d58f813 100644 --- a/sys/netgraph/ng_fec.c +++ b/sys/netgraph/ng_fec.c @@ -1227,7 +1227,7 @@ ng_fec_constructor(node_p node) ifp->if_start = ng_fec_start; ifp->if_ioctl = ng_fec_ioctl; ifp->if_init = ng_fec_init; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; ifp->if_mtu = NG_FEC_MTU_DEFAULT; ifp->if_flags = (IFF_SIMPLEX|IFF_BROADCAST|IFF_MULTICAST); ifp->if_addrlen = 0; /* XXX */ diff --git a/sys/netgraph/ng_iface.c b/sys/netgraph/ng_iface.c index d53bf768b10d..f94fd14930fd 100644 --- a/sys/netgraph/ng_iface.c +++ b/sys/netgraph/ng_iface.c @@ -564,8 +564,8 @@ ng_iface_constructor(node_p node) ifp->if_addrlen = 0; /* XXX */ ifp->if_hdrlen = 0; /* XXX */ ifp->if_baudrate = 64000; /* XXX */ - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); /* Give this node the same name as the interface (if possible) */ diff --git a/sys/netgraph/ng_tty.c b/sys/netgraph/ng_tty.c index 2fa33fc8005f..84083170d8a2 100644 --- a/sys/netgraph/ng_tty.c +++ b/sys/netgraph/ng_tty.c @@ -164,7 +164,7 @@ ngt_constructor(node_p node) sc->node = node; mtx_init(&sc->outq.ifq_mtx, "ng_tty node+queue", NULL, MTX_DEF); - IFQ_SET_MAXLEN(&sc->outq, IFQ_MAXLEN); + IFQ_SET_MAXLEN(&sc->outq, ifqmaxlen); return (0); } diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c index 8b225169a9c7..cd7609db6978 100644 --- a/sys/pci/if_rl.c +++ b/sys/pci/if_rl.c @@ -942,8 +942,8 @@ rl_attach(device_t dev) #ifdef DEVICE_POLLING ifp->if_capabilities |= IFCAP_POLLING; #endif - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); /*