Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Garbage-collect everything related to struct domain::dom...



details:   https://anonhg.NetBSD.org/src/rev/cf6b9f99fbd9
branches:  trunk
changeset: 369835:cf6b9f99fbd9
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Sep 03 02:53:18 2022 +0000

description:
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.

diffstat:

 sys/net/if.c                        |  47 +-----------------------------------
 sys/netinet/in_proto.c              |   5 +--
 sys/netinet6/in6_proto.c            |   5 +--
 sys/rump/net/lib/libsockin/sockin.c |   6 +---
 sys/sys/domain.h                    |   4 +-
 5 files changed, 10 insertions(+), 57 deletions(-)

diffs (186 lines):

diff -r ee9d5ad78423 -r cf6b9f99fbd9 sys/net/if.c
--- a/sys/net/if.c      Sat Sep 03 02:47:59 2022 +0000
+++ b/sys/net/if.c      Sat Sep 03 02:53:18 2022 +0000
@@ -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 @@
 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 @@
 #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 @@
 #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.
diff -r ee9d5ad78423 -r cf6b9f99fbd9 sys/netinet/in_proto.c
--- a/sys/netinet/in_proto.c    Sat Sep 03 02:47:59 2022 +0000
+++ b/sys/netinet/in_proto.c    Sat Sep 03 02:53:18 2022 +0000
@@ -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 @@
        .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),
diff -r ee9d5ad78423 -r cf6b9f99fbd9 sys/netinet6/in6_proto.c
--- a/sys/netinet6/in6_proto.c  Sat Sep 03 02:47:59 2022 +0000
+++ b/sys/netinet6/in6_proto.c  Sat Sep 03 02:53:18 2022 +0000
@@ -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 @@
        .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),
diff -r ee9d5ad78423 -r cf6b9f99fbd9 sys/rump/net/lib/libsockin/sockin.c
--- a/sys/rump/net/lib/libsockin/sockin.c       Sat Sep 03 02:47:59 2022 +0000
+++ b/sys/rump/net/lib/libsockin/sockin.c       Sat Sep 03 02:53:18 2022 +0000
@@ -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 @@
        .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 @@
        .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
diff -r ee9d5ad78423 -r cf6b9f99fbd9 sys/sys/domain.h
--- a/sys/sys/domain.h  Sat Sep 03 02:47:59 2022 +0000
+++ b/sys/sys/domain.h  Sat Sep 03 02:53:18 2022 +0000
@@ -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 @@
                                                     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;



Home | Main Index | Thread Index | Old Index