Diff below removes 4 global read-only variables "ifqmaxlen", "ipqmaxlen",
"ip6qmaxlen" and "mplsqmaxlen" that are all set to IFQ_MAXLEN and never
modified afterward.
ok?
Index: net/if.c
===================================================================
RCS file: /home/ncvs/src/sys/net/if.c,v
retrieving revision 1.251
diff -u -p -r1.251 if.c
--- net/if.c 15 Mar 2013 20:45:34 -0000 1.251
+++ net/if.c 18 Mar 2013 16:09:40 -0000
@@ -137,8 +137,6 @@ void if_attachsetup(struct ifnet *);
void if_attachdomain1(struct ifnet *);
void if_attach_common(struct ifnet *);
-int ifqmaxlen = IFQ_MAXLEN;
-
void if_detach_queues(struct ifnet *, struct ifqueue *);
void if_detached_start(struct ifnet *);
int if_detached_ioctl(struct ifnet *, u_long, caddr_t);
@@ -280,7 +278,7 @@ if_attachsetup(struct ifnet *ifp)
ifindex2ifnet[if_index] = ifp;
if (ifp->if_snd.ifq_maxlen == 0)
- IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen);
+ IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN);
#ifdef ALTQ
ifp->if_snd.altq_type = 0;
ifp->if_snd.altq_disc = NULL;
Index: net/if.h
===================================================================
RCS file: /home/ncvs/src/sys/net/if.h,v
retrieving revision 1.139
diff -u -p -r1.139 if.h
--- net/if.h 7 Mar 2013 09:40:19 -0000 1.139
+++ net/if.h 18 Mar 2013 16:09:40 -0000
@@ -796,7 +796,6 @@ do {
\
#define IF_WIRED_DEFAULT_PRIORITY 0
#define IF_WIRELESS_DEFAULT_PRIORITY 4
-extern int ifqmaxlen;
extern struct ifnet_head ifnet;
extern struct ifnet **ifindex2ifnet;
extern struct ifnet *lo0ifp;
Index: net/if_bridge.c
===================================================================
RCS file: /home/ncvs/src/sys/net/if_bridge.c,v
retrieving revision 1.206
diff -u -p -r1.206 if_bridge.c
--- net/if_bridge.c 15 Mar 2013 20:45:34 -0000 1.206
+++ net/if_bridge.c 18 Mar 2013 16:09:40 -0000
@@ -219,7 +219,7 @@ bridge_clone_create(struct if_clone *ifc
ifp->if_start = bridge_start;
ifp->if_type = IFT_BRIDGE;
ifp->if_hdrlen = ETHER_HDR_LEN;
- IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen);
+ IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN);
IFQ_SET_READY(&ifp->if_snd);
if_attach(ifp);
Index: net/if_gif.c
===================================================================
RCS file: /home/ncvs/src/sys/net/if_gif.c,v
retrieving revision 1.59
diff -u -p -r1.59 if_gif.c
--- net/if_gif.c 17 Jan 2013 00:48:04 -0000 1.59
+++ net/if_gif.c 18 Mar 2013 16:09:40 -0000
@@ -105,7 +105,7 @@ gif_clone_create(struct if_clone *ifc, i
sc->gif_if.if_start = gif_start;
sc->gif_if.if_output = gif_output;
sc->gif_if.if_type = IFT_GIF;
- IFQ_SET_MAXLEN(&sc->gif_if.if_snd, ifqmaxlen);
+ IFQ_SET_MAXLEN(&sc->gif_if.if_snd, IFQ_MAXLEN);
IFQ_SET_READY(&sc->gif_if.if_snd);
sc->gif_if.if_softc = sc;
if_attach(&sc->gif_if);
Index: net/if_mpe.c
===================================================================
RCS file: /home/ncvs/src/sys/net/if_mpe.c,v
retrieving revision 1.27
diff -u -p -r1.27 if_mpe.c
--- net/if_mpe.c 14 Apr 2012 09:39:47 -0000 1.27
+++ net/if_mpe.c 18 Mar 2013 16:09:40 -0000
@@ -105,7 +105,7 @@ mpe_clone_create(struct if_clone *ifc, i
ifp->if_start = mpestart;
ifp->if_type = IFT_MPLS;
ifp->if_hdrlen = MPE_HDRLEN;
- IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen);
+ IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN);
IFQ_SET_READY(&ifp->if_snd);
if_attach(ifp);
if_alloc_sadl(ifp);
Index: net/if_pflog.c
===================================================================
RCS file: /home/ncvs/src/sys/net/if_pflog.c,v
retrieving revision 1.52
diff -u -p -r1.52 if_pflog.c
--- net/if_pflog.c 6 Nov 2012 12:32:41 -0000 1.52
+++ net/if_pflog.c 18 Mar 2013 16:09:40 -0000
@@ -156,7 +156,7 @@ pflog_clone_create(struct if_clone *ifc,
ifp->if_output = pflogoutput;
ifp->if_start = pflogstart;
ifp->if_type = IFT_PFLOG;
- IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen);
+ IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN);
ifp->if_hdrlen = PFLOG_HDRLEN;
if_attach(ifp);
if_alloc_sadl(ifp);
Index: net/if_pflow.c
===================================================================
RCS file: /home/ncvs/src/sys/net/if_pflow.c,v
retrieving revision 1.24
diff -u -p -r1.24 if_pflow.c
--- net/if_pflow.c 5 Feb 2013 11:58:39 -0000 1.24
+++ net/if_pflow.c 18 Mar 2013 16:09:40 -0000
@@ -231,7 +231,7 @@ pflow_clone_create(struct if_clone *ifc,
ifp->if_output = pflowoutput;
ifp->if_start = pflowstart;
ifp->if_type = IFT_PFLOW;
- IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen);
+ IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN);
ifp->if_hdrlen = PFLOW_HDRLEN;
ifp->if_flags = IFF_UP;
ifp->if_flags &= ~IFF_RUNNING; /* not running, need receiver */
Index: net/if_pfsync.c
===================================================================
RCS file: /home/ncvs/src/sys/net/if_pfsync.c,v
retrieving revision 1.195
diff -u -p -r1.195 if_pfsync.c
--- net/if_pfsync.c 30 Oct 2012 12:09:05 -0000 1.195
+++ net/if_pfsync.c 18 Mar 2013 16:09:40 -0000
@@ -326,7 +326,7 @@ pfsync_clone_create(struct if_clone *ifc
ifp->if_output = pfsyncoutput;
ifp->if_start = pfsyncstart;
ifp->if_type = IFT_PFSYNC;
- IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen);
+ IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN);
ifp->if_hdrlen = sizeof(struct pfsync_header);
ifp->if_mtu = ETHERMTU;
timeout_set(&sc->sc_tmo, pfsync_timeout, sc);
Index: net/if_ppp.c
===================================================================
RCS file: /home/ncvs/src/sys/net/if_ppp.c,v
retrieving revision 1.67
diff -u -p -r1.67 if_ppp.c
--- net/if_ppp.c 29 Nov 2012 22:56:08 -0000 1.67
+++ net/if_ppp.c 18 Mar 2013 16:09:40 -0000
@@ -244,10 +244,10 @@ ppp_clone_create(struct if_clone *ifc, i
sc->sc_if.if_ioctl = pppsioctl;
sc->sc_if.if_output = pppoutput;
sc->sc_if.if_start = ppp_ifstart;
- IFQ_SET_MAXLEN(&sc->sc_if.if_snd, ifqmaxlen);
- IFQ_SET_MAXLEN(&sc->sc_inq, ifqmaxlen);
- IFQ_SET_MAXLEN(&sc->sc_fastq, ifqmaxlen);
- IFQ_SET_MAXLEN(&sc->sc_rawq, ifqmaxlen);
+ IFQ_SET_MAXLEN(&sc->sc_if.if_snd, IFQ_MAXLEN);
+ IFQ_SET_MAXLEN(&sc->sc_inq, IFQ_MAXLEN);
+ IFQ_SET_MAXLEN(&sc->sc_fastq, IFQ_MAXLEN);
+ IFQ_SET_MAXLEN(&sc->sc_rawq, IFQ_MAXLEN);
IFQ_SET_READY(&sc->sc_if.if_snd);
if_attach(&sc->sc_if);
if_alloc_sadl(&sc->sc_if);
Index: net/if_tun.c
===================================================================
RCS file: /home/ncvs/src/sys/net/if_tun.c,v
retrieving revision 1.112
diff -u -p -r1.112 if_tun.c
--- net/if_tun.c 9 Jul 2011 00:47:18 -0000 1.112
+++ net/if_tun.c 18 Mar 2013 16:09:40 -0000
@@ -186,7 +186,7 @@ tun_create(struct if_clone *ifc, int uni
ifp->if_start = tunstart;
ifp->if_hardmtu = TUNMRU;
ifp->if_link_state = LINK_STATE_DOWN;
- IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen);
+ IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN);
IFQ_SET_READY(&ifp->if_snd);
if ((flags & TUN_LAYER2) == 0) {
Index: net/if_vether.c
===================================================================
RCS file: /home/ncvs/src/sys/net/if_vether.c,v
retrieving revision 1.16
diff -u -p -r1.16 if_vether.c
--- net/if_vether.c 22 Jul 2011 15:59:40 -0000 1.16
+++ net/if_vether.c 18 Mar 2013 16:09:40 -0000
@@ -86,7 +86,7 @@ vether_clone_create(struct if_clone *ifc
ifp->if_softc = sc;
ifp->if_ioctl = vetherioctl;
ifp->if_start = vetherstart;
- IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen);
+ IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN);
IFQ_SET_READY(&ifp->if_snd);
ifp->if_capabilities = IFCAP_VLAN_MTU;
Index: netinet/ip_carp.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet/ip_carp.c,v
retrieving revision 1.198
diff -u -p -r1.198 ip_carp.c
--- netinet/ip_carp.c 8 Oct 2012 18:48:25 -0000 1.198
+++ netinet/ip_carp.c 18 Mar 2013 16:09:40 -0000
@@ -894,7 +894,7 @@ carp_clone_create(ifc, unit)
ifp->if_addrlen = ETHER_ADDR_LEN;
ifp->if_hdrlen = ETHER_HDR_LEN;
ifp->if_mtu = ETHERMTU;
- IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen);
+ IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN);
IFQ_SET_READY(&ifp->if_snd);
if_attach(ifp);
Index: netinet/ip_input.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet/ip_input.c,v
retrieving revision 1.200
diff -u -p -r1.200 ip_input.c
--- netinet/ip_input.c 6 Nov 2012 12:32:42 -0000 1.200
+++ netinet/ip_input.c 18 Mar 2013 16:09:40 -0000
@@ -135,7 +135,6 @@ int *ipctl_vars[IPCTL_MAXID] = IPCTL_VAR
extern struct domain inetdomain;
extern struct protosw inetsw[];
u_char ip_protox[IPPROTO_MAX];
-int ipqmaxlen = IFQ_MAXLEN;
struct in_ifaddrhead in_ifaddr;
struct ifqueue ipintrq;
@@ -206,7 +205,7 @@ ip_init(void)
pr->pr_protocol < IPPROTO_MAX)
ip_protox[pr->pr_protocol] = pr - inetsw;
LIST_INIT(&ipq);
- IFQ_SET_MAXLEN(&ipintrq, ipqmaxlen);
+ IFQ_SET_MAXLEN(&ipintrq, IFQ_MAXLEN);
TAILQ_INIT(&in_ifaddr);
if (ip_mtudisc != 0)
ip_mtudisc_timeout_q =
Index: netinet6/ip6_input.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet6/ip6_input.c,v
retrieving revision 1.107
diff -u -p -r1.107 ip6_input.c
--- netinet6/ip6_input.c 14 Mar 2013 11:18:37 -0000 1.107
+++ netinet6/ip6_input.c 18 Mar 2013 16:09:40 -0000
@@ -121,7 +121,6 @@ extern struct domain inet6domain;
extern struct ip6protosw inet6sw[];
u_char ip6_protox[IPPROTO_MAX];
-static int ip6qmaxlen = IFQ_MAXLEN;
struct in6_ifaddr *in6_ifaddr;
struct ifqueue ip6intrq;
@@ -154,7 +153,7 @@ ip6_init(void)
pr->pr_protocol && pr->pr_protocol != IPPROTO_RAW &&
pr->pr_protocol < IPPROTO_MAX)
ip6_protox[pr->pr_protocol] = pr - inet6sw;
- IFQ_SET_MAXLEN(&ip6intrq, ip6qmaxlen);
+ IFQ_SET_MAXLEN(&ip6intrq, IFQ_MAXLEN);
ip6_randomid_init();
nd6_init();
frag6_init();
Index: netmpls/mpls.h
===================================================================
RCS file: /home/ncvs/src/sys/netmpls/mpls.h,v
retrieving revision 1.25
diff -u -p -r1.25 mpls.h
--- netmpls/mpls.h 8 Sep 2010 08:00:56 -0000 1.25
+++ netmpls/mpls.h 18 Mar 2013 16:09:40 -0000
@@ -166,7 +166,6 @@ extern int mpls_raw_usrreq(struct socket
struct mbuf *, struct mbuf *, struct proc *);
extern struct ifqueue mplsintrq; /* MPLS input queue */
-extern int mplsqmaxlen; /* MPLS input queue length */
extern int mpls_defttl;
extern int mpls_mapttl_ip;
extern int mpls_mapttl_ip6;
Index: netmpls/mpls_input.c
===================================================================
RCS file: /home/ncvs/src/sys/netmpls/mpls_input.c,v
retrieving revision 1.32
diff -u -p -r1.32 mpls_input.c
--- netmpls/mpls_input.c 6 Jul 2011 02:42:28 -0000 1.32
+++ netmpls/mpls_input.c 18 Mar 2013 16:09:40 -0000
@@ -47,7 +47,6 @@
#include <netmpls/mpls.h>
struct ifqueue mplsintrq;
-int mplsqmaxlen = IFQ_MAXLEN;
extern int mpls_inkloop;
#ifdef MPLS_DEBUG
@@ -65,7 +64,7 @@ struct mbuf *mpls_do_error(struct mbuf *
void
mpls_init(void)
{
- IFQ_SET_MAXLEN(&mplsintrq, mplsqmaxlen);
+ IFQ_SET_MAXLEN(&mplsintrq, IFQ_MAXLEN);
}
void