ifq: Use ifq_set_maxlen for ifnet.if_snd
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 27 Dec 2012 09:39:50 +0000 (17:39 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 27 Dec 2012 09:39:50 +0000 (17:39 +0800)
20 files changed:
sys/dev/netif/de/if_de.c
sys/dev/netif/ixgbe/ixgbe.c
sys/net/disc/if_disc.c
sys/net/ef/if_ef.c
sys/net/faith/if_faith.c
sys/net/gif/if_gif.c
sys/net/gre/if_gre.c
sys/net/if.c
sys/net/pf/if_pflog.c
sys/net/pf/if_pfsync.c
sys/net/sppp/if_spppsubr.c
sys/net/stf/if_stf.c
sys/netgraph/eiface/ng_eiface.c
sys/netgraph/fec/ng_fec.c
sys/netgraph/iface/ng_iface.c
sys/netgraph7/iface/ng_iface.c
sys/netgraph7/ng_eiface.c
sys/netgraph7/ng_fec.c
sys/netgraph7/ng_source.c
sys/netproto/atm/atm_if.c

index 8e8b082..7700bd7 100644 (file)
@@ -3887,8 +3887,8 @@ tulip_attach(tulip_softc_t *sc)
 
     tulip_reset(sc);
 
+    ifq_set_maxlen(&ifp->if_snd, ifqmaxlen);
     ether_ifattach(&(sc)->tulip_if, sc->tulip_enaddr, NULL);
-    ifp->if_snd.ifq_maxlen = ifqmaxlen;
 }
 
 static void
index 371f69b..274affd 100644 (file)
@@ -2415,7 +2415,7 @@ ixgbe_setup_interface(device_t dev, struct adapter *adapter)
        ifp->if_transmit = ixgbe_mq_start;
        ifp->if_qflush = ixgbe_qflush;
 #endif
-       ifp->if_snd.ifq_maxlen = adapter->num_tx_desc - 2;
+       ifq_set_maxlen(&ifp->if_snd, adapter->num_tx_desc - 2);
 
        ether_ifattach(ifp, adapter->hw.mac.addr, NULL);
 
index 4f5cbb4..0fa42ac 100644 (file)
@@ -49,6 +49,7 @@
 
 #include <net/if.h>
 #include <net/if_types.h>
+#include <net/ifq_var.h>
 #include <net/route.h>
 #include <net/bpf.h>
 
@@ -83,7 +84,7 @@ discattach(void)
        ifp->if_type = IFT_LOOP;
        ifp->if_hdrlen = 0;
        ifp->if_addrlen = 0;
-       ifp->if_snd.ifq_maxlen = 20;
+       ifq_set_maxlen(&ifp->if_snd, 20);
        if_attach(ifp, NULL);
        bpfattach(ifp, DLT_NULL, sizeof(u_int));
 }
index 463503f..1e2bc07 100644 (file)
@@ -47,6 +47,7 @@
 #include <net/if_arp.h>
 #include <net/if_dl.h>
 #include <net/if_types.h>
+#include <net/ifq_var.h>
 #include <net/netisr.h>
 #include <net/route.h>
 #include <net/bpf.h>
@@ -132,7 +133,7 @@ ef_attach(struct efnet *sc)
        ifp->if_start = ef_start;
        ifp->if_watchdog = NULL;
        ifp->if_init = ef_init;
-       ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
+       ifq_set_maxlen(&ifp->if_snd, IFQ_MAXLEN);
        ifp->if_flags = (IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST);
        /*
         * Attach the interface
index b1a1dc7..29813e2 100644 (file)
@@ -64,6 +64,7 @@
 
 #include <net/if.h>
 #include <net/if_types.h>
+#include <net/ifq_var.h>
 #include <net/netisr.h>
 #include <net/route.h>
 #include <net/bpf.h>
@@ -172,7 +173,7 @@ faith_clone_create(struct if_clone *ifc, int unit, caddr_t param __unused)
        sc->sc_if.if_type = IFT_FAITH;
        sc->sc_if.if_hdrlen = 0;
        sc->sc_if.if_addrlen = 0;
-       sc->sc_if.if_snd.ifq_maxlen = ifqmaxlen;
+       ifq_set_maxlen(&sc->sc_if.if_snd, ifqmaxlen);
        if_attach(&sc->sc_if, NULL);
        bpfattach(&sc->sc_if, DLT_NULL, sizeof(u_int));
        LIST_INSERT_HEAD(&faith_softc_list, sc, sc_list);
index d4849b8..636c27b 100644 (file)
@@ -54,6 +54,7 @@
 
 #include <net/if.h>
 #include <net/if_types.h>
+#include <net/ifq_var.h>
 #include <net/netisr.h>
 #include <net/route.h>
 #include <net/bpf.h>
@@ -161,7 +162,7 @@ gifattach0(struct gif_softc *sc)
        sc->gif_if.if_ioctl  = gif_ioctl;
        sc->gif_if.if_output = gif_output;
        sc->gif_if.if_type   = IFT_GIF;
-       sc->gif_if.if_snd.ifq_maxlen = IFQ_MAXLEN;
+       ifq_set_maxlen(&sc->gif_if.if_snd, IFQ_MAXLEN);
        if_attach(&sc->gif_if, NULL);
        bpfattach(&sc->gif_if, DLT_NULL, sizeof(u_int));
 }
index a908db6..90f7ff3 100644 (file)
@@ -65,6 +65,7 @@
 #include <net/ethernet.h>
 #include <net/if.h>
 #include <net/if_types.h>
+#include <net/ifq_var.h>
 #include <net/route.h>
 #include <net/if_clone.h>
 
@@ -186,7 +187,7 @@ gre_clone_create(struct if_clone *ifc, int unit, caddr_t param __unused)
 
        sc->sc_if.if_softc = sc;
        if_initname(&(sc->sc_if), GRENAME, unit);
-       sc->sc_if.if_snd.ifq_maxlen = IFQ_MAXLEN;
+       ifq_set_maxlen(&sc->sc_if.if_snd, IFQ_MAXLEN);
        sc->sc_if.if_type = IFT_OTHER;
        sc->sc_if.if_addrlen = 0;
        sc->sc_if.if_hdrlen = 24; /* IP + GRE */
