Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Eliminate use of IFF_OACTIVE.



details:   https://anonhg.NetBSD.org/src/rev/98c2c82e598e
branches:  trunk
changeset: 370133:98c2c82e598e
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Sep 18 13:31:08 2022 +0000

description:
Eliminate use of IFF_OACTIVE.

diffstat:

 sys/arch/sparc64/dev/vnet.c     |  16 +---------------
 sys/arch/usermode/dev/if_veth.c |  15 ++++-----------
 2 files changed, 5 insertions(+), 26 deletions(-)

diffs (147 lines):

diff -r 6099c6a6d4c1 -r 98c2c82e598e sys/arch/sparc64/dev/vnet.c
--- a/sys/arch/sparc64/dev/vnet.c       Sun Sep 18 13:19:40 2022 +0000
+++ b/sys/arch/sparc64/dev/vnet.c       Sun Sep 18 13:31:08 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vnet.c,v 1.6 2022/02/11 23:49:28 riastradh Exp $       */
+/*     $NetBSD: vnet.c,v 1.7 2022/09/18 13:31:08 thorpej Exp $ */
 /*     $OpenBSD: vnet.c,v 1.62 2020/07/10 13:26:36 patrick Exp $       */
 /*
  * Copyright (c) 2009, 2015 Mark Kettenis
@@ -695,7 +695,6 @@
                vnet_setmulti(sc, 1);
 
                KERNEL_LOCK(1, curlwp);
-               ifp->if_flags &= ~IFF_OACTIVE;
                vnet_start(ifp);
                KERNEL_UNLOCK_ONE(curlwp);
        }
@@ -951,8 +950,6 @@
                        vnet_send_dring_data(sc, cons);
 
                KERNEL_LOCK(1, curlwp);
-               if (count < (sc->sc_vd->vd_nentries - 1))
-                       ifp->if_flags &= ~IFF_OACTIVE;
                if (count == 0)
                        ifp->if_timer = 0;
 
@@ -1138,11 +1135,6 @@
                DPRINTF(("%s: not in RUNNING state\n", __func__));
                return;
        }
-       if (ifp->if_flags & IFF_OACTIVE)
-       {
-               DPRINTF(("%s: already active\n", __func__));
-               return;
-       }
 
        if (IFQ_IS_EMPTY(&ifp->if_snd))
        {
@@ -1175,7 +1167,6 @@
        tx_tail += sizeof(struct ldc_pkt);
        tx_tail &= ((lc->lc_txq->lq_nentries * sizeof(struct ldc_pkt)) - 1);
        if (tx_tail == tx_head) {
-               ifp->if_flags |= IFF_OACTIVE;
                {
                        DPRINTF(("%s: tail equals head\n", __func__));
                        return;
@@ -1194,14 +1185,12 @@
                if (count >= (sc->sc_vd->vd_nentries - 1) ||
                    map->lm_count >= map->lm_nentries) {
                        DPRINTF(("%s: count issue\n", __func__));
-                       ifp->if_flags |= IFF_OACTIVE;
                        break;
                }
 
                buf = pool_get(&sc->sc_pool, PR_NOWAIT|PR_ZERO);
                if (buf == NULL) {
                        DPRINTF(("%s: buff is NULL\n", __func__));
-                       ifp->if_flags |= IFF_OACTIVE;
                        break;
                }
                IFQ_DEQUEUE(&ifp->if_snd, m);
@@ -1275,13 +1264,11 @@
                count = sc->sc_tx_prod - sc->sc_tx_cons;
                if (count >= (sc->sc_vd->vd_nentries - 1) ||
                    map->lm_count >= map->lm_nentries) {
-                       ifp->if_flags |= IFF_OACTIVE;
                        return;
                }
 
                buf = pool_get(&sc->sc_pool, PR_NOWAIT|PR_ZERO);
                if (buf == NULL) {
-                       ifp->if_flags |= IFF_OACTIVE;
                        return;
                }
 
@@ -1548,7 +1535,6 @@
        struct ldc_conn *lc = &sc->sc_lc;
 
        ifp->if_flags &= ~IFF_RUNNING;
-       ifp->if_flags &= ~IFF_OACTIVE;
        ifp->if_timer = 0;
 
        cbus_intr_setenabled(sc->sc_bustag, sc->sc_tx_ino, INTR_DISABLED);
diff -r 6099c6a6d4c1 -r 98c2c82e598e sys/arch/usermode/dev/if_veth.c
--- a/sys/arch/usermode/dev/if_veth.c   Sun Sep 18 13:19:40 2022 +0000
+++ b/sys/arch/usermode/dev/if_veth.c   Sun Sep 18 13:31:08 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_veth.c,v 1.15 2021/06/16 00:21:18 riastradh Exp $ */
+/* $NetBSD: if_veth.c,v 1.16 2022/09/18 13:36:53 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_veth.c,v 1.15 2021/06/16 00:21:18 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_veth.c,v 1.16 2022/09/18 13:36:53 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -181,7 +181,6 @@
        veth_stop(ifp, 0);
 
        ifp->if_flags |= IFF_RUNNING;
-       ifp->if_flags &= ~IFF_OACTIVE;
 
        return 0;
 }
@@ -247,11 +246,6 @@
        struct ifnet *ifp = &sc->sc_ec.ec_if;
        int s;
 
-       if (ifp->if_flags & IFF_OACTIVE) {
-               if (thunk_pollout_tap(sc->sc_tapfd, 0) == 1)
-                       ifp->if_flags &= ~IFF_OACTIVE;
-       }
-
        s = splnet();
        veth_start(ifp);
        splx(s);
@@ -266,7 +260,7 @@
 
        vethprintf("%s: %s flags=%x\n", __func__, ifp->if_xname, ifp->if_flags);
 
-       if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
+       if ((ifp->if_flags & IFF_RUNNING) == 0)
                return;
 
        for (;;) {
@@ -276,7 +270,6 @@
 
                if (thunk_pollout_tap(sc->sc_tapfd, 0) != 1) {
                        printf("queue full\n");
-                       ifp->if_flags |= IFF_OACTIVE;
                        break;
                }
 
@@ -302,7 +295,7 @@
 {
        vethprintf("%s: %s flags=%x\n", __func__, ifp->if_xname, ifp->if_flags);
        ifp->if_timer = 0;
-       ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+       ifp->if_flags &= ~IFF_RUNNING;
 }
 
 static void



Home | Main Index | Thread Index | Old Index