Module Name: src
Committed By: thorpej
Date: Sat Sep 3 02:53:18 UTC 2022
Modified Files:
src/sys/net: if.c
src/sys/netinet: in_proto.c
src/sys/netinet6: in6_proto.c
src/sys/rump/net/lib/libsockin: sockin.c
src/sys/sys: domain.h
Log Message:
Garbage-collect everything related to struct domain::dom_ifqueues
(except dom_ifqueues itself, until the next kernel version bump).
It's no longer used now that nothing uses the legacy netisr mechanism.
To generate a diff of this commit:
cvs rdiff -u -r1.524 -r1.525 src/sys/net/if.c
cvs rdiff -u -r1.130 -r1.131 src/sys/netinet/in_proto.c
cvs rdiff -u -r1.128 -r1.129 src/sys/netinet6/in6_proto.c
cvs rdiff -u -r1.66 -r1.67 src/sys/rump/net/lib/libsockin/sockin.c
cvs rdiff -u -r1.34 -r1.35 src/sys/sys/domain.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/net/if.c
diff -u src/sys/net/if.c:1.524 src/sys/net/if.c:1.525
--- src/sys/net/if.c:1.524 Sat Sep 3 02:47:59 2022
+++ src/sys/net/if.c Sat Sep 3 02:53:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: if.c,v 1.524 2022/09/03 02:47:59 thorpej Exp $ */
+/* $NetBSD: if.c,v 1.525 2022/09/03 02:53:18 thorpej Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.524 2022/09/03 02:47:59 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.525 2022/09/03 02:53:18 thorpej Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@@ -219,7 +219,6 @@ pfil_head_t * if_pfil __read_mostly;
static kauth_listener_t if_listener;
static int doifioctl(struct socket *, u_long, void *, struct lwp *);
-static void if_detach_queues(struct ifnet *, struct ifqueue *);
static void sysctl_sndq_setup(struct sysctllog **, const char *,
struct ifaltq *);
static void if_slowtimo_intr(void *);
@@ -1398,19 +1397,6 @@ if_detach(struct ifnet *ifp)
#endif
/*
- * remove packets that came from ifp, from software interrupt queues.
- */
- DOMAIN_FOREACH(dp) {
- for (i = 0; i < __arraycount(dp->dom_ifqueues); i++) {
- struct ifqueue *iq = dp->dom_ifqueues[i];
- if (iq == NULL)
- break;
- dp->dom_ifqueues[i] = NULL;
- if_detach_queues(ifp, iq);
- }
- }
-
- /*
* Ensure that all packets on protocol input pktqueues have been
* processed, or, at least, removed from the queues.
*
@@ -1559,35 +1545,6 @@ restart:
#endif
}
-static void
-if_detach_queues(struct ifnet *ifp, struct ifqueue *q)
-{
- struct mbuf *m, *prev, *next;
-
- prev = NULL;
- for (m = q->ifq_head; m != NULL; m = next) {
- KASSERT((m->m_flags & M_PKTHDR) != 0);
-
- next = m->m_nextpkt;
- if (m->m_pkthdr.rcvif_index != ifp->if_index) {
- prev = m;
- continue;
- }
-
- if (prev != NULL)
- prev->m_nextpkt = m->m_nextpkt;
- else
- q->ifq_head = m->m_nextpkt;
- if (q->ifq_tail == m)
- q->ifq_tail = prev;
- q->ifq_len--;
-
- m->m_nextpkt = NULL;
- m_freem(m);
- IF_DROP(q);
- }
-}
-
/*
* Callback for a radix tree walk to delete all references to an
* ifnet.
Index: src/sys/netinet/in_proto.c
diff -u src/sys/netinet/in_proto.c:1.130 src/sys/netinet/in_proto.c:1.131
--- src/sys/netinet/in_proto.c:1.130 Fri Sep 14 05:09:51 2018
+++ src/sys/netinet/in_proto.c Sat Sep 3 02:53:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: in_proto.c,v 1.130 2018/09/14 05:09:51 maxv Exp $ */
+/* $NetBSD: in_proto.c,v 1.131 2022/09/03 02:53:18 thorpej Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in_proto.c,v 1.130 2018/09/14 05:09:51 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_proto.c,v 1.131 2022/09/03 02:53:18 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_mrouting.h"
@@ -486,7 +486,6 @@ struct domain inetdomain = {
.dom_ifattach = in_domifattach,
.dom_ifdetach = in_domifdetach,
.dom_if_link_state_change = in_if_link_state_change,
- .dom_ifqueues = { NULL, NULL },
.dom_link = { NULL },
.dom_mowner = MOWNER_INIT("",""),
.dom_sa_cmpofs = offsetof(struct sockaddr_in, sin_addr),
Index: src/sys/netinet6/in6_proto.c
diff -u src/sys/netinet6/in6_proto.c:1.128 src/sys/netinet6/in6_proto.c:1.129
--- src/sys/netinet6/in6_proto.c:1.128 Fri Jun 12 11:04:45 2020
+++ src/sys/netinet6/in6_proto.c Sat Sep 3 02:53:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: in6_proto.c,v 1.128 2020/06/12 11:04:45 roy Exp $ */
+/* $NetBSD: in6_proto.c,v 1.129 2022/09/03 02:53:18 thorpej Exp $ */
/* $KAME: in6_proto.c,v 1.66 2000/10/10 15:35:47 itojun Exp $ */
/*
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.128 2020/06/12 11:04:45 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.129 2022/09/03 02:53:18 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_gateway.h"
@@ -495,7 +495,6 @@ struct domain inet6domain = {
.dom_if_up = in6_if_up, .dom_if_down = in6_if_down,
.dom_ifattach = in6_domifattach, .dom_ifdetach = in6_domifdetach,
.dom_if_link_state_change = in6_if_link_state_change,
- .dom_ifqueues = { NULL, NULL },
.dom_link = { NULL },
.dom_mowner = MOWNER_INIT("",""),
.dom_sa_cmpofs = offsetof(struct sockaddr_in6, sin6_addr),
Index: src/sys/rump/net/lib/libsockin/sockin.c
diff -u src/sys/rump/net/lib/libsockin/sockin.c:1.66 src/sys/rump/net/lib/libsockin/sockin.c:1.67
--- src/sys/rump/net/lib/libsockin/sockin.c:1.66 Tue Jun 26 06:48:03 2018
+++ src/sys/rump/net/lib/libsockin/sockin.c Sat Sep 3 02:53:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: sockin.c,v 1.66 2018/06/26 06:48:03 msaitoh Exp $ */
+/* $NetBSD: sockin.c,v 1.67 2022/09/03 02:53:18 thorpej Exp $ */
/*
* Copyright (c) 2008, 2009 Antti Kantee. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.66 2018/06/26 06:48:03 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.67 2022/09/03 02:53:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/condvar.h>
@@ -159,7 +159,6 @@ struct domain sockindomain = {
.dom_maxrtkey = sizeof(struct sockaddr_in),
.dom_ifattach = NULL,
.dom_ifdetach = NULL,
- .dom_ifqueues = { NULL },
.dom_link = { NULL },
.dom_mowner = MOWNER_INIT("",""),
.dom_sockaddr_cmp = NULL
@@ -177,7 +176,6 @@ struct domain sockin6domain = {
.dom_maxrtkey = sizeof(struct sockaddr_in6),
.dom_ifattach = NULL,
.dom_ifdetach = NULL,
- .dom_ifqueues = { NULL },
.dom_link = { NULL },
.dom_mowner = MOWNER_INIT("",""),
.dom_sockaddr_cmp = NULL
Index: src/sys/sys/domain.h
diff -u src/sys/sys/domain.h:1.34 src/sys/sys/domain.h:1.35
--- src/sys/sys/domain.h:1.34 Wed Jan 10 02:50:26 2018
+++ src/sys/sys/domain.h Sat Sep 3 02:53:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: domain.h,v 1.34 2018/01/10 02:50:26 ozaki-r Exp $ */
+/* $NetBSD: domain.h,v 1.35 2022/09/03 02:53:18 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
@@ -85,7 +85,7 @@ struct domain {
socklen_t,
const struct sockaddr *);
const struct sockaddr *dom_sa_any;
- struct ifqueue *dom_ifqueues[2]; /* ifqueue for domain */
+ struct ifqueue *dom_ifqueues[2]; /* XXX G/C ifqueue for domain */
STAILQ_ENTRY(domain) dom_link;
struct mowner dom_mowner;
uint_fast8_t dom_sa_cmpofs;