index a674c54..0e57a88 100644 (file)
@@ -205,7 +205,7 @@ ifinit(void *dummy)
        TAILQ_FOREACH(ifp, &ifnet, if_link) {
                if (ifp->if_snd.ifq_maxlen == 0) {
                        if_printf(ifp, "XXX: driver didn't set ifq_maxlen\n");
-                       ifp->if_snd.ifq_maxlen = ifqmaxlen;
+                       ifq_set_maxlen(&ifp->if_snd, ifqmaxlen);
                }
        }
        crit_exit();
index fd49342..64c1022 100644 (file)
@@ -52,6 +52,7 @@
 
 #include <net/if.h>
 #include <net/if_types.h>
+#include <net/ifq_var.h>
 #include <net/route.h>
 #include <net/bpf.h>
 
@@ -136,7 +137,7 @@ pflog_clone_create(struct if_clone *ifc, int unit, caddr_t param __unused)
        ifp->if_output = pflogoutput;
        ifp->if_start = pflogstart;
        ifp->if_type = IFT_PFLOG;
-       ifp->if_snd.ifq_maxlen = ifqmaxlen;
+       ifq_set_maxlen(&ifp->if_snd, ifqmaxlen);
        ifp->if_hdrlen = PFLOG_HDRLEN;
        if_attach(ifp, NULL);
 
index bf73c4b..8781b60 100644 (file)
@@ -48,6 +48,7 @@
 
 #include <net/if.h>
 #include <net/if_types.h>
+#include <net/ifq_var.h>
 #include <net/route.h>
 #include <net/bpf.h>
 #include <netinet/in.h>
@@ -150,7 +151,7 @@ pfsync_clone_create(struct if_clone *ifc, int unit, caddr_t param __unused)
        ifp->if_output = pfsyncoutput;
        ifp->if_start = pfsyncstart;
        ifp->if_type = IFT_PFSYNC;
-       ifp->if_snd.ifq_maxlen = ifqmaxlen;
+       ifq_set_maxlen(&ifp->if_snd, ifqmaxlen);
        ifp->if_hdrlen = PFSYNC_HDRLEN;
        ifp->if_baudrate = IF_Mbps(100);
        ifp->if_softc = sc;
index 1b9bcd6..d8d847b 100644 (file)
@@ -1006,7 +1006,7 @@ sppp_attach(struct ifnet *ifp)
 #if 0
        sp->pp_flags = PP_KEEPALIVE;
 #endif
-       sp->pp_if.if_snd.ifq_maxlen = 32;
+       ifq_set_maxlen(&sp->pp_if.if_snd, 32);
        sp->pp_fastq.ifq_maxlen = 32;
        sp->pp_cpq.ifq_maxlen = 20;
        sp->pp_loopcnt = 0;
index b9316cc..7a8256f 100644 (file)
@@ -94,6 +94,7 @@
 #include <net/route.h>
 #include <net/netisr.h>
 #include <net/if_types.h>
+#include <net/ifq_var.h>
 #include "if_stf.h"
 
 #include <netinet/in.h>
@@ -194,7 +195,7 @@ stfmodevent(module_t mod, int type, void *data)
                /* turn off ingress filter */
                sc->sc_if.if_flags  |= IFF_LINK2;
 #endif
-               sc->sc_if.if_snd.ifq_maxlen = IFQ_MAXLEN;
+               ifq_set_maxlen(&sc->sc_if.if_snd, IFQ_MAXLEN);
                if_attach(&sc->sc_if, NULL);
                bpfattach(&sc->sc_if, DLT_NULL, sizeof(u_int));
                break;
index 8628d4a..a9dd4fb 100644 (file)
@@ -45,6 +45,7 @@
 
 #include <net/if.h>
 #include <net/if_types.h>
