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
This commit is contained in:
Maxim Sobolev 2010-05-03 07:32:50 +00:00
parent 551e75c7af
commit e50d35e6c6
63 changed files with 103 additions and 99 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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) {

View File

@ -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));

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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);

View File

@ -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*/

View File

@ -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);

View File

@ -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*/

View File

@ -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*/

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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,

View File

@ -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. */

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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. */

View File

@ -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;

View File

@ -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;

View File

@ -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)

View File

@ -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;

View File

@ -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;

View File

@ -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));

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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,

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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)

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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) */

View File

@ -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 */

View File

@ -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) */

View File

@ -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);
}

View File

@ -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);
/*