aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorJonathan Lemon <jlemon@FreeBSD.org>2000-11-25 07:35:38 +0000
committerJonathan Lemon <jlemon@FreeBSD.org>2000-11-25 07:35:38 +0000
commitdf5e1987230850fe5983a4479523708640160215 (patch)
tree05531b0125a3669b45ffc6aa7dc93115e4123969 /sys/netinet
parentf4e13f88b630686808a03dc19e3243ca37fa5645 (diff)
Notes
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/if_ether.c13
-rw-r--r--sys/netinet/ip_auth.c12
-rw-r--r--sys/netinet/ip_input.c6
-rw-r--r--sys/netinet/ip_mroute.c12
4 files changed, 17 insertions, 26 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index 97dc239fee09..1bbe164a01da 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -96,7 +96,7 @@ struct llinfo_arp {
static LIST_HEAD(, llinfo_arp) llinfo_arp;
-struct ifqueue arpintrq = {0, 0, 0, 50};
+struct ifqueue arpintrq;
static int arp_inuse, arp_allocated;
static int arp_maxtries = 5;
@@ -110,6 +110,7 @@ SYSCTL_INT(_net_link_ether_inet, OID_AUTO, useloopback, CTLFLAG_RW,
SYSCTL_INT(_net_link_ether_inet, OID_AUTO, proxyall, CTLFLAG_RW,
&arp_proxyall, 0, "");
+static void arp_init __P((void));
static void arp_rtrequest __P((int, struct rtentry *, struct sockaddr *));
static void arprequest __P((struct arpcom *,
struct in_addr *, struct in_addr *, u_char *));
@@ -815,3 +816,13 @@ arp_ifinit(ac, ifa)
ifa->ifa_rtrequest = arp_rtrequest;
ifa->ifa_flags |= RTF_CLONING;
}
+
+static void
+arp_init(void)
+{
+
+ arpintrq.ifq_maxlen = 50;
+ mtx_init(&arpintrq.ifq_mtx, "arp_inq", MTX_DEF);
+}
+
+SYSINIT(arp, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, arp_init, 0);
diff --git a/sys/netinet/ip_auth.c b/sys/netinet/ip_auth.c
index 4ce6a69d5d77..7fb9d214f523 100644
--- a/sys/netinet/ip_auth.c
+++ b/sys/netinet/ip_auth.c
@@ -286,9 +286,6 @@ int cmd;
frentry_t *fr, **frptr;
{
mb_t *m;
-#if defined(_KERNEL) && !SOLARIS
- struct ifqueue *ifq;
-#endif
frauth_t auth, *au = &auth;
frauthent_t *fae, **faep;
int i, error = 0;
@@ -423,15 +420,10 @@ fr_authioctlloop:
# if SOLARIS
error = fr_qin(fr_auth[i].fra_q, m);
# else /* SOLARIS */
- ifq = &ipintrq;
- if (IF_QFULL(ifq)) {
- IF_DROP(ifq);
- m_freem(m);
+ if (! IF_HANDOFF(&ipintrq, m, NULL))
error = ENOBUFS;
- } else {
- IF_ENQUEUE(ifq, m);
+ else
schednetisr(NETISR_IP);
- }
# endif /* SOLARIS */
if (error)
fr_authstats.fas_quefail++;
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index beb620ba7822..63e10c8b4df9 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -235,6 +235,7 @@ ip_init()
ip_id = time_second & 0xffff;
ipintrq.ifq_maxlen = ipqmaxlen;
+ mtx_init(&ipintrq.ifq_mtx, "ip_inq", MTX_DEF);
register_netisr(NETISR_IP, ipintr);
}
@@ -745,13 +746,10 @@ bad:
static void
ipintr(void)
{
- int s;
struct mbuf *m;
- while(1) {
- s = splimp();
+ while (1) {
IF_DEQUEUE(&ipintrq, m);
- splx(s);
if (m == 0)
return;
ip_input(m);
diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c
index d1122b1327a1..fb7a2b87c60c 100644
--- a/sys/netinet/ip_mroute.c
+++ b/sys/netinet/ip_mroute.c
@@ -1622,8 +1622,6 @@ ipip_input(m, off, proto)
struct ifnet *ifp = m->m_pkthdr.rcvif;
register struct ip *ip = mtod(m, struct ip *);
register int hlen = ip->ip_hl << 2;
- register int s;
- register struct ifqueue *ifq;
register struct vif *vifp;
if (!have_encap_tunnel) {
@@ -1675,13 +1673,7 @@ ipip_input(m, off, proto)
m->m_pkthdr.len -= IP_HDR_LEN;
m->m_pkthdr.rcvif = ifp;
- ifq = &ipintrq;
- s = splimp();
- if (IF_QFULL(ifq)) {
- IF_DROP(ifq);
- m_freem(m);
- } else {
- IF_ENQUEUE(ifq, m);
+ (void) IF_HANDOFF(&ipintrq, m, NULL);
/*
* normally we would need a "schednetisr(NETISR_IP)"
* here but we were called by ip_input and it is going
@@ -1689,8 +1681,6 @@ ipip_input(m, off, proto)
* queued as soon as we return so we avoid the
* unnecessary software interrrupt.
*/
- }
- splx(s);
}
/*