+#include <net/ifq_var.h>
 #include <net/netisr.h>
 
 
@@ -340,7 +341,7 @@ ng_eiface_constructor(node_p *nodep)
        ifp->if_start = ng_eiface_start;
        ifp->if_ioctl = ng_eiface_ioctl;
        ifp->if_watchdog = NULL;
-       ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
+       ifq_set_maxlen(&ifp->if_snd, IFQ_MAXLEN);
        ifp->if_flags = (IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST);
 
        /* Give this node name *
index 97ccd71..ea8e387 100644 (file)
@@ -1098,7 +1098,7 @@ ng_fec_constructor(node_p *nodep)
        ifp->if_ioctl = ng_fec_ioctl;
        ifp->if_init = ng_fec_init;
        ifp->if_watchdog = NULL;
-       ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
+       ifq_set_maxlen(ifp->if_snd, IFQ_MAXLEN);
        ifp->if_mtu = NG_FEC_MTU_DEFAULT;
        ifp->if_flags = (IFF_SIMPLEX|IFF_BROADCAST|IFF_MULTICAST);
        ifp->if_type = IFT_PROPVIRTUAL;         /* XXX */
index 61435d0..fb04bd3 100644 (file)
@@ -70,6 +70,7 @@
 
 #include <net/if.h>
 #include <net/if_types.h>
+#include <net/ifq_var.h>
 #include <net/netisr.h>
 #include <net/bpf.h>
 
@@ -587,7 +588,7 @@ ng_iface_constructor(node_p *nodep)
        ifp->if_start = ng_iface_start;
        ifp->if_ioctl = ng_iface_ioctl;
        ifp->if_watchdog = NULL;
-       ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
+       ifq_set_maxlen(&ifp->if_snd, IFQ_MAXLEN);
        ifp->if_mtu = NG_IFACE_MTU_DEFAULT;
        ifp->if_flags = (IFF_SIMPLEX|IFF_POINTOPOINT|IFF_NOARP|IFF_MULTICAST);
        ifp->if_type = IFT_PROPVIRTUAL;         /* XXX */
index 6cc5383..7c56ddb 100644 (file)
@@ -616,7 +616,6 @@ ng_iface_constructor(node_p node)
        ifp->if_hdrlen = 0;                     /* XXX */
        ifp->if_baudrate = 64000;               /* XXX */
        ifq_set_maxlen(&ifp->if_snd, IFQ_MAXLEN);
-       ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
        ifq_set_ready(&ifp->if_snd);
 
        /* Give this node the same name as the interface (if possible) */
index 6c9289d..1484e83 100644 (file)
@@ -366,7 +366,7 @@ ng_eiface_constructor(node_p node)
        ifp->if_start = ng_eiface_start;
        ifp->if_ioctl = ng_eiface_ioctl;
        ifp->if_watchdog = NULL;
-       ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
+       ifq_set_maxlen(&ifp->if_snd, IFQ_MAXLEN);
        ifp->if_flags = (IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST);
 
 #if 0
index e3acef3..108df0a 100644 (file)
@@ -1229,7 +1229,7 @@ ng_fec_constructor(node_p node)
        ifp->if_ioctl = ng_fec_ioctl;
        ifp->if_init = ng_fec_init;
        ifp->if_watchdog = NULL;
-       ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
+       ifq_set_maxlen(&ifp->if_snd, IFQ_MAXLEN);
        ifp->if_mtu = NG_FEC_MTU_DEFAULT;
        ifp->if_flags = (IFF_SIMPLEX|IFF_BROADCAST|IFF_MULTICAST);
        ifp->if_addrlen = 0;                    /* XXX */
index 4a32cb2..142f44d 100644 (file)
@@ -629,7 +629,7 @@ ng_source_store_output_ifp(sc_p sc, char *ifname)
        if (ifp->if_snd.ifq_maxlen < NG_SOURCE_DRIVER_IFQ_MAXLEN) {
                printf("ng_source: changing ifq_maxlen from %d to %d\n",
                    ifp->if_snd.ifq_maxlen, NG_SOURCE_DRIVER_IFQ_MAXLEN);
-               ifp->if_snd.ifq_maxlen = NG_SOURCE_DRIVER_IFQ_MAXLEN;
+               ifq_set_maxlen(&ifp->if_snd, NG_SOURCE_DRIVER_IFQ_MAXLEN);
        }
        splx(s);
 #endif
index 9a4f767..6804716 100644 (file)
@@ -479,7 +479,7 @@ atm_physif_ioctl(int code, caddr_t data, caddr_t arg)
                        ifp->if_flags = IFF_UP | IFF_BROADCAST | IFF_RUNNING;
                        ifp->if_output = atm_ifoutput;
                        ifp->if_ioctl = atm_if_ioctl;
-                       ifp->if_snd.ifq_maxlen = ifqmaxlen;
+                       ifq_set_maxlen(&ifp->if_snd, ifqmaxlen);
                        /*
                         * Set if_type and if_baudrate
                         */