CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 03:02:17 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): divide IFF_OACTIVE into per-queue To generate a diff of this commit: cvs rdiff -u -r1.101 -r1.102 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 03:02:17 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): divide IFF_OACTIVE into per-queue To generate a diff of this commit: cvs rdiff -u -r1.101 -r1.102 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_vioif.c diff -u src/sys/dev/pci/if_vioif.c:1.101 src/sys/dev/pci/if_vioif.c:1.102 --- src/sys/dev/pci/if_vioif.c:1.101 Thu Mar 23 02:57:54 2023 +++ src/sys/dev/pci/if_vioif.c Thu Mar 23 03:02:17 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: if_vioif.c,v 1.101 2023/03/23 02:57:54 yamaguchi Exp $ */ +/* $NetBSD: if_vioif.c,v 1.102 2023/03/23 03:02:17 yamaguchi Exp $ */ /* * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.101 2023/03/23 02:57:54 yamaguchi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.102 2023/03/23 03:02:17 yamaguchi Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -266,6 +266,7 @@ struct vioif_netqueue { struct vioif_tx_context { bool txc_link_active; + bool txc_no_free_slots; pcq_t *txc_intrq; void *txc_deferred_transmit; @@ -730,7 +731,6 @@ vioif_init(struct ifnet *ifp) sc->sc_act_nvq_pairs = 1; SET(ifp->if_flags, IFF_RUNNING); - CLR(ifp->if_flags, IFF_OACTIVE); vioif_net_intr_enable(sc, vsc); @@ -860,7 +860,12 @@ vioif_watchdog(struct ifnet *ifp) struct vioif_netqueue *netq; int i; - if (ifp->if_flags & IFF_RUNNING) { + if (ISSET(ifp->if_flags, IFF_RUNNING)) { + if (ISSET(ifp->if_flags, IFF_DEBUG)) { + log(LOG_DEBUG, "%s: watchdog timed out\n", + ifp->if_xname); + } + for (i = 0; i < sc->sc_act_nvq_pairs; i++) { netq = &sc->sc_netqs[VIOIF_NETQ_TXQID(i)]; @@ -1496,6 +1501,7 @@ vioif_netqueue_init(struct vioif_softc * goto err; } txc->txc_link_active = VIOIF_IS_LINK_ACTIVE(sc); + txc->txc_no_free_slots = false; txc->txc_intrq = pcq_create(vq->vq_num, KM_SLEEP); break; } @@ -1971,18 +1977,17 @@ vioif_send_common_locked(struct ifnet *i txc = netq->netq_ctx; - if (!txc->txc_link_active) - return; - - if (!is_transmit && - ISSET(ifp->if_flags, IFF_OACTIVE)) + if (!txc->txc_link_active || + txc->txc_no_free_slots) return; for (;;) { int slot, r; r = virtio_enqueue_prep(vsc, vq, &slot); - if (r == EAGAIN) + if (r == EAGAIN) { + txc->txc_no_free_slots = true; break; + } if (__predict_false(r != 0)) panic("enqueue_prep for tx buffers"); @@ -2049,21 +2054,25 @@ vioif_send_common_locked(struct ifnet *i /* dequeue sent mbufs */ static bool vioif_tx_deq_locked(struct vioif_softc *sc, struct virtio_softc *vsc, -struct vioif_netqueue *netq, u_int limit) +struct vioif_netqueue *netq, u_int limit, size_t *ndeqp) { struct virtqueue *vq = netq->netq_vq; struct ifnet *ifp = &sc->sc_ethercom.ec_if; struct vioif_net_map *map; struct mbuf *m; int slot, len; - bool more = false; + bool more; + size_t ndeq; KASSERT(mutex_owned(&netq->netq_lock)); + more = false; + ndeq = 0; + if (virtio_vq_is_enqueued(vsc, vq) == false) - return false; + goto done; - for (;;) { + for (;;ndeq++) { if (limit-- == 0) { more = true; break; @@ -2082,6 +2091,9 @@ vioif_tx_deq_locked(struct vioif_softc * m_freem(m); } +done: + if (ndeqp != NULL) + *ndeqp = ndeq; return more; } @@ -2089,6 +2101,7 @@ static void vioif_tx_queue_clear(struct vioif_softc *sc, struct virtio_softc *vsc, struct vioif_netqueue *netq) { + struct vioif_tx_context *txc; struct vioif_net_map *map; struct mbuf *m; unsigned int i, vq_num; @@ -2096,9 +2109,11 @@ vioif_tx_queue_clear(struct vioif_softc mutex_enter(&netq->netq_lock); + txc = netq->netq_ctx; vq_num = netq->netq_vq->vq_num; + for (;;) { - more = vioif_tx_deq_locked(sc, vsc, netq, vq_num); + more = vioif_tx_deq_locked(sc, vsc, netq, vq_num, NULL); if (more == false) break; } @@ -2113,6 +2128,9 @@ vioif_tx_queue_clear(struct vioif_softc vioif_net_unload_mbuf(vsc, map); m_freem(m); } + + txc->txc_no_free_slots = false; + mutex_exit(&netq->netq_lock); } @@ -2157,11 +2175,17 @@ vioif_tx_handle_locked(struct vioif_netq struct ifnet *ifp = &sc->sc_ethercom.ec_if; bool more; int enqueued; + size_t ndeq; KASSERT(mutex_owned(&netq->netq_lock)); KASSERT(!netq->netq_stopping); - more = vioif_tx_deq_locked(sc, vsc, netq, limit); + more = vioif_tx_deq_locked(sc, vsc, netq, limit, &ndeq); + if (txc->txc_no_free_slots && ndeq > 0) { + txc->txc_no_free_slots = false; + softint_schedule(txc->txc_deferred_transmit); + } + if (more) { vioif_net_sched_handle(sc, netq); return; @@ -2179,10 +2203,9 @@ vioif_tx_handle_locked(struct vioif_netq netq->netq_running_handle = false; /* for ALTQ */ - if (netq == &sc->sc_netqs[VIOIF_NETQ_TXQID(0)])
CVS commit: src/sys/dev
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 03:27:48 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c ld_virtio.c vio9p.c viomb.c viornd.c vioscsi.c virtio.c virtio_pci.c virtiovar.h src/sys/dev/virtio: viocon.c Log Message: Set virtqueues in virtio_child_attach_finish The number of virtqueue maybe change in a part of VirtIO devices (e.g. vioif(4)). And it is fixed after negotiation of features. So the configuration is moved into the function. To generate a diff of this commit: cvs rdiff -u -r1.102 -r1.103 src/sys/dev/pci/if_vioif.c cvs rdiff -u -r1.30 -r1.31 src/sys/dev/pci/ld_virtio.c \ src/sys/dev/pci/vioscsi.c cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/vio9p.c cvs rdiff -u -r1.13 -r1.14 src/sys/dev/pci/viomb.c cvs rdiff -u -r1.18 -r1.19 src/sys/dev/pci/viornd.c cvs rdiff -u -r1.65 -r1.66 src/sys/dev/pci/virtio.c cvs rdiff -u -r1.38 -r1.39 src/sys/dev/pci/virtio_pci.c cvs rdiff -u -r1.24 -r1.25 src/sys/dev/pci/virtiovar.h cvs rdiff -u -r1.5 -r1.6 src/sys/dev/virtio/viocon.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 03:27:48 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c ld_virtio.c vio9p.c viomb.c viornd.c vioscsi.c virtio.c virtio_pci.c virtiovar.h src/sys/dev/virtio: viocon.c Log Message: Set virtqueues in virtio_child_attach_finish The number of virtqueue maybe change in a part of VirtIO devices (e.g. vioif(4)). And it is fixed after negotiation of features. So the configuration is moved into the function. To generate a diff of this commit: cvs rdiff -u -r1.102 -r1.103 src/sys/dev/pci/if_vioif.c cvs rdiff -u -r1.30 -r1.31 src/sys/dev/pci/ld_virtio.c \ src/sys/dev/pci/vioscsi.c cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/vio9p.c cvs rdiff -u -r1.13 -r1.14 src/sys/dev/pci/viomb.c cvs rdiff -u -r1.18 -r1.19 src/sys/dev/pci/viornd.c cvs rdiff -u -r1.65 -r1.66 src/sys/dev/pci/virtio.c cvs rdiff -u -r1.38 -r1.39 src/sys/dev/pci/virtio_pci.c cvs rdiff -u -r1.24 -r1.25 src/sys/dev/pci/virtiovar.h cvs rdiff -u -r1.5 -r1.6 src/sys/dev/virtio/viocon.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_vioif.c diff -u src/sys/dev/pci/if_vioif.c:1.102 src/sys/dev/pci/if_vioif.c:1.103 --- src/sys/dev/pci/if_vioif.c:1.102 Thu Mar 23 03:02:17 2023 +++ src/sys/dev/pci/if_vioif.c Thu Mar 23 03:27:48 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: if_vioif.c,v 1.102 2023/03/23 03:02:17 yamaguchi Exp $ */ +/* $NetBSD: if_vioif.c,v 1.103 2023/03/23 03:27:48 yamaguchi Exp $ */ /* * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.102 2023/03/23 03:02:17 yamaguchi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.103 2023/03/23 03:27:48 yamaguchi Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -465,7 +465,7 @@ vioif_attach(device_t parent, device_t s u_int softint_flags; int r, i, req_flags; char xnamebuf[MAXCOMLEN]; - size_t netq_num; + size_t nvqs; if (virtio_child(vsc) != NULL) { aprint_normal(": child already attached for %s; " @@ -509,11 +509,11 @@ vioif_attach(device_t parent, device_t s #ifdef VIOIF_MULTIQ req_features |= VIRTIO_NET_F_MQ; #endif - virtio_child_attach_start(vsc, self, IPL_NET, NULL, - vioif_config_change, virtio_vq_intrhand, req_flags, - req_features, VIRTIO_NET_FLAG_BITS); + virtio_child_attach_start(vsc, self, IPL_NET, + req_features, VIRTIO_NET_FLAG_BITS); features = virtio_features(vsc); + if (features == 0) goto err; @@ -565,10 +565,12 @@ vioif_attach(device_t parent, device_t s /* Limit the number of queue pairs to use */ sc->sc_req_nvq_pairs = MIN(sc->sc_max_nvq_pairs, ncpu); + + if (sc->sc_max_nvq_pairs > 1) + req_flags |= VIRTIO_F_INTR_PERVQ; } vioif_alloc_queues(sc); - virtio_child_attach_set_vqs(vsc, sc->sc_vqs, sc->sc_req_nvq_pairs); #ifdef VIOIF_MPSAFE softint_flags = SOFTINT_NET | SOFTINT_MPSAFE; @@ -579,15 +581,17 @@ vioif_attach(device_t parent, device_t s /* * Initialize network queues */ - netq_num = sc->sc_max_nvq_pairs * 2; - for (i = 0; i < netq_num; i++) { + nvqs = sc->sc_max_nvq_pairs * 2; + for (i = 0; i < nvqs; i++) { r = vioif_netqueue_init(sc, vsc, i, softint_flags); if (r != 0) goto err; } if (sc->sc_has_ctrl) { - int ctrlq_idx = sc->sc_max_nvq_pairs * 2; + int ctrlq_idx = nvqs; + + nvqs++; /* * Allocating a virtqueue for control channel */ @@ -618,7 +622,9 @@ vioif_attach(device_t parent, device_t s if (vioif_alloc_mems(sc) < 0) goto err; - if (virtio_child_attach_finish(vsc) != 0) + r = virtio_child_attach_finish(vsc, sc->sc_vqs, nvqs, + vioif_config_change, virtio_vq_intrhand, req_flags); + if (r != 0) goto err; if (vioif_setup_sysctl(sc) != 0) { @@ -656,8 +662,8 @@ vioif_attach(device_t parent, device_t s return; err: - netq_num = sc->sc_max_nvq_pairs * 2; - for (i = 0; i < netq_num; i++) { + nvqs = sc->sc_max_nvq_pairs * 2; + for (i = 0; i < nvqs; i++) { vioif_netqueue_teardown(sc, vsc, i); } Index: src/sys/dev/pci/ld_virtio.c diff -u src/sys/dev/pci/ld_virtio.c:1.30 src/sys/dev/pci/ld_virtio.c:1.31 --- src/sys/dev/pci/ld_virtio.c:1.30 Wed Apr 13 10:42:12 2022 +++ src/sys/dev/pci/ld_virtio.c Thu Mar 23 03:27:48 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: ld_virtio.c,v 1.30 2022/04/13 10:42:12 uwe Exp $ */ +/* $NetBSD: ld_virtio.c,v 1.31 2023/03/23 03:27:48 yamaguchi Exp $ */ /* * Copyright (c) 2010 Minoura Makoto. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ld_virtio.c,v 1.30 2022/04/13 10:42:12 uwe Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ld_virtio.c,v 1.31 2023/03/23 03:27:48 yamaguchi Exp $"); #include #include @@ -275,8 +275,7 @@ ld_virtio_attach(device_t parent, device sc->sc_dev = self; sc->sc_virtio = vsc; - virtio_child_attach_start(vsc, self, IPL_BIO, &sc->sc_vq, - NULL, virtio_vq_intr, VIRTIO_F_INTR_MSIX, + virtio_
CVS commit: src/usr.bin/make
Module Name:src Committed By: sjg Date: Thu Mar 23 03:29:28 UTC 2023 Modified Files: src/usr.bin/make: make.1 Log Message: Document unexplained *** Error code 6 To generate a diff of this commit: cvs rdiff -u -r1.360 -r1.361 src/usr.bin/make/make.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/make
Module Name:src Committed By: sjg Date: Thu Mar 23 03:29:28 UTC 2023 Modified Files: src/usr.bin/make: make.1 Log Message: Document unexplained *** Error code 6 To generate a diff of this commit: cvs rdiff -u -r1.360 -r1.361 src/usr.bin/make/make.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/make.1 diff -u src/usr.bin/make/make.1:1.360 src/usr.bin/make/make.1:1.361 --- src/usr.bin/make/make.1:1.360 Thu Jan 26 20:48:17 2023 +++ src/usr.bin/make/make.1 Thu Mar 23 03:29:28 2023 @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.360 2023/01/26 20:48:17 sjg Exp $ +.\" $NetBSD: make.1,v 1.361 2023/03/23 03:29:28 sjg Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd January 26, 2023 +.Dd March 22, 2023 .Dt MAKE 1 .Os .Sh NAME @@ -267,7 +267,9 @@ cooperate to avoid overloading the syste Specify the maximum number of jobs that .Nm may have running at any one time. -The value is saved in +The value of +.Ar max_jobs +is saved in .Va .MAKE.JOBS . Turns compatibility mode off, unless the .Fl B @@ -280,6 +282,13 @@ command invocation and then expect to st on the next line. It is more efficient to correct the scripts rather than turn backwards compatibility on. +.Pp +A job token pool with +.Ar max_jobs +tokens is used to control the total number of jobs running. +Each instance of +.Nm +will wait for a token from the pool before running a new job. .It Fl k Continue processing after errors are encountered, but only on those targets that do not depend on the target whose creation caused the error. @@ -2710,3 +2719,15 @@ In many places just counts {} and () in order to find the end of a variable expansion. .Pp There is no way of escaping a space character in a filename. +.Pp +In jobs mode, when a target fails; +.Nm +will put an error token into the job token pool. +This will cause all other instances of +.Nm +using that token pool to abort the build and exit with error code 6. +Sometimes the attempt to suppress a cascade of unnecessary errors, +can result in a seemingly unexplained +.Ql *** Error code 6 + +
CVS commit: src/sys/dev/virtio
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 03:44:28 UTC 2023 Modified Files: src/sys/dev/virtio: viocon.c Log Message: viocon(4): fix not to allocate unused virtqueue viocon(4) allocates 4 virtqueues but it only uses 2 (0 and 1) queues. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/dev/virtio/viocon.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/virtio
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 03:44:28 UTC 2023 Modified Files: src/sys/dev/virtio: viocon.c Log Message: viocon(4): fix not to allocate unused virtqueue viocon(4) allocates 4 virtqueues but it only uses 2 (0 and 1) queues. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/dev/virtio/viocon.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/virtio/viocon.c diff -u src/sys/dev/virtio/viocon.c:1.6 src/sys/dev/virtio/viocon.c:1.7 --- src/sys/dev/virtio/viocon.c:1.6 Thu Mar 23 03:27:48 2023 +++ src/sys/dev/virtio/viocon.c Thu Mar 23 03:44:28 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: viocon.c,v 1.6 2023/03/23 03:27:48 yamaguchi Exp $ */ +/* $NetBSD: viocon.c,v 1.7 2023/03/23 03:44:28 yamaguchi Exp $ */ /* $OpenBSD: viocon.c,v 1.8 2021/11/05 11:38:29 mpi Exp $ */ /* @@ -18,7 +18,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: viocon.c,v 1.6 2023/03/23 03:27:48 yamaguchi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: viocon.c,v 1.7 2023/03/23 03:44:28 yamaguchi Exp $"); #include #include @@ -123,6 +123,9 @@ struct viocon_softc { struct device *sc_dev; struct virtio_softc *sc_virtio; struct virtqueue *sc_vqs; +#define VIOCON_PORT_RX 0 +#define VIOCON_PORT_TX 1 +#define VIOCON_PORT_NQS 2 struct virtqueue*sc_c_vq_rx; struct virtqueue*sc_c_vq_tx; @@ -194,6 +197,7 @@ viocon_attach(struct device *parent, str struct viocon_softc *sc = device_private(self); struct virtio_softc *vsc = device_private(parent); int maxports = 1; + size_t nvqs; sc->sc_dev = self; if (virtio_child(vsc) != NULL) { @@ -203,8 +207,9 @@ viocon_attach(struct device *parent, str } sc->sc_virtio = vsc; sc->sc_max_ports = maxports; + nvqs = VIOCON_PORT_NQS * maxports; - sc->sc_vqs = kmem_zalloc(2 * (maxports + 1) * sizeof(sc->sc_vqs[0]), + sc->sc_vqs = kmem_zalloc(nvqs * sizeof(sc->sc_vqs[0]), KM_SLEEP); sc->sc_ports = kmem_zalloc(maxports * sizeof(sc->sc_ports[0]), KM_SLEEP); @@ -219,13 +224,13 @@ viocon_attach(struct device *parent, str } viocon_rx_fill(sc->sc_ports[0]); - if (virtio_child_attach_finish(vsc, sc->sc_vqs, sc->sc_max_ports * 2, + if (virtio_child_attach_finish(vsc, sc->sc_vqs, nvqs, /*config_change*/NULL, virtio_vq_intr, /*req_flags*/0) != 0) goto err; return; err: - kmem_free(sc->sc_vqs, 2 * (maxports + 1) * sizeof(sc->sc_vqs[0])); + kmem_free(sc->sc_vqs, nvqs * sizeof(sc->sc_vqs[0])); kmem_free(sc->sc_ports, maxports * sizeof(sc->sc_ports[0])); virtio_child_attach_failed(vsc); } @@ -247,11 +252,8 @@ viocon_port_create(struct viocon_softc * vp->vp_sc = sc; DPRINTF("%s: vp: %p\n", __func__, vp); - if (portidx == 0) - rxidx = 0; - else - rxidx = 2 * (portidx + 1); - txidx = rxidx + 1; + rxidx = (portidx * VIOCON_PORT_NQS) + VIOCON_PORT_RX; + txidx = (portidx * VIOCON_PORT_NQS) + VIOCON_PORT_TX; snprintf(name, sizeof(name), "p%drx", portidx); if (virtio_alloc_vq(vsc, &sc->sc_vqs[rxidx], rxidx, BUFSIZE, 1,
CVS commit: src/sys/dev
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 03:55:11 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c ld_virtio.c vio9p.c viomb.c viornd.c vioscsi.c virtio.c virtiovar.h src/sys/dev/virtio: viocon.c Log Message: Added functions to set interrupt handler and index into virtqueue To generate a diff of this commit: cvs rdiff -u -r1.103 -r1.104 src/sys/dev/pci/if_vioif.c cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pci/ld_virtio.c \ src/sys/dev/pci/vioscsi.c cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/vio9p.c cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pci/viomb.c cvs rdiff -u -r1.19 -r1.20 src/sys/dev/pci/viornd.c cvs rdiff -u -r1.66 -r1.67 src/sys/dev/pci/virtio.c cvs rdiff -u -r1.25 -r1.26 src/sys/dev/pci/virtiovar.h cvs rdiff -u -r1.7 -r1.8 src/sys/dev/virtio/viocon.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 03:55:11 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c ld_virtio.c vio9p.c viomb.c viornd.c vioscsi.c virtio.c virtiovar.h src/sys/dev/virtio: viocon.c Log Message: Added functions to set interrupt handler and index into virtqueue To generate a diff of this commit: cvs rdiff -u -r1.103 -r1.104 src/sys/dev/pci/if_vioif.c cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pci/ld_virtio.c \ src/sys/dev/pci/vioscsi.c cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/vio9p.c cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pci/viomb.c cvs rdiff -u -r1.19 -r1.20 src/sys/dev/pci/viornd.c cvs rdiff -u -r1.66 -r1.67 src/sys/dev/pci/virtio.c cvs rdiff -u -r1.25 -r1.26 src/sys/dev/pci/virtiovar.h cvs rdiff -u -r1.7 -r1.8 src/sys/dev/virtio/viocon.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_vioif.c diff -u src/sys/dev/pci/if_vioif.c:1.103 src/sys/dev/pci/if_vioif.c:1.104 --- src/sys/dev/pci/if_vioif.c:1.103 Thu Mar 23 03:27:48 2023 +++ src/sys/dev/pci/if_vioif.c Thu Mar 23 03:55:11 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: if_vioif.c,v 1.103 2023/03/23 03:27:48 yamaguchi Exp $ */ +/* $NetBSD: if_vioif.c,v 1.104 2023/03/23 03:55:11 yamaguchi Exp $ */ /* * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.103 2023/03/23 03:27:48 yamaguchi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.104 2023/03/23 03:55:11 yamaguchi Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -596,8 +596,10 @@ vioif_attach(device_t parent, device_t s * Allocating a virtqueue for control channel */ sc->sc_ctrlq.ctrlq_vq = &sc->sc_vqs[ctrlq_idx]; - r = virtio_alloc_vq(vsc, ctrlq->ctrlq_vq, ctrlq_idx, - NBPG, 1, "control"); + virtio_init_vq(vsc, ctrlq->ctrlq_vq, ctrlq_idx, + vioif_ctrl_intr, ctrlq); + + r = virtio_alloc_vq(vsc, ctrlq->ctrlq_vq, NBPG, 1, "control"); if (r != 0) { aprint_error_dev(self, "failed to allocate " "a virtqueue for control channel, error code %d\n", @@ -606,9 +608,6 @@ vioif_attach(device_t parent, device_t s sc->sc_has_ctrl = false; cv_destroy(&ctrlq->ctrlq_wait); mutex_destroy(&ctrlq->ctrlq_wait_lock); - } else { - ctrlq->ctrlq_vq->vq_intrhand = vioif_ctrl_intr; - ctrlq->ctrlq_vq->vq_intrhand_arg = (void *) ctrlq; } } @@ -623,7 +622,7 @@ vioif_attach(device_t parent, device_t s goto err; r = virtio_child_attach_finish(vsc, sc->sc_vqs, nvqs, - vioif_config_change, virtio_vq_intrhand, req_flags); + vioif_config_change, req_flags); if (r != 0) goto err; @@ -1470,15 +1469,15 @@ vioif_netqueue_init(struct vioif_softc * "%s-%s", device_xname(sc->sc_dev), qname); mutex_init(&netq->netq_lock, MUTEX_DEFAULT, IPL_NET); - r = virtio_alloc_vq(vsc, vq, qid, + virtio_init_vq(vsc, vq, qid, params[dir].intrhand, netq); + + r = virtio_alloc_vq(vsc, vq, params[dir].segsize + sc->sc_hdr_size, params[dir].nsegs, qname); if (r != 0) goto err; netq->netq_vq = vq; - netq->netq_vq->vq_intrhand = params[dir].intrhand; - netq->netq_vq->vq_intrhand_arg = netq; netq->netq_softint = softint_establish(softint_flags, params[dir].sihand, netq); if (netq->netq_softint == NULL) { @@ -1534,8 +1533,6 @@ err: softint_disestablish(netq->netq_softint); netq->netq_softint = NULL; } - netq->netq_vq->vq_intrhand = NULL; - netq->netq_vq->vq_intrhand_arg = NULL; virtio_free_vq(vsc, vq); mutex_destroy(&netq->netq_lock); Index: src/sys/dev/pci/ld_virtio.c diff -u src/sys/dev/pci/ld_virtio.c:1.31 src/sys/dev/pci/ld_virtio.c:1.32 --- src/sys/dev/pci/ld_virtio.c:1.31 Thu Mar 23 03:27:48 2023 +++ src/sys/dev/pci/ld_virtio.c Thu Mar 23 03:55:11 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: ld_virtio.c,v 1.31 2023/03/23 03:27:48 yamaguchi Exp $ */ +/* $NetBSD: ld_virtio.c,v 1.32 2023/03/23 03:55:11 yamaguchi Exp $ */ /* * Copyright (c) 2010 Minoura Makoto. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ld_virtio.c,v 1.31 2023/03/23 03:27:48 yamaguchi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ld_virtio.c,v 1.32 2023/03/23 03:55:11 yamaguchi Exp $"); #include #include @@ -332,15 +332,17 @@ ld_virtio_attach(device_t parent, device /* 2 for the minimum size */ maxnsegs += VIRTIO_BLK_MIN_SEGMENTS; - if (virtio_alloc_vq(vsc, &sc->sc_vq, 0, maxxfersize, maxnsegs, + virtio_init_vq_vqdone(vsc, &sc->sc_vq, 0, + ld_virtio_vq_done); + + if (virtio_alloc_vq(vsc, &sc->sc_vq, maxxfersize, maxnsegs, "I/O request") != 0) { goto err; } qsize = sc->sc_vq.vq_num; - sc->sc_vq.vq_done = ld_virtio_vq_done; if (virtio_child_attach_finish(vsc, &sc->sc_vq, 1, - NULL, virtio_vq_intr, VIRTIO_F_INTR_MSIX) != 0) + NULL, VIRTIO_F_INTR_MSIX) != 0) goto err; ld->sc_dv = self; Index: src/sys/dev/pci/vioscsi.c diff -u src/sys/
CVS import: xsrc/external/mit/libXaw/dist
Module Name:xsrc Committed By: mrg Date: Thu Mar 23 05:25:50 UTC 2023 Update of /cvsroot/xsrc/external/mit/libXaw/dist In directory ivanova.netbsd.org:/tmp/cvs-serv8243 Log Message: initial import of libXaw-1.0.15 Status: Vendor Tag: xorg Release Tags: libXaw-1-0-15 U xsrc/external/mit/libXaw/dist/docbook.am U xsrc/external/mit/libXaw/dist/COPYING U xsrc/external/mit/libXaw/dist/config.h.in U xsrc/external/mit/libXaw/dist/compile U xsrc/external/mit/libXaw/dist/config.guess U xsrc/external/mit/libXaw/dist/missing U xsrc/external/mit/libXaw/dist/ltmain.sh U xsrc/external/mit/libXaw/dist/aclocal.m4 U xsrc/external/mit/libXaw/dist/depcomp U xsrc/external/mit/libXaw/dist/install-sh U xsrc/external/mit/libXaw/dist/autogen.sh U xsrc/external/mit/libXaw/dist/Makefile.in U xsrc/external/mit/libXaw/dist/xaw7.pc.in U xsrc/external/mit/libXaw/dist/INSTALL U xsrc/external/mit/libXaw/dist/xaw6.pc.in U xsrc/external/mit/libXaw/dist/configure U xsrc/external/mit/libXaw/dist/Makefile.am U xsrc/external/mit/libXaw/dist/configure.ac U xsrc/external/mit/libXaw/dist/config.sub U xsrc/external/mit/libXaw/dist/README.md U xsrc/external/mit/libXaw/dist/ChangeLog U xsrc/external/mit/libXaw/dist/specs/SmeLine.xml U xsrc/external/mit/libXaw/dist/specs/Box.xml U xsrc/external/mit/libXaw/dist/specs/SimpleMenu.xml U xsrc/external/mit/libXaw/dist/specs/List.xml U xsrc/external/mit/libXaw/dist/specs/Template_public_header_file.xml U xsrc/external/mit/libXaw/dist/specs/Label.xml U xsrc/external/mit/libXaw/dist/specs/TextSource.xml U xsrc/external/mit/libXaw/dist/specs/Tree.xml U xsrc/external/mit/libXaw/dist/specs/Viewport.xml U xsrc/external/mit/libXaw/dist/specs/Sme.xml U xsrc/external/mit/libXaw/dist/specs/CH1.xml U xsrc/external/mit/libXaw/dist/specs/CH6.xml U xsrc/external/mit/libXaw/dist/specs/Template_widget_source_file.xml U xsrc/external/mit/libXaw/dist/specs/TextSink.xml U xsrc/external/mit/libXaw/dist/specs/libXaw.xml U xsrc/external/mit/libXaw/dist/specs/libXaw.ent.in U xsrc/external/mit/libXaw/dist/specs/Paned.xml U xsrc/external/mit/libXaw/dist/specs/TextFuncs.xml U xsrc/external/mit/libXaw/dist/specs/Scrollbar.xml U xsrc/external/mit/libXaw/dist/specs/Grip.xml U xsrc/external/mit/libXaw/dist/specs/AsciiSink.xml U xsrc/external/mit/libXaw/dist/specs/Template_private_header_file.xml U xsrc/external/mit/libXaw/dist/specs/CH7.xml U xsrc/external/mit/libXaw/dist/specs/Repeater.xml U xsrc/external/mit/libXaw/dist/specs/Porthole.xml U xsrc/external/mit/libXaw/dist/specs/TextCustom.xml U xsrc/external/mit/libXaw/dist/specs/CH3.xml U xsrc/external/mit/libXaw/dist/specs/CH4.xml U xsrc/external/mit/libXaw/dist/specs/Simple.xml U xsrc/external/mit/libXaw/dist/specs/Template.xml U xsrc/external/mit/libXaw/dist/specs/AsciiText.xml U xsrc/external/mit/libXaw/dist/specs/Text.xml U xsrc/external/mit/libXaw/dist/specs/Makefile.am U xsrc/external/mit/libXaw/dist/specs/Toggle.xml U xsrc/external/mit/libXaw/dist/specs/Form.xml U xsrc/external/mit/libXaw/dist/specs/Dialog.xml U xsrc/external/mit/libXaw/dist/specs/TPage_Credits.xml U xsrc/external/mit/libXaw/dist/specs/Panner.xml U xsrc/external/mit/libXaw/dist/specs/TextActions.xml U xsrc/external/mit/libXaw/dist/specs/TextActions_default_translation_bindings.xml U xsrc/external/mit/libXaw/dist/specs/SmeBSB.xml U xsrc/external/mit/libXaw/dist/specs/CH5.xml U xsrc/external/mit/libXaw/dist/specs/CH2.xml U xsrc/external/mit/libXaw/dist/specs/StripChart.xml U xsrc/external/mit/libXaw/dist/specs/AsciiSource.xml U xsrc/external/mit/libXaw/dist/specs/MenuButton.xml U xsrc/external/mit/libXaw/dist/specs/Makefile.in U xsrc/external/mit/libXaw/dist/specs/TextActions_text_widget_actions.xml U xsrc/external/mit/libXaw/dist/specs/Command.xml U xsrc/external/mit/libXaw/dist/include/Makefile.in U xsrc/external/mit/libXaw/dist/include/Makefile.am U xsrc/external/mit/libXaw/dist/include/X11/Xaw/Tip.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/AsciiTextP.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/CommandP.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/MenuButtoP.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/Form.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/Scrollbar.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/Dialog.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/MenuButton.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/PortholeP.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/GripP.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/VendorEP.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/List.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/ListP.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/Text.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/TextSrc.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/Toggle.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/TextSinkP.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/TreeP.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/Sme.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/
CVS import: xsrc/external/mit/libXaw/dist
Module Name:xsrc Committed By: mrg Date: Thu Mar 23 05:25:50 UTC 2023 Update of /cvsroot/xsrc/external/mit/libXaw/dist In directory ivanova.netbsd.org:/tmp/cvs-serv8243 Log Message: initial import of libXaw-1.0.15 Status: Vendor Tag: xorg Release Tags: libXaw-1-0-15 U xsrc/external/mit/libXaw/dist/docbook.am U xsrc/external/mit/libXaw/dist/COPYING U xsrc/external/mit/libXaw/dist/config.h.in U xsrc/external/mit/libXaw/dist/compile U xsrc/external/mit/libXaw/dist/config.guess U xsrc/external/mit/libXaw/dist/missing U xsrc/external/mit/libXaw/dist/ltmain.sh U xsrc/external/mit/libXaw/dist/aclocal.m4 U xsrc/external/mit/libXaw/dist/depcomp U xsrc/external/mit/libXaw/dist/install-sh U xsrc/external/mit/libXaw/dist/autogen.sh U xsrc/external/mit/libXaw/dist/Makefile.in U xsrc/external/mit/libXaw/dist/xaw7.pc.in U xsrc/external/mit/libXaw/dist/INSTALL U xsrc/external/mit/libXaw/dist/xaw6.pc.in U xsrc/external/mit/libXaw/dist/configure U xsrc/external/mit/libXaw/dist/Makefile.am U xsrc/external/mit/libXaw/dist/configure.ac U xsrc/external/mit/libXaw/dist/config.sub U xsrc/external/mit/libXaw/dist/README.md U xsrc/external/mit/libXaw/dist/ChangeLog U xsrc/external/mit/libXaw/dist/specs/SmeLine.xml U xsrc/external/mit/libXaw/dist/specs/Box.xml U xsrc/external/mit/libXaw/dist/specs/SimpleMenu.xml U xsrc/external/mit/libXaw/dist/specs/List.xml U xsrc/external/mit/libXaw/dist/specs/Template_public_header_file.xml U xsrc/external/mit/libXaw/dist/specs/Label.xml U xsrc/external/mit/libXaw/dist/specs/TextSource.xml U xsrc/external/mit/libXaw/dist/specs/Tree.xml U xsrc/external/mit/libXaw/dist/specs/Viewport.xml U xsrc/external/mit/libXaw/dist/specs/Sme.xml U xsrc/external/mit/libXaw/dist/specs/CH1.xml U xsrc/external/mit/libXaw/dist/specs/CH6.xml U xsrc/external/mit/libXaw/dist/specs/Template_widget_source_file.xml U xsrc/external/mit/libXaw/dist/specs/TextSink.xml U xsrc/external/mit/libXaw/dist/specs/libXaw.xml U xsrc/external/mit/libXaw/dist/specs/libXaw.ent.in U xsrc/external/mit/libXaw/dist/specs/Paned.xml U xsrc/external/mit/libXaw/dist/specs/TextFuncs.xml U xsrc/external/mit/libXaw/dist/specs/Scrollbar.xml U xsrc/external/mit/libXaw/dist/specs/Grip.xml U xsrc/external/mit/libXaw/dist/specs/AsciiSink.xml U xsrc/external/mit/libXaw/dist/specs/Template_private_header_file.xml U xsrc/external/mit/libXaw/dist/specs/CH7.xml U xsrc/external/mit/libXaw/dist/specs/Repeater.xml U xsrc/external/mit/libXaw/dist/specs/Porthole.xml U xsrc/external/mit/libXaw/dist/specs/TextCustom.xml U xsrc/external/mit/libXaw/dist/specs/CH3.xml U xsrc/external/mit/libXaw/dist/specs/CH4.xml U xsrc/external/mit/libXaw/dist/specs/Simple.xml U xsrc/external/mit/libXaw/dist/specs/Template.xml U xsrc/external/mit/libXaw/dist/specs/AsciiText.xml U xsrc/external/mit/libXaw/dist/specs/Text.xml U xsrc/external/mit/libXaw/dist/specs/Makefile.am U xsrc/external/mit/libXaw/dist/specs/Toggle.xml U xsrc/external/mit/libXaw/dist/specs/Form.xml U xsrc/external/mit/libXaw/dist/specs/Dialog.xml U xsrc/external/mit/libXaw/dist/specs/TPage_Credits.xml U xsrc/external/mit/libXaw/dist/specs/Panner.xml U xsrc/external/mit/libXaw/dist/specs/TextActions.xml U xsrc/external/mit/libXaw/dist/specs/TextActions_default_translation_bindings.xml U xsrc/external/mit/libXaw/dist/specs/SmeBSB.xml U xsrc/external/mit/libXaw/dist/specs/CH5.xml U xsrc/external/mit/libXaw/dist/specs/CH2.xml U xsrc/external/mit/libXaw/dist/specs/StripChart.xml U xsrc/external/mit/libXaw/dist/specs/AsciiSource.xml U xsrc/external/mit/libXaw/dist/specs/MenuButton.xml U xsrc/external/mit/libXaw/dist/specs/Makefile.in U xsrc/external/mit/libXaw/dist/specs/TextActions_text_widget_actions.xml U xsrc/external/mit/libXaw/dist/specs/Command.xml U xsrc/external/mit/libXaw/dist/include/Makefile.in U xsrc/external/mit/libXaw/dist/include/Makefile.am U xsrc/external/mit/libXaw/dist/include/X11/Xaw/Tip.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/AsciiTextP.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/CommandP.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/MenuButtoP.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/Form.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/Scrollbar.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/Dialog.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/MenuButton.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/PortholeP.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/GripP.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/VendorEP.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/List.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/ListP.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/Text.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/TextSrc.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/Toggle.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/TextSinkP.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/TreeP.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/Sme.h U xsrc/external/mit/libXaw/dist/include/X11/Xaw/
CVS commit: xsrc/external/mit/libXaw/dist/src
Module Name:xsrc Committed By: mrg Date: Thu Mar 23 05:26:15 UTC 2023 Modified Files: xsrc/external/mit/libXaw/dist/src: Pixmap.c Text.c TextAction.c Log Message: merge libXaw 1.0.15. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 xsrc/external/mit/libXaw/dist/src/Pixmap.c \ xsrc/external/mit/libXaw/dist/src/TextAction.c cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/libXaw/dist/src/Text.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: xsrc/external/mit/libXaw/dist/src/Pixmap.c diff -u xsrc/external/mit/libXaw/dist/src/Pixmap.c:1.2 xsrc/external/mit/libXaw/dist/src/Pixmap.c:1.3 --- xsrc/external/mit/libXaw/dist/src/Pixmap.c:1.2 Sun May 9 16:58:19 2021 +++ xsrc/external/mit/libXaw/dist/src/Pixmap.c Thu Mar 23 05:26:15 2023 @@ -690,6 +690,7 @@ GetResourcePixmapPath(Display *display) length = (length + (int)strlen(tok) + 3); } } + XtFree(buffer); pixmap_path = XtRealloc(pixmap_path, (Cardinal)((size_t)length + strlen(default_path) + 2)); if (length) pixmap_path[length++] = ':'; Index: xsrc/external/mit/libXaw/dist/src/TextAction.c diff -u xsrc/external/mit/libXaw/dist/src/TextAction.c:1.2 xsrc/external/mit/libXaw/dist/src/TextAction.c:1.3 --- xsrc/external/mit/libXaw/dist/src/TextAction.c:1.2 Sun May 9 16:58:57 2021 +++ xsrc/external/mit/libXaw/dist/src/TextAction.c Thu Mar 23 05:26:15 2023 @@ -2607,7 +2607,7 @@ InsertNewLineAndIndent(Widget w, XEvent strcpy(++ptr, line_to_ip); length++; - while (length && (isspace(*ptr) || (*ptr == XawTAB))) + while (length && (isspace((unsigned char)*ptr) || (*ptr == XawTAB))) ptr++, length--; *ptr = '\0'; text.length = (int)strlen(text.ptr); @@ -2822,7 +2822,7 @@ RedrawDisplay(Widget w, XEvent *event, S /* This is kind of a hack, but, only one text widget can have focus at * a time on one display. There is a problem in the implementation of the - * text widget, the scrollbars can not be adressed via editres, since they + * text widget, the scrollbars can not be addressed via editres, since they * are not children of a subclass of composite. * The focus variable is required to make sure only one text window will * show a block cursor at one time. @@ -2971,7 +2971,7 @@ TextLeaveWindow(Widget w, XEvent *event, * Arguments: ctx - The text widget. * * Description: - * Breaks the line at the previous word boundry when + * Breaks the line at the previous word boundary when * called inside InsertChar. */ static void @@ -3201,7 +3201,7 @@ InsertChar(Widget w, XEvent *event, Stri * * i18n requires the ability to specify multiple characters in a hexa- * decimal string at once. Since Insert was already too long, I made - * this a seperate routine. + * this a separate routine. * * A legal hex string in MBNF: '0' 'x' ( HEX-DIGIT HEX-DIGIT )+ '\0' * @@ -3257,7 +3257,7 @@ IfHexConvertHexElseReturnParam(const cha } } -/* We quit the above loop becasue we hit a non hex. If that char is \0... */ +/* We quit the above loop because we hit a non hex. If that char is \0... */ if ((c == '\0') && first_digit) { *len_return = (int)strlen(hexval); return (hexval); /* ...it was a legal hex string, so return it */ @@ -3391,7 +3391,7 @@ Numeric(Widget w, XEvent *event, String long mult = ctx->text.mult; if (*num_params != 1 || strlen(params[0]) != 1 - || (!isdigit(params[0][0]) + || (!isdigit((unsigned char)params[0][0]) && (params[0][0] != '-' || mult != 0))) { char err_buf[256]; @@ -3589,7 +3589,7 @@ StripOutOldCRs(TextWidget ctx, XawTextPo if (!iswspace(((wchar_t*)buf)[i]) || ((periodPos + i) >= to)) break; } - else if (!isspace(buf[i]) || (periodPos + i) >= to) + else if (!isspace((unsigned char)buf[i]) || (periodPos + i) >= to) break; XtFree(buf); @@ -3679,7 +3679,7 @@ InsertNewCRs(TextWidget ctx, XawTextPosi if (!iswspace(((wchar_t*)buf)[i])) break; } - else if (!isspace(buf[i])) + else if (!isspace((unsigned char)buf[i])) break; to -= (i - 1); @@ -3809,7 +3809,7 @@ GetBlockBoundaries(TextWidget ctx, XawMin(ctx->text.s.left, ctx->text.s.right), XawstEOL, XawsdLeft, 1, False); to = SrcScan(ctx->text.source, - XawMax(ctx->text.s.right, ctx->text.s.right), + XawMax(ctx->text.s.left, ctx->text.s.right), XawstEOL, XawsdRight, 1, False); } else { @@ -4128,7 +4128,7 @@ NoOp(Widget w, XEvent *event _X_UNUSED, case 'R': case 'r': XBell(XtDisplay(w), 0); - /*FALLTROUGH*/ + /*FALLTHROUGH*/ default: break; } Index: xsrc/external/mit/libXaw/dist/src/Text.c diff -u xsrc/external/mit/libXaw/dist/src/Text.c:1.3 xsrc/external/mit/libXaw/dist/src/Text.c:1.4 --- xsrc/external/mit/libXaw/dist/src/Text.c:1.3 Mon Apr 26 21:25:12 2021 +++ xsrc/external/mit/libXaw/dist/src/Text.c Thu Mar 23 05:26:15 2023 @@ -925,7 +925,
CVS commit: xsrc/external/mit/libXaw/dist/src
Module Name:xsrc Committed By: mrg Date: Thu Mar 23 05:26:15 UTC 2023 Modified Files: xsrc/external/mit/libXaw/dist/src: Pixmap.c Text.c TextAction.c Log Message: merge libXaw 1.0.15. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 xsrc/external/mit/libXaw/dist/src/Pixmap.c \ xsrc/external/mit/libXaw/dist/src/TextAction.c cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/libXaw/dist/src/Text.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/distrib/sets/lists/base
Module Name:src Committed By: mrg Date: Thu Mar 23 05:38:19 UTC 2023 Modified Files: src/distrib/sets/lists/base: shl.mi Log Message: un-obsolete ./usr/lib/libisns.so*. it's normal for these to be symlinks in this case, and they also exist in the case that MKDYNAMICROOT is not set. also fixes running "makefs" against a destdir and it's METALOG*. To generate a diff of this commit: cvs rdiff -u -r1.944 -r1.945 src/distrib/sets/lists/base/shl.mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/distrib/sets/lists/base
Module Name:src Committed By: mrg Date: Thu Mar 23 05:38:19 UTC 2023 Modified Files: src/distrib/sets/lists/base: shl.mi Log Message: un-obsolete ./usr/lib/libisns.so*. it's normal for these to be symlinks in this case, and they also exist in the case that MKDYNAMICROOT is not set. also fixes running "makefs" against a destdir and it's METALOG*. To generate a diff of this commit: cvs rdiff -u -r1.944 -r1.945 src/distrib/sets/lists/base/shl.mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/base/shl.mi diff -u src/distrib/sets/lists/base/shl.mi:1.944 src/distrib/sets/lists/base/shl.mi:1.945 --- src/distrib/sets/lists/base/shl.mi:1.944 Wed Feb 8 15:52:46 2023 +++ src/distrib/sets/lists/base/shl.mi Thu Mar 23 05:38:18 2023 @@ -1,4 +1,4 @@ -# $NetBSD: shl.mi,v 1.944 2023/02/08 15:52:46 christos Exp $ +# $NetBSD: shl.mi,v 1.945 2023/03/23 05:38:18 mrg Exp $ # # Note: Don't delete entries from here - mark them as "obsolete" instead, # unless otherwise stated below. @@ -393,9 +393,9 @@ ./usr/lib/libiscsi.sobase-iscsi-shlib iscsi,compatfile ./usr/lib/libiscsi.so.2base-iscsi-shlib iscsi,compatfile ./usr/lib/libiscsi.so.2.0 base-iscsi-shlib iscsi,compatfile -./usr/lib/libisns.sobase-isns-shlib obsolete,compatfile -./usr/lib/libisns.so.0base-isns-shlib obsolete,compatfile -./usr/lib/libisns.so.0.0 base-isns-shlib obsolete,compatfile +./usr/lib/libisns.sobase-isns-shlib compatfile +./usr/lib/libisns.so.0base-isns-shlib compatfile +./usr/lib/libisns.so.0.0 base-isns-shlib compatfile ./usr/lib/libjemalloc.so base-sys-shlib compatfile ./usr/lib/libjemalloc.so.0 base-sys-shlib compatfile ./usr/lib/libjemalloc.so.0.0 base-sys-shlib compatfile
CVS import: xsrc/external/mit/xkeyboard-config/dist
Module Name:xsrc Committed By: mrg Date: Thu Mar 23 06:22:18 UTC 2023 Update of /cvsroot/xsrc/external/mit/xkeyboard-config/dist In directory ivanova.netbsd.org:/tmp/cvs-serv11536 Log Message: initial import of xkeyboard-config-2.38 Status: Vendor Tag: xorg Release Tags: xkeyboard-config-2-38 U xsrc/external/mit/xkeyboard-config/dist/AUTHORS U xsrc/external/mit/xkeyboard-config/dist/COPYING U xsrc/external/mit/xkeyboard-config/dist/ChangeLog U xsrc/external/mit/xkeyboard-config/dist/NEWS U xsrc/external/mit/xkeyboard-config/dist/README U xsrc/external/mit/xkeyboard-config/dist/meson.build U xsrc/external/mit/xkeyboard-config/dist/meson_options.txt U xsrc/external/mit/xkeyboard-config/dist/compat/README U xsrc/external/mit/xkeyboard-config/dist/compat/accessx U xsrc/external/mit/xkeyboard-config/dist/compat/basic U xsrc/external/mit/xkeyboard-config/dist/compat/caps U xsrc/external/mit/xkeyboard-config/dist/compat/complete U xsrc/external/mit/xkeyboard-config/dist/compat/iso9995 U xsrc/external/mit/xkeyboard-config/dist/compat/japan U xsrc/external/mit/xkeyboard-config/dist/compat/ledcaps U xsrc/external/mit/xkeyboard-config/dist/compat/ledcompose U xsrc/external/mit/xkeyboard-config/dist/compat/lednum U xsrc/external/mit/xkeyboard-config/dist/compat/ledscroll U xsrc/external/mit/xkeyboard-config/dist/compat/level5 U xsrc/external/mit/xkeyboard-config/dist/compat/misc U xsrc/external/mit/xkeyboard-config/dist/compat/mousekeys U xsrc/external/mit/xkeyboard-config/dist/compat/olpc U xsrc/external/mit/xkeyboard-config/dist/compat/pc U xsrc/external/mit/xkeyboard-config/dist/compat/pc98 U xsrc/external/mit/xkeyboard-config/dist/compat/xfree86 U xsrc/external/mit/xkeyboard-config/dist/compat/xtest U xsrc/external/mit/xkeyboard-config/dist/docs/HOWTO.testing U xsrc/external/mit/xkeyboard-config/dist/docs/README.config U xsrc/external/mit/xkeyboard-config/dist/docs/README.enhancing U xsrc/external/mit/xkeyboard-config/dist/docs/README.symbols U xsrc/external/mit/xkeyboard-config/dist/docs/iso15924.csv U xsrc/external/mit/xkeyboard-config/dist/docs/iso3166-3.csv U xsrc/external/mit/xkeyboard-config/dist/docs/iso3166.csv U xsrc/external/mit/xkeyboard-config/dist/docs/iso639.csv U xsrc/external/mit/xkeyboard-config/dist/geometry/README U xsrc/external/mit/xkeyboard-config/dist/geometry/amiga U xsrc/external/mit/xkeyboard-config/dist/geometry/ataritt U xsrc/external/mit/xkeyboard-config/dist/geometry/chicony U xsrc/external/mit/xkeyboard-config/dist/geometry/dell U xsrc/external/mit/xkeyboard-config/dist/geometry/everex U xsrc/external/mit/xkeyboard-config/dist/geometry/fujitsu U xsrc/external/mit/xkeyboard-config/dist/geometry/hhk U xsrc/external/mit/xkeyboard-config/dist/geometry/hp U xsrc/external/mit/xkeyboard-config/dist/geometry/keytronic U xsrc/external/mit/xkeyboard-config/dist/geometry/kinesis U xsrc/external/mit/xkeyboard-config/dist/geometry/macintosh U xsrc/external/mit/xkeyboard-config/dist/geometry/microsoft U xsrc/external/mit/xkeyboard-config/dist/geometry/nec U xsrc/external/mit/xkeyboard-config/dist/geometry/nokia U xsrc/external/mit/xkeyboard-config/dist/geometry/northgate U xsrc/external/mit/xkeyboard-config/dist/geometry/pc U xsrc/external/mit/xkeyboard-config/dist/geometry/sanwa U xsrc/external/mit/xkeyboard-config/dist/geometry/sony U xsrc/external/mit/xkeyboard-config/dist/geometry/steelseries U xsrc/external/mit/xkeyboard-config/dist/geometry/sun U xsrc/external/mit/xkeyboard-config/dist/geometry/teck U xsrc/external/mit/xkeyboard-config/dist/geometry/thinkpad U xsrc/external/mit/xkeyboard-config/dist/geometry/typematrix U xsrc/external/mit/xkeyboard-config/dist/geometry/winbook U xsrc/external/mit/xkeyboard-config/dist/geometry/digital_vndr/lk U xsrc/external/mit/xkeyboard-config/dist/geometry/digital_vndr/pc U xsrc/external/mit/xkeyboard-config/dist/geometry/digital_vndr/unix U xsrc/external/mit/xkeyboard-config/dist/geometry/sgi_vndr/O2 U xsrc/external/mit/xkeyboard-config/dist/geometry/sgi_vndr/indigo U xsrc/external/mit/xkeyboard-config/dist/geometry/sgi_vndr/indy U xsrc/external/mit/xkeyboard-config/dist/keycodes/README U xsrc/external/mit/xkeyboard-config/dist/keycodes/aliases U xsrc/external/mit/xkeyboard-config/dist/keycodes/amiga U xsrc/external/mit/xkeyboard-config/dist/keycodes/ataritt U xsrc/external/mit/xkeyboard-config/dist/keycodes/empty U xsrc/external/mit/xkeyboard-config/dist/keycodes/evdev U xsrc/external/mit/xkeyboard-config/dist/keycodes/fujitsu U xsrc/external/mit/xkeyboard-config/dist/keycodes/hp U xsrc/external/mit/xkeyboard-config/dist/keycodes/ibm U xsrc/external/mit/xkeyboard-config/dist/keycodes/jolla U xsrc/external/mit/xkeyboard-config/dist/keycodes/macintosh U xsrc/external/mit/xkeyboard-config/dist/keycodes/olpc U xsrc/external/mit/xkeyboard-config/dist/keycodes/sony U xsrc/external/mit/xkeyboard-config/dist/keycodes/sun U xsrc/external/mit/xkeyboard-config/dist/keycodes/xfree86 U xsrc/external/mit/xkeyboard-config/dis
CVS import: xsrc/external/mit/xkeyboard-config/dist
Module Name:xsrc Committed By: mrg Date: Thu Mar 23 06:22:18 UTC 2023 Update of /cvsroot/xsrc/external/mit/xkeyboard-config/dist In directory ivanova.netbsd.org:/tmp/cvs-serv11536 Log Message: initial import of xkeyboard-config-2.38 Status: Vendor Tag: xorg Release Tags: xkeyboard-config-2-38 U xsrc/external/mit/xkeyboard-config/dist/AUTHORS U xsrc/external/mit/xkeyboard-config/dist/COPYING U xsrc/external/mit/xkeyboard-config/dist/ChangeLog U xsrc/external/mit/xkeyboard-config/dist/NEWS U xsrc/external/mit/xkeyboard-config/dist/README U xsrc/external/mit/xkeyboard-config/dist/meson.build U xsrc/external/mit/xkeyboard-config/dist/meson_options.txt U xsrc/external/mit/xkeyboard-config/dist/compat/README U xsrc/external/mit/xkeyboard-config/dist/compat/accessx U xsrc/external/mit/xkeyboard-config/dist/compat/basic U xsrc/external/mit/xkeyboard-config/dist/compat/caps U xsrc/external/mit/xkeyboard-config/dist/compat/complete U xsrc/external/mit/xkeyboard-config/dist/compat/iso9995 U xsrc/external/mit/xkeyboard-config/dist/compat/japan U xsrc/external/mit/xkeyboard-config/dist/compat/ledcaps U xsrc/external/mit/xkeyboard-config/dist/compat/ledcompose U xsrc/external/mit/xkeyboard-config/dist/compat/lednum U xsrc/external/mit/xkeyboard-config/dist/compat/ledscroll U xsrc/external/mit/xkeyboard-config/dist/compat/level5 U xsrc/external/mit/xkeyboard-config/dist/compat/misc U xsrc/external/mit/xkeyboard-config/dist/compat/mousekeys U xsrc/external/mit/xkeyboard-config/dist/compat/olpc U xsrc/external/mit/xkeyboard-config/dist/compat/pc U xsrc/external/mit/xkeyboard-config/dist/compat/pc98 U xsrc/external/mit/xkeyboard-config/dist/compat/xfree86 U xsrc/external/mit/xkeyboard-config/dist/compat/xtest U xsrc/external/mit/xkeyboard-config/dist/docs/HOWTO.testing U xsrc/external/mit/xkeyboard-config/dist/docs/README.config U xsrc/external/mit/xkeyboard-config/dist/docs/README.enhancing U xsrc/external/mit/xkeyboard-config/dist/docs/README.symbols U xsrc/external/mit/xkeyboard-config/dist/docs/iso15924.csv U xsrc/external/mit/xkeyboard-config/dist/docs/iso3166-3.csv U xsrc/external/mit/xkeyboard-config/dist/docs/iso3166.csv U xsrc/external/mit/xkeyboard-config/dist/docs/iso639.csv U xsrc/external/mit/xkeyboard-config/dist/geometry/README U xsrc/external/mit/xkeyboard-config/dist/geometry/amiga U xsrc/external/mit/xkeyboard-config/dist/geometry/ataritt U xsrc/external/mit/xkeyboard-config/dist/geometry/chicony U xsrc/external/mit/xkeyboard-config/dist/geometry/dell U xsrc/external/mit/xkeyboard-config/dist/geometry/everex U xsrc/external/mit/xkeyboard-config/dist/geometry/fujitsu U xsrc/external/mit/xkeyboard-config/dist/geometry/hhk U xsrc/external/mit/xkeyboard-config/dist/geometry/hp U xsrc/external/mit/xkeyboard-config/dist/geometry/keytronic U xsrc/external/mit/xkeyboard-config/dist/geometry/kinesis U xsrc/external/mit/xkeyboard-config/dist/geometry/macintosh U xsrc/external/mit/xkeyboard-config/dist/geometry/microsoft U xsrc/external/mit/xkeyboard-config/dist/geometry/nec U xsrc/external/mit/xkeyboard-config/dist/geometry/nokia U xsrc/external/mit/xkeyboard-config/dist/geometry/northgate U xsrc/external/mit/xkeyboard-config/dist/geometry/pc U xsrc/external/mit/xkeyboard-config/dist/geometry/sanwa U xsrc/external/mit/xkeyboard-config/dist/geometry/sony U xsrc/external/mit/xkeyboard-config/dist/geometry/steelseries U xsrc/external/mit/xkeyboard-config/dist/geometry/sun U xsrc/external/mit/xkeyboard-config/dist/geometry/teck U xsrc/external/mit/xkeyboard-config/dist/geometry/thinkpad U xsrc/external/mit/xkeyboard-config/dist/geometry/typematrix U xsrc/external/mit/xkeyboard-config/dist/geometry/winbook U xsrc/external/mit/xkeyboard-config/dist/geometry/digital_vndr/lk U xsrc/external/mit/xkeyboard-config/dist/geometry/digital_vndr/pc U xsrc/external/mit/xkeyboard-config/dist/geometry/digital_vndr/unix U xsrc/external/mit/xkeyboard-config/dist/geometry/sgi_vndr/O2 U xsrc/external/mit/xkeyboard-config/dist/geometry/sgi_vndr/indigo U xsrc/external/mit/xkeyboard-config/dist/geometry/sgi_vndr/indy U xsrc/external/mit/xkeyboard-config/dist/keycodes/README U xsrc/external/mit/xkeyboard-config/dist/keycodes/aliases U xsrc/external/mit/xkeyboard-config/dist/keycodes/amiga U xsrc/external/mit/xkeyboard-config/dist/keycodes/ataritt U xsrc/external/mit/xkeyboard-config/dist/keycodes/empty U xsrc/external/mit/xkeyboard-config/dist/keycodes/evdev U xsrc/external/mit/xkeyboard-config/dist/keycodes/fujitsu U xsrc/external/mit/xkeyboard-config/dist/keycodes/hp U xsrc/external/mit/xkeyboard-config/dist/keycodes/ibm U xsrc/external/mit/xkeyboard-config/dist/keycodes/jolla U xsrc/external/mit/xkeyboard-config/dist/keycodes/macintosh U xsrc/external/mit/xkeyboard-config/dist/keycodes/olpc U xsrc/external/mit/xkeyboard-config/dist/keycodes/sony U xsrc/external/mit/xkeyboard-config/dist/keycodes/sun U xsrc/external/mit/xkeyboard-config/dist/keycodes/xfree86 U xsrc/external/mit/xkeyboard-config/dis
CVS commit: xsrc/external/mit/xkeyboard-config/dist/symbols
Module Name:xsrc Committed By: mrg Date: Thu Mar 23 06:22:44 UTC 2023 Modified Files: xsrc/external/mit/xkeyboard-config/dist/symbols: in lk Log Message: merge xkeyboard-config 2.38. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 xsrc/external/mit/xkeyboard-config/dist/symbols/in cvs rdiff -u -r1.13 -r1.14 xsrc/external/mit/xkeyboard-config/dist/symbols/lk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: xsrc/external/mit/xkeyboard-config/dist/symbols
Module Name:xsrc Committed By: mrg Date: Thu Mar 23 06:22:44 UTC 2023 Modified Files: xsrc/external/mit/xkeyboard-config/dist/symbols: in lk Log Message: merge xkeyboard-config 2.38. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 xsrc/external/mit/xkeyboard-config/dist/symbols/in cvs rdiff -u -r1.13 -r1.14 xsrc/external/mit/xkeyboard-config/dist/symbols/lk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: xsrc/external/mit/xkeyboard-config/dist/symbols/in diff -u xsrc/external/mit/xkeyboard-config/dist/symbols/in:1.17 xsrc/external/mit/xkeyboard-config/dist/symbols/in:1.18 --- xsrc/external/mit/xkeyboard-config/dist/symbols/in:1.17 Mon Oct 17 07:38:17 2022 +++ xsrc/external/mit/xkeyboard-config/dist/symbols/in Thu Mar 23 06:22:44 2023 @@ -2066,6 +2066,79 @@ xkb_symbols "tel-kagapa" { include "level3(ralt_switch)" }; +// BEGIN Gujarati KaGaPa phonetic +// Name:KaGaPa phonetic +// Author: Sharad Gor +// Layout image at https://github.com/Docbroke/Gujarati_KaGaPa/blob/main/Guj_KaGaPa_layout.jpg + +partial alphanumeric_keys +xkb_symbols "guj-kagapa" { + name[Group1] = "Gujarati (KaGaPa, phonetic)"; + key.type[group1]="FOUR_LEVEL"; + +// NUMBER ROW +key { [ grave,asciitilde, U201C ] }; // U201C: “ left double quotation mark +key { [ 1,exclam, U0AE7 ] }; +key { [ 2,at, U0AE8, U0AF1 ] }; // U0AF1: Gujarati rupee sign (૱) +key { [ 3,numbersign, U0AE9 ] }; +key { [ 4,dollar, U0AEA, U20B9 ] }; // U20B9: new Indian rupee sign +key { [ 5,percent, U0AEB ] }; +key { [ 6,asciicircum, U0AEC, U200C ] }; // ZWNJ +key { [ 7,ampersand,U0AED, U200D ] }; // ZWJ +key { [ 8,asterisk, U0AEE, U0A81 ] }; // U0A81: canndrabindu (ઁ ) +key { [ 9,parenleft,U0AEF ] }; +key { [ 0,parenright, U0AE6, U0AF0 ] }; // U0AF0:(૰) abbreviation sign + +key { [ minus,underscore, U0952 ] }; // U0952: Devanagari stress sign anudatta(॒) +key { [ equal,plus ] }; + +//First row + +key { [ U0A9F, U0AA0 ] }; // Q: retroflex Ta ટ , Tha ઠ +key { [ U0AA1, U0AA2 ] }; // W: retroflex Da ડ , Dha ઢ +key { [ U0AC7, U0AC8, U0A8F, U0A90 ] }; // E: oે oૈ એ ઐ +key { [ U0AB0, U0AC3, U0A8B, U0AC4 ] }; // R: ર oૃ ઋ oૄ +key { [ U0AA4, U0AA5, U0A9F, U0AA0 ] }; // T: ત થ ટ ઠ +key { [ U0AAF ] }; // Y: ય +key { [ U0AC1, U0AC2, U0A89, U0A8A ] }; // U: oુ oૂ ઉ ઊ +key { [ U0ABF, U0AC0, U0A87, U0A88 ] }; // I: oિ oી ઇ ઈ +key { [ U0ACB, U0ACC, U0A93, U0A94 ] }; // O: oો oૌ ઓ ઔ +key { [ U0AAA, U0AAB ] }; // P: પ ફ +key { [ bracketleft, braceleft ] }; +key { [ bracketright, braceright ] }; +key { [ backslash,bar, U0964, U0965 ] }; // backslash, pipe, danda, double danda + +//Second row + +key { [ U0ABE,U0A86, U0A85,U0A8D ] }; // A: oા આ અ ઍ +key { [ U0AB8,U0AB6] }; // S: સ શ +key { [ U0AA6,U0AA7, U0AA1,U0AA2 ] }; // D: દ ધ ડ ઢ +key { [ U0ACD,U0AC4, U0AE0 ] }; // F: o્ oૄ ૠ +key { [ U0A97,U0A98] }; // G: ગ ઘ +key { [ U0AB9,U0A83] }; // H: હ (ઃ) + +key { [ U0A9C,U0A9D, U0A9E,U0AF9 ] }; // J: જ ઝ ઞ ૹ +key { [ U0A95,U0A96] }; // K: ક ખ +key { [ U0AB2,U0AB3, U0AE1,U0AE2 ] }; // L: લ ળ ૡ oૢ +key { [ semicolon,colon] }; // +key { [ apostrophe, quotedbl, U0951,U201D ] }; // U0951: o॑ Devanagari stress sign udatta + // U201D: ” Right double quotation mark +key { [ U0A9E,U0A99] }; // Z: nya ઞ, nga ઙ +key { [ U0AB7,U0ABC] }; // X: ssa ષ, nukta below o઼ +key { [ U0A9A,U0A9B] }; // C: ચ છ +key { [ U0AB5,U0ACC, U0A94 ] }; // V: વ oૌ ઔ +key { [ U0AAC,U0AAD] }; // B: બ ભ +key { [ U0AA8,U0AA3
CVS commit: src/external/mit/xorg/lib/xkeyboard-config
Module Name:src Committed By: mrg Date: Thu Mar 23 06:23:14 UTC 2023 Modified Files: src/external/mit/xorg/lib/xkeyboard-config: xkeyboard-config.man src/external/mit/xorg/lib/xkeyboard-config/rules: base base.lst evdev evdev.lst Log Message: updates for xkeyboard-config 2.38. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 \ src/external/mit/xorg/lib/xkeyboard-config/xkeyboard-config.man cvs rdiff -u -r1.18 -r1.19 \ src/external/mit/xorg/lib/xkeyboard-config/rules/base \ src/external/mit/xorg/lib/xkeyboard-config/rules/base.lst \ src/external/mit/xorg/lib/xkeyboard-config/rules/evdev.lst cvs rdiff -u -r1.17 -r1.18 \ src/external/mit/xorg/lib/xkeyboard-config/rules/evdev Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/mit/xorg/lib/xkeyboard-config
Module Name:src Committed By: mrg Date: Thu Mar 23 06:23:14 UTC 2023 Modified Files: src/external/mit/xorg/lib/xkeyboard-config: xkeyboard-config.man src/external/mit/xorg/lib/xkeyboard-config/rules: base base.lst evdev evdev.lst Log Message: updates for xkeyboard-config 2.38. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 \ src/external/mit/xorg/lib/xkeyboard-config/xkeyboard-config.man cvs rdiff -u -r1.18 -r1.19 \ src/external/mit/xorg/lib/xkeyboard-config/rules/base \ src/external/mit/xorg/lib/xkeyboard-config/rules/base.lst \ src/external/mit/xorg/lib/xkeyboard-config/rules/evdev.lst cvs rdiff -u -r1.17 -r1.18 \ src/external/mit/xorg/lib/xkeyboard-config/rules/evdev Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/mit/xorg/lib/xkeyboard-config/xkeyboard-config.man diff -u src/external/mit/xorg/lib/xkeyboard-config/xkeyboard-config.man:1.12 src/external/mit/xorg/lib/xkeyboard-config/xkeyboard-config.man:1.13 --- src/external/mit/xorg/lib/xkeyboard-config/xkeyboard-config.man:1.12 Fri Feb 10 13:22:58 2023 +++ src/external/mit/xorg/lib/xkeyboard-config/xkeyboard-config.man Thu Mar 23 06:23:13 2023 @@ -1,5 +1,5 @@ .\" WARNING: this man page is autogenerated. Do not edit or you will lose all your changes. -.TH XKEYBOARD-CONFIG 7 "xkeyboard-config 2.37" "X Version 11" +.TH XKEYBOARD-CONFIG 7 "xkeyboard-config 2.38" "X Version 11" .SH NAME xkeyboard-config \- XKB data description files .SH DESCRIPTION @@ -13,7 +13,7 @@ settings in the xorg.conf(5). .SH XKB DATA FILES LOAD PATHS xkeyboard-config provides the XKB data files installed in -@xkb_base@. User-specific data files may be elsewhere but it depends on +/usr/X11R7/share/X11/xkb. User-specific data files may be elsewhere but it depends on the tool whether those files are loaded. For example, the libxkbcommon library will by default load XKB data files from the user's home directory. See the libxkbcommon documentation for details. @@ -22,7 +22,7 @@ See the libxkbcommon documentation for d The "custom" layout is a layout that is listed as available to tools reading the data files but is not actually provided by xkeyboard-config. -A user may save a layout specification in the @xkb_base@/symbols/custom file +A user may save a layout specification in the /usr/X11R7/share/X11/xkb/symbols/custom file and that layout will be available to most tools interacting with the xkeyboard-config data files. This is primarily aimed at systems running X where additional lookup paths cannot easily be added. @@ -246,6 +246,7 @@ us(alt-intl) English (US, alt. intl.) us(colemak) English (Colemak) us(colemak_dh) English (Colemak-DH) us(colemak_dh_iso) English (Colemak-DH ISO) +us(colemak_dh_ortho) English (Colemak-DH Ortholinear) us(dvorak) English (Dvorak) us(dvorak-intl) English (Dvorak, intl., with dead keys) us(dvorak-alt-intl) English (Dvorak, alt. intl.) @@ -338,6 +339,7 @@ in(ben_gitanjali) Bangla (India, Gitanja in(ben_inscript) Bangla (India, Baishakhi InScript) in(eeyek) Manipuri (Eeyek) in(guj) Gujarati +in(guj-kagapa) Gujarati (KaGaPa, phonetic) in(guru) Punjabi (Gurmukhi) in(jhelum) Punjabi (Gurmukhi Jhelum) in(kan) Kannada @@ -684,7 +686,8 @@ lv Latvian lv(apostrophe) Latvian (apostrophe) lv(tilde) Latvian (tilde) lv(fkey) Latvian (F) -lv(modern) Latvian (modern) +lv(modern) Latvian (Modern Latin) +lv(modern-cyr) Latvian (Modern Cyrillic) lv(ergonomic) Latvian (ergonomic, ŪGJRMV) lv(adapted) Latvian (adapted) @@ -1135,6 +1138,7 @@ ctrl:aa_ctrl At the bottom left ctrl:rctrl_ralt Right Ctrl as Right Alt ctrl:menu_rctrl Menu as Right Ctrl ctrl:swap_lalt_lctl Swap Left Alt with Left Ctrl +ctrl:swap_ralt_rctl Swap Right Alt with Right Ctrl ctrl:swap_lwin_lctl Swap Left Win with Left Ctrl ctrl:swap_rwin_rctl Swap Right Win with Right Ctrl ctrl:swap_lalt_lctl_lwin Left Alt as Ctrl, Left Ctrl as Win, Left Win as Left Alt @@ -1317,6 +1321,8 @@ numpad:microsoft Num Lock on: digits; Sh numpad:shift3 Shift does not cancel Num Lock, chooses 3rd level instead srvrkeys:none Special keys (Ctrl+Alt+) handled in a server apple:alupckeys Apple Aluminium emulates Pause, PrtSc, Scroll Lock +apple:jp_oadg109a Japanese Apple keyboards emulate OADG109A backslash +apple:jp_pc106 Japanese Apple keyboards emulate PC106 backslash shift:breaks_caps Shift cancels Caps Lock misc:typo Enable extra typographic characters misc:apl Enable APL overlay characters @@ -1475,23 +1481,23 @@ terminate:ctrl_alt_bksp Ctrl+Alt+Backspa .SH FILES -@xkb_base@/compat +/usr/X11R7/share/X11/xkb/compat -@xkb_base@/compiled +/usr/X11R7/share/X11/xkb/compiled -@xkb_base@/geometry +/usr/X11R7/share/X11/xkb/geometry -@xkb_base@/keycodes +/usr/X11R7/share/X11/xkb/keycodes -@xkb_base@/keymap +/usr/X11R7/share/X11/xkb/keymap -@xkb_base@/rules +/usr/X11R7/share/X11/xkb/rules -@xkb
CVS commit: src/sys/dev
Module Name:src Committed By: mlelstv Date: Wed Mar 22 13:00:54 UTC 2023 Modified Files: src/sys/dev: ipmi.c Log Message: Ignore non-recoverable and critical limits smaller than the warning limits. These are usually invalid. Name the limit flags to make code more readable. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/dev/ipmi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev
Module Name:src Committed By: mlelstv Date: Wed Mar 22 13:00:54 UTC 2023 Modified Files: src/sys/dev: ipmi.c Log Message: Ignore non-recoverable and critical limits smaller than the warning limits. These are usually invalid. Name the limit flags to make code more readable. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/dev/ipmi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/ipmi.c diff -u src/sys/dev/ipmi.c:1.9 src/sys/dev/ipmi.c:1.10 --- src/sys/dev/ipmi.c:1.9 Tue Jun 15 00:20:33 2021 +++ src/sys/dev/ipmi.c Wed Mar 22 13:00:54 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: ipmi.c,v 1.9 2021/06/15 00:20:33 riastradh Exp $ */ +/* $NetBSD: ipmi.c,v 1.10 2023/03/22 13:00:54 mlelstv Exp $ */ /* * Copyright (c) 2019 Michael van Elst @@ -76,7 +76,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ipmi.c,v 1.9 2021/06/15 00:20:33 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ipmi.c,v 1.10 2023/03/22 13:00:54 mlelstv Exp $"); #include #include @@ -1533,6 +1533,14 @@ ipmi_get_limits(struct sysmon_envsys *sm return; } +/* valid bits for (upper,lower) x (non-recoverable, critical, warn) */ +#define UN 0x20 +#define UC 0x10 +#define UW 0x08 +#define LN 0x04 +#define LC 0x02 +#define LW 0x01 + static void ipmi_get_sensor_limits(struct ipmi_softc *sc, struct ipmi_sensor *psensor, sysmon_envsys_lim_t *limits, uint32_t *props) @@ -1540,7 +1548,7 @@ ipmi_get_sensor_limits(struct ipmi_softc struct sdrtype1 *s1 = (struct sdrtype1 *)psensor->i_sdr; bool failure; int rxlen; - uint8_t data[32]; + uint8_t data[32], valid; uint32_t prop_critmax, prop_warnmax, prop_critmin, prop_warnmin; int32_t *pcritmax, *pwarnmax, *pcritmin, *pwarnmin; @@ -1582,27 +1590,43 @@ ipmi_get_sensor_limits(struct ipmi_softc break; } - if (data[0] & 0x20 && data[6] != 0xff) { + valid = data[0]; + + /* if upper non-recoverable < warning, ignore it */ + if ((valid & (UN|UW)) == (UN|UW) && data[6] < data[4]) + valid ^= UN; + /* if upper critical < warning, ignore it */ + if ((valid & (UC|UW)) == (UC|UW) && data[5] < data[4]) + valid ^= UC; + + /* if lower non-recoverable > warning, ignore it */ + if ((data[0] & (LN|LW)) == (LN|LW) && data[3] > data[1]) + valid ^= LN; + /* if lower critical > warning, ignore it */ + if ((data[0] & (LC|LW)) == (LC|LW) && data[2] > data[1]) + valid ^= LC; + + if (valid & UN && data[6] != 0xff) { *pcritmax = ipmi_convert_sensor(&data[6], psensor); *props |= prop_critmax; } - if (data[0] & 0x10 && data[5] != 0xff) { + if (valid & UC && data[5] != 0xff) { *pcritmax = ipmi_convert_sensor(&data[5], psensor); *props |= prop_critmax; } - if (data[0] & 0x08 && data[4] != 0xff) { + if (valid & UW && data[4] != 0xff) { *pwarnmax = ipmi_convert_sensor(&data[4], psensor); *props |= prop_warnmax; } - if (data[0] & 0x04 && data[3] != 0x00) { + if (valid & LN && data[3] != 0x00) { *pcritmin = ipmi_convert_sensor(&data[3], psensor); *props |= prop_critmin; } - if (data[0] & 0x02 && data[2] != 0x00) { + if (valid & LC && data[2] != 0x00) { *pcritmin = ipmi_convert_sensor(&data[2], psensor); *props |= prop_critmin; } - if (data[0] & 0x01 && data[1] != 0x00) { + if (valid & LW && data[1] != 0x00) { *pwarnmin = ipmi_convert_sensor(&data[1], psensor); *props |= prop_warnmin; }
CVS commit: [netbsd-10] src
Module Name:src Committed By: martin Date: Wed Mar 22 19:00:47 UTC 2023 Modified Files: src/sys/arch/sparc/sparc [netbsd-10]: syscall.c vm_machdep.c src/tests/lib/libc/sys [netbsd-10]: t_ptrace_syscall_wait.h Log Message: Pull up following revision(s) (requested by hannken in ticket #124): tests/lib/libc/sys/t_ptrace_syscall_wait.h: revision 1.3 sys/arch/sparc/sparc/syscall.c: revision 1.32 sys/arch/sparc/sparc/vm_machdep.c: revision 1.108 Adjust pc/npc before syscall allowing EJUSTRETURN to return to the next instruction. Only ERESTART should return to the same instruction. Differences to sparc64 reduced. Test t_ptrace_wait:syscallemu1 now passes on sparc. Fixes PR kern/52166 "syscallemu does not work on sparc (32-bit)" Ok: Martin Husemann To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.31.30.1 src/sys/arch/sparc/sparc/syscall.c cvs rdiff -u -r1.107 -r1.107.70.1 src/sys/arch/sparc/sparc/vm_machdep.c cvs rdiff -u -r1.2 -r1.2.2.1 src/tests/lib/libc/sys/t_ptrace_syscall_wait.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-10] src
Module Name:src Committed By: martin Date: Wed Mar 22 19:00:47 UTC 2023 Modified Files: src/sys/arch/sparc/sparc [netbsd-10]: syscall.c vm_machdep.c src/tests/lib/libc/sys [netbsd-10]: t_ptrace_syscall_wait.h Log Message: Pull up following revision(s) (requested by hannken in ticket #124): tests/lib/libc/sys/t_ptrace_syscall_wait.h: revision 1.3 sys/arch/sparc/sparc/syscall.c: revision 1.32 sys/arch/sparc/sparc/vm_machdep.c: revision 1.108 Adjust pc/npc before syscall allowing EJUSTRETURN to return to the next instruction. Only ERESTART should return to the same instruction. Differences to sparc64 reduced. Test t_ptrace_wait:syscallemu1 now passes on sparc. Fixes PR kern/52166 "syscallemu does not work on sparc (32-bit)" Ok: Martin Husemann To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.31.30.1 src/sys/arch/sparc/sparc/syscall.c cvs rdiff -u -r1.107 -r1.107.70.1 src/sys/arch/sparc/sparc/vm_machdep.c cvs rdiff -u -r1.2 -r1.2.2.1 src/tests/lib/libc/sys/t_ptrace_syscall_wait.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/arch/sparc/sparc/syscall.c diff -u src/sys/arch/sparc/sparc/syscall.c:1.31 src/sys/arch/sparc/sparc/syscall.c:1.31.30.1 --- src/sys/arch/sparc/sparc/syscall.c:1.31 Sat Apr 6 11:54:20 2019 +++ src/sys/arch/sparc/sparc/syscall.c Wed Mar 22 19:00:47 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: syscall.c,v 1.31 2019/04/06 11:54:20 kamil Exp $ */ +/* $NetBSD: syscall.c,v 1.31.30.1 2023/03/22 19:00:47 martin Exp $ */ /* * Copyright (c) 1996 @@ -49,7 +49,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.31 2019/04/06 11:54:20 kamil Exp $"); +__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.31.30.1 2023/03/22 19:00:47 martin Exp $"); #include "opt_sparc_arch.h" #include "opt_multiprocessor.h" @@ -106,6 +106,17 @@ handle_new(struct trapframe *tf, registe { int new = *code & (SYSCALL_G7RFLAG|SYSCALL_G2RFLAG|SYSCALL_G5RFLAG); *code &= ~(SYSCALL_G7RFLAG|SYSCALL_G2RFLAG|SYSCALL_G5RFLAG); + if (new) { + /* jmp %g5, (or %g2 or %g7, deprecated) on success */ + if (__predict_true((new & SYSCALL_G5RFLAG) == SYSCALL_G5RFLAG)) + tf->tf_pc = tf->tf_global[5]; + else if (new & SYSCALL_G2RFLAG) + tf->tf_pc = tf->tf_global[2]; + else + tf->tf_pc = tf->tf_global[7]; + } else { + tf->tf_pc = tf->tf_npc; + } return new; } @@ -207,7 +218,7 @@ syscall(register_t code, struct trapfram int error, new; union args args; union rval rval; - register_t i; + int opc, onpc; u_quad_t sticks; curcpu()->ci_data.cpu_nsyscall++; /* XXXSMP */ @@ -221,8 +232,18 @@ syscall(register_t code, struct trapfram #ifdef FPU_DEBUG save_fpu(tf); #endif + + /* + * save pc/npc in case of ERESTART + * adjust pc/npc to new values + */ + opc = tf->tf_pc; + onpc = tf->tf_npc; + new = handle_new(tf, &code); + tf->tf_npc = tf->tf_pc + 4; + if ((error = getargs(p, tf, &code, &callp, &args)) != 0) goto bad; @@ -236,29 +257,17 @@ syscall(register_t code, struct trapfram /* Note: fork() does not return here in the child */ tf->tf_out[0] = rval.o[0]; tf->tf_out[1] = rval.o[1]; - if (new) { - /* jmp %g5, (or %g2 or %g7, deprecated) on success */ - if (__predict_true((new & SYSCALL_G5RFLAG) == - SYSCALL_G5RFLAG)) -i = tf->tf_global[5]; - else if (new & SYSCALL_G2RFLAG) -i = tf->tf_global[2]; - else -i = tf->tf_global[7]; - if (i & 3) { -error = EINVAL; -goto bad; - } - } else { + if (!new) { /* old system call convention: clear C on success */ tf->tf_psr &= ~PSR_C; /* success */ - i = tf->tf_npc; } - tf->tf_pc = i; - tf->tf_npc = i + 4; break; case ERESTART: + tf->tf_pc = opc; + tf->tf_npc = onpc; + break; + case EJUSTRETURN: /* nothing to do */ break; @@ -269,9 +278,8 @@ syscall(register_t code, struct trapfram error = p->p_emul->e_errno[error]; tf->tf_out[0] = error; tf->tf_psr |= PSR_C; /* fail */ - i = tf->tf_npc; - tf->tf_pc = i; - tf->tf_npc = i + 4; + tf->tf_pc = onpc; + tf->tf_npc = tf->tf_pc + 4; break; } Index: src/sys/arch/sparc/sparc/vm_machdep.c diff -u src/sys/arch/sparc/sparc/vm_machdep.c:1.107 src/sys/arch/sparc/sparc/vm_machdep.c:1.107.70.1 --- src/sys/arch/sparc/sparc/vm_machdep.c:1.107 Sun Feb 19 21:06:30 2012 +++ src/sys/arch/sparc/sparc/vm_machdep.c Wed Mar 22 19:00:47 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: vm_machdep.c,v 1.107 2012/02/19 21:06:30 rmind Exp $ */ +/* $NetBSD: vm_machdep.c,v 1.107.70.1 2023/03/22 19:00:47 martin Exp $ */ /* * Copyright (c) 1996 @@ -49,7 +49,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.107 2012/02/19 21:06:30 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.107.70.1 2023/03/22 19:00:47 martin Exp $"); #include "opt_multiprocessor.h" @@ -268,8 +268,6 @@ cpu_lwp_fork(struct lwp *l1, struct lwp * to user mode. */ /*tf2->tf_psr &=
CVS commit: [netbsd-10] src/doc
Module Name:src Committed By: martin Date: Wed Mar 22 19:01:57 UTC 2023 Modified Files: src/doc [netbsd-10]: CHANGES-10.0 Log Message: Tickets #123 and #124 To generate a diff of this commit: cvs rdiff -u -r1.1.2.46 -r1.1.2.47 src/doc/CHANGES-10.0 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-10] src/doc
Module Name:src Committed By: martin Date: Wed Mar 22 19:01:57 UTC 2023 Modified Files: src/doc [netbsd-10]: CHANGES-10.0 Log Message: Tickets #123 and #124 To generate a diff of this commit: cvs rdiff -u -r1.1.2.46 -r1.1.2.47 src/doc/CHANGES-10.0 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-10.0 diff -u src/doc/CHANGES-10.0:1.1.2.46 src/doc/CHANGES-10.0:1.1.2.47 --- src/doc/CHANGES-10.0:1.1.2.46 Mon Mar 20 17:25:14 2023 +++ src/doc/CHANGES-10.0 Wed Mar 22 19:01:56 2023 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-10.0,v 1.1.2.46 2023/03/20 17:25:14 martin Exp $ +# $NetBSD: CHANGES-10.0,v 1.1.2.47 2023/03/22 19:01:56 martin Exp $ A complete list of changes from the initial NetBSD 10.0 branch on 2022-12-16 until the 10.0 release: @@ -1498,3 +1498,16 @@ sys/external/bsd/drm2/radeon/radeon_pci. Fix bogus loop invariant assertions. [mrg, ticket #122] +external/gpl3/gcc.old(remove) + + Remove obsolete directory. + [mrg, ticket #123] + +sys/arch/sparc/sparc/syscall.c 1.32 +sys/arch/sparc/sparc/vm_machdep.c 1.108 +tests/lib/libc/sys/t_ptrace_syscall_wait.h 1.3 + + sparc: PR 52166: adjust pc/npc before syscall allowing + EJUSTRETURN to return to the next instruction. + [hannken, ticket #124] +
CVS commit: src/sys/dev
Module Name:src Committed By: hannken Date: Wed Mar 22 21:14:46 UTC 2023 Modified Files: src/sys/dev: fss.c Log Message: Pass B_PHYS when reading from device. Xbd(4) at least checks this flag and may trigger an assertion. To generate a diff of this commit: cvs rdiff -u -r1.113 -r1.114 src/sys/dev/fss.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev
Module Name:src Committed By: hannken Date: Wed Mar 22 21:14:46 UTC 2023 Modified Files: src/sys/dev: fss.c Log Message: Pass B_PHYS when reading from device. Xbd(4) at least checks this flag and may trigger an assertion. To generate a diff of this commit: cvs rdiff -u -r1.113 -r1.114 src/sys/dev/fss.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/fss.c diff -u src/sys/dev/fss.c:1.113 src/sys/dev/fss.c:1.114 --- src/sys/dev/fss.c:1.113 Sat Sep 24 23:18:54 2022 +++ src/sys/dev/fss.c Wed Mar 22 21:14:46 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: fss.c,v 1.113 2022/09/24 23:18:54 thorpej Exp $ */ +/* $NetBSD: fss.c,v 1.114 2023/03/22 21:14:46 hannken Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.113 2022/09/24 23:18:54 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.114 2023/03/22 21:14:46 hannken Exp $"); #include #include @@ -1285,7 +1285,7 @@ fss_bs_thread(void *arg) /* Not on backing store, read from device. */ nbp = getiobuf(NULL, true); - nbp->b_flags = B_READ; + nbp->b_flags = B_READ | (bp->b_flags & B_PHYS); nbp->b_resid = nbp->b_bcount = bp->b_bcount; nbp->b_bufsize = bp->b_bcount; nbp->b_data = bp->b_data;
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 01:23:18 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): remove unnecessary lock release if_percpuq_enqueue() can call with rxq->rxq_lock held because of per-cpu. To generate a diff of this commit: cvs rdiff -u -r1.82 -r1.83 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 01:23:18 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): remove unnecessary lock release if_percpuq_enqueue() can call with rxq->rxq_lock held because of per-cpu. To generate a diff of this commit: cvs rdiff -u -r1.82 -r1.83 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_vioif.c diff -u src/sys/dev/pci/if_vioif.c:1.82 src/sys/dev/pci/if_vioif.c:1.83 --- src/sys/dev/pci/if_vioif.c:1.82 Mon Sep 12 07:26:04 2022 +++ src/sys/dev/pci/if_vioif.c Thu Mar 23 01:23:18 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: if_vioif.c,v 1.82 2022/09/12 07:26:04 knakahara Exp $ */ +/* $NetBSD: if_vioif.c,v 1.83 2023/03/23 01:23:18 yamaguchi Exp $ */ /* * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.82 2022/09/12 07:26:04 knakahara Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.83 2023/03/23 01:23:18 yamaguchi Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -1642,12 +1642,7 @@ vioif_rx_deq_locked(struct vioif_softc * m_set_rcvif(m, ifp); m->m_len = m->m_pkthdr.len = len; - mutex_exit(rxq->rxq_lock); if_percpuq_enqueue(ifp->if_percpuq, m); - mutex_enter(rxq->rxq_lock); - - if (rxq->rxq_stopping) - break; } if (dequeued)
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 01:26:29 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): access to txq_active and rxq_active with lock held To generate a diff of this commit: cvs rdiff -u -r1.83 -r1.84 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 01:26:29 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): access to txq_active and rxq_active with lock held To generate a diff of this commit: cvs rdiff -u -r1.83 -r1.84 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_vioif.c diff -u src/sys/dev/pci/if_vioif.c:1.83 src/sys/dev/pci/if_vioif.c:1.84 --- src/sys/dev/pci/if_vioif.c:1.83 Thu Mar 23 01:23:18 2023 +++ src/sys/dev/pci/if_vioif.c Thu Mar 23 01:26:29 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: if_vioif.c,v 1.83 2023/03/23 01:23:18 yamaguchi Exp $ */ +/* $NetBSD: if_vioif.c,v 1.84 2023/03/23 01:26:29 yamaguchi Exp $ */ /* * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.83 2023/03/23 01:23:18 yamaguchi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.84 2023/03/23 01:26:29 yamaguchi Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -1662,6 +1662,7 @@ vioif_rx_handle_locked(void *xrxq, u_int struct vioif_softc *sc = device_private(virtio_child(vsc)); bool more; + KASSERT(mutex_owned(rxq->rxq_lock)); KASSERT(!rxq->rxq_stopping); more = vioif_rx_deq_locked(sc, vsc, rxq, limit); @@ -1674,7 +1675,8 @@ vioif_rx_handle_locked(void *xrxq, u_int vioif_rx_sched_handle(sc, rxq); return; } - atomic_store_relaxed(&rxq->rxq_active, false); + + rxq->rxq_active = false; } static int @@ -1686,22 +1688,23 @@ vioif_rx_intr(void *arg) struct vioif_softc *sc = device_private(virtio_child(vsc)); u_int limit; - limit = sc->sc_rx_intr_process_limit; - - if (atomic_load_relaxed(&rxq->rxq_active) == true) - return 1; mutex_enter(rxq->rxq_lock); - if (!rxq->rxq_stopping) { - rxq->rxq_workqueue = sc->sc_txrx_workqueue_sysctl; + /* rx handler is already running in softint/workqueue */ + if (rxq->rxq_active) + goto done; - virtio_stop_vq_intr(vsc, vq); - atomic_store_relaxed(&rxq->rxq_active, true); + if (rxq->rxq_stopping) + goto done; - vioif_rx_handle_locked(rxq, limit); - } + rxq->rxq_active = true; + limit = sc->sc_rx_intr_process_limit; + virtio_stop_vq_intr(vsc, vq); + vioif_rx_handle_locked(rxq, limit); + +done: mutex_exit(rxq->rxq_lock); return 1; } @@ -1773,6 +1776,7 @@ vioif_tx_handle_locked(struct vioif_txqu struct ifnet *ifp = &sc->sc_ethercom.ec_if; bool more; + KASSERT(mutex_owned(txq->txq_lock)); KASSERT(!txq->txq_stopping); more = vioif_tx_deq_locked(sc, vsc, txq, limit); @@ -1790,7 +1794,8 @@ vioif_tx_handle_locked(struct vioif_txqu return; } - atomic_store_relaxed(&txq->txq_active, false); + txq->txq_active = false; + /* for ALTQ */ if (txq == &sc->sc_txq[0]) { if_schedule_deferred_start(ifp); @@ -1811,22 +1816,23 @@ vioif_tx_intr(void *arg) limit = sc->sc_tx_intr_process_limit; - if (atomic_load_relaxed(&txq->txq_active) == true) - return 1; - mutex_enter(txq->txq_lock); - if (!txq->txq_stopping) { - txq->txq_workqueue = sc->sc_txrx_workqueue_sysctl; + /* tx handler is already running in softint/workqueue */ + if (txq->txq_active) + goto done; + + if (txq->txq_stopping) + goto done; - virtio_stop_vq_intr(vsc, vq); - atomic_store_relaxed(&txq->txq_active, true); + txq->txq_active = true; - vioif_tx_handle_locked(txq, limit); - } + virtio_stop_vq_intr(vsc, vq); + txq->txq_workqueue = sc->sc_txrx_workqueue_sysctl; + vioif_tx_handle_locked(txq, limit); +done: mutex_exit(txq->txq_lock); - return 1; }
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 01:30:26 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): use device reset to stop interrupt completely To generate a diff of this commit: cvs rdiff -u -r1.84 -r1.85 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 01:30:26 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): use device reset to stop interrupt completely To generate a diff of this commit: cvs rdiff -u -r1.84 -r1.85 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_vioif.c diff -u src/sys/dev/pci/if_vioif.c:1.84 src/sys/dev/pci/if_vioif.c:1.85 --- src/sys/dev/pci/if_vioif.c:1.84 Thu Mar 23 01:26:29 2023 +++ src/sys/dev/pci/if_vioif.c Thu Mar 23 01:30:26 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: if_vioif.c,v 1.84 2023/03/23 01:26:29 yamaguchi Exp $ */ +/* $NetBSD: if_vioif.c,v 1.85 2023/03/23 01:30:26 yamaguchi Exp $ */ /* * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.84 2023/03/23 01:26:29 yamaguchi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.85 2023/03/23 01:30:26 yamaguchi Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -51,6 +51,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v #include #include #include +#include #include #include @@ -420,6 +421,7 @@ static void vioif_disable_interrupt_vqpa static int vioif_setup_sysctl(struct vioif_softc *); static void vioif_setup_stats(struct vioif_softc *); static int vioif_ifflags(struct vioif_softc *); +static void vioif_intr_barrier(void); CFATTACH_DECL_NEW(vioif, sizeof(struct vioif_softc), vioif_match, vioif_attach, NULL, NULL); @@ -958,7 +960,8 @@ vioif_attach(device_t parent, device_t s nvqs++; rxq->rxq_vq->vq_intrhand = vioif_rx_intr; rxq->rxq_vq->vq_intrhand_arg = (void *)rxq; - rxq->rxq_stopping = true; + rxq->rxq_stopping = false; + rxq->rxq_active = false; vioif_work_set(&rxq->rxq_work, vioif_rx_handle, rxq); txq->txq_lock = mutex_obj_alloc(MUTEX_DEFAULT, IPL_NET); @@ -987,6 +990,7 @@ vioif_attach(device_t parent, device_t s txq->txq_vq->vq_intrhand_arg = (void *)txq; txq->txq_link_active = VIOIF_IS_LINK_ACTIVE(sc); txq->txq_stopping = false; + txq->txq_active = false; txq->txq_intrq = pcq_create(txq->txq_vq->vq_num, KM_SLEEP); vioif_work_set(&txq->txq_work, vioif_tx_handle, txq); } @@ -1183,9 +1187,7 @@ vioif_init(struct ifnet *ifp) for (i = 0; i < sc->sc_req_nvq_pairs; i++) { rxq = &sc->sc_rxq[i]; - /* Have to set false before vioif_populate_rx_mbufs */ mutex_enter(rxq->rxq_lock); - rxq->rxq_stopping = false; vioif_populate_rx_mbufs_locked(sc, rxq); mutex_exit(rxq->rxq_lock); @@ -1202,9 +1204,6 @@ vioif_init(struct ifnet *ifp) else sc->sc_act_nvq_pairs = 1; - for (i = 0; i < sc->sc_act_nvq_pairs; i++) - sc->sc_txq[i].txq_stopping = false; - vioif_enable_interrupt_vqpairs(sc); vioif_update_link_status(sc); @@ -1225,16 +1224,7 @@ vioif_stop(struct ifnet *ifp, int disabl struct vioif_ctrlqueue *ctrlq = &sc->sc_ctrlq; int i; - /* disable interrupts */ - vioif_disable_interrupt_vqpairs(sc); - if (sc->sc_has_ctrl) - virtio_stop_vq_intr(vsc, ctrlq->ctrlq_vq); - /* - * stop all packet processing: - * 1. stop interrupt handlers by rxq_stopping and txq_stopping - * 2. wait for stopping workqueue for packet processing - */ for (i = 0; i < sc->sc_act_nvq_pairs; i++) { txq = &sc->sc_txq[i]; rxq = &sc->sc_rxq[i]; @@ -1242,17 +1232,35 @@ vioif_stop(struct ifnet *ifp, int disabl mutex_enter(rxq->rxq_lock); rxq->rxq_stopping = true; mutex_exit(rxq->rxq_lock); - vioif_work_wait(sc->sc_txrx_workqueue, &rxq->rxq_work); mutex_enter(txq->txq_lock); txq->txq_stopping = true; mutex_exit(txq->txq_lock); - vioif_work_wait(sc->sc_txrx_workqueue, &txq->txq_work); } - /* only way to stop I/O and DMA is resetting... */ + /* disable interrupts */ + vioif_disable_interrupt_vqpairs(sc); + if (sc->sc_has_ctrl) + virtio_stop_vq_intr(vsc, ctrlq->ctrlq_vq); + + /* + * only way to stop interrupt, I/O and DMA is resetting... + * + * NOTE: Devices based on VirtIO draft specification can not + * stop interrupt completely even if virtio_stop_vq_intr() is called. + */ virtio_reset(vsc); + vioif_intr_barrier(); + + for (i = 0; i < sc->sc_act_nvq_pairs; i++) { + txq = &sc->sc_txq[i]; + rxq = &sc->sc_rxq[i]; + + vioif_work_wait(sc->sc_txrx_workqueue, &rxq->rxq_work); + vioif_work_wait(sc->sc_txrx_workqueue, &txq->txq_work); + } + for (i = 0; i < sc->sc_act_nvq_pairs; i++) { vioif_rx_queue_clear(&sc->sc_rxq[i]); vioif_tx_queue_clear(&sc->sc_txq[i]); @@ -1260,6 +1268,22 @@ vioif_stop(struct ifnet *ifp, int disabl ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + /* all packet processing is stopped */ + for (i = 0; i < sc->sc_act_nvq_pairs; i++) { + txq = &sc->sc_txq[i]; + rxq = &sc->sc_rxq[i]; + + mutex_enter(rxq->rxq_lock); + rxq->rxq_stopping = false; + KASSERT(!rxq->rxq_active); + mutex_exit(rxq->rxq_lock); + + mutex_enter(txq->txq_
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 01:33:21 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): rename {txq,rxq}_active to {txq,rxq}_running_handle To generate a diff of this commit: cvs rdiff -u -r1.85 -r1.86 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 01:33:21 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): rename {txq,rxq}_active to {txq,rxq}_running_handle To generate a diff of this commit: cvs rdiff -u -r1.85 -r1.86 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_vioif.c diff -u src/sys/dev/pci/if_vioif.c:1.85 src/sys/dev/pci/if_vioif.c:1.86 --- src/sys/dev/pci/if_vioif.c:1.85 Thu Mar 23 01:30:26 2023 +++ src/sys/dev/pci/if_vioif.c Thu Mar 23 01:33:20 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: if_vioif.c,v 1.85 2023/03/23 01:30:26 yamaguchi Exp $ */ +/* $NetBSD: if_vioif.c,v 1.86 2023/03/23 01:33:20 yamaguchi Exp $ */ /* * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.85 2023/03/23 01:30:26 yamaguchi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.86 2023/03/23 01:33:20 yamaguchi Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -247,7 +247,7 @@ struct vioif_txqueue { void *txq_handle_si; struct vioif_work txq_work; bool txq_workqueue; - bool txq_active; + bool txq_running_handle; char txq_evgroup[16]; struct evcnt txq_defrag_failed; @@ -270,7 +270,7 @@ struct vioif_rxqueue { void *rxq_handle_si; struct vioif_work rxq_work; bool rxq_workqueue; - bool rxq_active; + bool rxq_running_handle; char rxq_evgroup[16]; struct evcnt rxq_mbuf_add_failed; @@ -961,7 +961,7 @@ vioif_attach(device_t parent, device_t s rxq->rxq_vq->vq_intrhand = vioif_rx_intr; rxq->rxq_vq->vq_intrhand_arg = (void *)rxq; rxq->rxq_stopping = false; - rxq->rxq_active = false; + rxq->rxq_running_handle = false; vioif_work_set(&rxq->rxq_work, vioif_rx_handle, rxq); txq->txq_lock = mutex_obj_alloc(MUTEX_DEFAULT, IPL_NET); @@ -990,7 +990,7 @@ vioif_attach(device_t parent, device_t s txq->txq_vq->vq_intrhand_arg = (void *)txq; txq->txq_link_active = VIOIF_IS_LINK_ACTIVE(sc); txq->txq_stopping = false; - txq->txq_active = false; + txq->txq_running_handle = false; txq->txq_intrq = pcq_create(txq->txq_vq->vq_num, KM_SLEEP); vioif_work_set(&txq->txq_work, vioif_tx_handle, txq); } @@ -1275,12 +1275,12 @@ vioif_stop(struct ifnet *ifp, int disabl mutex_enter(rxq->rxq_lock); rxq->rxq_stopping = false; - KASSERT(!rxq->rxq_active); + KASSERT(!rxq->rxq_running_handle); mutex_exit(rxq->rxq_lock); mutex_enter(txq->txq_lock); txq->txq_stopping = false; - KASSERT(!txq->txq_active); + KASSERT(!txq->txq_running_handle); mutex_exit(txq->txq_lock); } @@ -1700,7 +1700,7 @@ vioif_rx_handle_locked(void *xrxq, u_int return; } - rxq->rxq_active = false; + rxq->rxq_running_handle = false; } static int @@ -1716,13 +1716,13 @@ vioif_rx_intr(void *arg) mutex_enter(rxq->rxq_lock); /* rx handler is already running in softint/workqueue */ - if (rxq->rxq_active) + if (rxq->rxq_running_handle) goto done; if (rxq->rxq_stopping) goto done; - rxq->rxq_active = true; + rxq->rxq_running_handle = true; limit = sc->sc_rx_intr_process_limit; virtio_stop_vq_intr(vsc, vq); @@ -1744,10 +1744,10 @@ vioif_rx_handle(void *xrxq) mutex_enter(rxq->rxq_lock); - KASSERT(rxq->rxq_active); + KASSERT(rxq->rxq_running_handle); if (rxq->rxq_stopping) { - rxq->rxq_active = false; + rxq->rxq_running_handle = false; goto done; } @@ -1824,7 +1824,7 @@ vioif_tx_handle_locked(struct vioif_txqu return; } - txq->txq_active = false; + txq->txq_running_handle = false; /* for ALTQ */ if (txq == &sc->sc_txq[0]) { @@ -1849,13 +1849,13 @@ vioif_tx_intr(void *arg) mutex_enter(txq->txq_lock); /* tx handler is already running in softint/workqueue */ - if (txq->txq_active) + if (txq->txq_running_handle) goto done; if (txq->txq_stopping) goto done; - txq->txq_active = true; + txq->txq_running_handle = true; virtio_stop_vq_intr(vsc, vq); txq->txq_workqueue = sc->sc_txrx_workqueue_sysctl; @@ -1877,10 +1877,10 @@ vioif_tx_handle(void *xtxq) mutex_enter(txq->txq_lock); - KASSERT(txq->txq_active); + KASSERT(txq->txq_running_handle); if (txq->txq_stopping) { - txq->txq_active = false; + txq->txq_running_handle = false; goto done; }
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 01:36:50 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): stop interrupt before schedule handler To generate a diff of this commit: cvs rdiff -u -r1.86 -r1.87 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 01:36:50 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): stop interrupt before schedule handler To generate a diff of this commit: cvs rdiff -u -r1.86 -r1.87 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_vioif.c diff -u src/sys/dev/pci/if_vioif.c:1.86 src/sys/dev/pci/if_vioif.c:1.87 --- src/sys/dev/pci/if_vioif.c:1.86 Thu Mar 23 01:33:20 2023 +++ src/sys/dev/pci/if_vioif.c Thu Mar 23 01:36:50 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: if_vioif.c,v 1.86 2023/03/23 01:33:20 yamaguchi Exp $ */ +/* $NetBSD: if_vioif.c,v 1.87 2023/03/23 01:36:50 yamaguchi Exp $ */ /* * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.86 2023/03/23 01:33:20 yamaguchi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.87 2023/03/23 01:36:50 yamaguchi Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -1685,6 +1685,7 @@ vioif_rx_handle_locked(void *xrxq, u_int struct virtio_softc *vsc = vq->vq_owner; struct vioif_softc *sc = device_private(virtio_child(vsc)); bool more; + int enqueued; KASSERT(mutex_owned(rxq->rxq_lock)); KASSERT(!rxq->rxq_stopping); @@ -1694,8 +1695,10 @@ vioif_rx_handle_locked(void *xrxq, u_int vioif_rx_sched_handle(sc, rxq); return; } - more = virtio_start_vq_intr(vsc, rxq->rxq_vq); - if (more) { + + enqueued = virtio_start_vq_intr(vsc, rxq->rxq_vq); + if (enqueued != 0) { + virtio_stop_vq_intr(vsc, rxq->rxq_vq); vioif_rx_sched_handle(sc, rxq); return; } @@ -1805,6 +1808,7 @@ vioif_tx_handle_locked(struct vioif_txqu struct vioif_softc *sc = device_private(virtio_child(vsc)); struct ifnet *ifp = &sc->sc_ethercom.ec_if; bool more; + int enqueued; KASSERT(mutex_owned(txq->txq_lock)); KASSERT(!txq->txq_stopping); @@ -1815,11 +1819,11 @@ vioif_tx_handle_locked(struct vioif_txqu return; } - if (virtio_features(vsc) & VIRTIO_F_RING_EVENT_IDX) - more = virtio_postpone_intr_smart(vsc, vq); - else - more = virtio_start_vq_intr(vsc, vq); - if (more) { + enqueued = (virtio_features(vsc) & VIRTIO_F_RING_EVENT_IDX) ? + virtio_postpone_intr_smart(vsc, vq): + virtio_start_vq_intr(vsc, vq); + if (enqueued != 0) { + virtio_stop_vq_intr(vsc, vq); vioif_tx_sched_handle(sc, txq); return; }
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 01:39:52 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): adjust receive buffer to ETHER_ALIGN To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 01:39:52 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): adjust receive buffer to ETHER_ALIGN To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_vioif.c diff -u src/sys/dev/pci/if_vioif.c:1.87 src/sys/dev/pci/if_vioif.c:1.88 --- src/sys/dev/pci/if_vioif.c:1.87 Thu Mar 23 01:36:50 2023 +++ src/sys/dev/pci/if_vioif.c Thu Mar 23 01:39:52 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: if_vioif.c,v 1.87 2023/03/23 01:36:50 yamaguchi Exp $ */ +/* $NetBSD: if_vioif.c,v 1.88 2023/03/23 01:39:52 yamaguchi Exp $ */ /* * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.87 2023/03/23 01:36:50 yamaguchi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.88 2023/03/23 01:39:52 yamaguchi Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -705,7 +705,7 @@ vioif_alloc_mems(struct vioif_softc *sc) goto err_reqs; r = vioif_dmamap_create(sc, &rxq->rxq_dmamaps[i], - MCLBYTES, 1, "rx payload"); + MCLBYTES - ETHER_ALIGN, 1, "rx payload"); if (r != 0) goto err_reqs; } @@ -1535,8 +1535,10 @@ vioif_add_rx_mbuf(struct vioif_rxqueue * m_freem(m); return ENOBUFS; } + m->m_len = m->m_pkthdr.len = MCLBYTES; + m_adj(m, ETHER_ALIGN); + rxq->rxq_mbufs[i] = m; - m->m_len = m->m_pkthdr.len = m->m_ext.ext_size; r = bus_dmamap_load_mbuf(virtio_dmat(vsc), rxq->rxq_dmamaps[i], m, BUS_DMA_READ | BUS_DMA_NOWAIT); if (r) { @@ -1595,7 +1597,7 @@ vioif_populate_rx_mbufs_locked(struct vi bus_dmamap_sync(virtio_dmat(vsc), rxq->rxq_hdr_dmamaps[slot], 0, sc->sc_hdr_size, BUS_DMASYNC_PREREAD); bus_dmamap_sync(virtio_dmat(vsc), rxq->rxq_dmamaps[slot], - 0, MCLBYTES, BUS_DMASYNC_PREREAD); + 0, rxq->rxq_dmamaps[slot]->dm_mapsize, BUS_DMASYNC_PREREAD); virtio_enqueue(vsc, vq, slot, rxq->rxq_hdr_dmamaps[slot], false); virtio_enqueue(vsc, vq, slot, rxq->rxq_dmamaps[slot], false); @@ -1657,7 +1659,7 @@ vioif_rx_deq_locked(struct vioif_softc * bus_dmamap_sync(virtio_dmat(vsc), rxq->rxq_hdr_dmamaps[slot], 0, sc->sc_hdr_size, BUS_DMASYNC_POSTREAD); bus_dmamap_sync(virtio_dmat(vsc), rxq->rxq_dmamaps[slot], - 0, MCLBYTES, BUS_DMASYNC_POSTREAD); + 0, rxq->rxq_dmamaps[slot]->dm_mapsize, BUS_DMASYNC_POSTREAD); m = rxq->rxq_mbufs[slot]; KASSERT(m != NULL); bus_dmamap_unload(virtio_dmat(vsc), rxq->rxq_dmamaps[slot]);
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 01:42:33 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): added event counters related to receive processing To generate a diff of this commit: cvs rdiff -u -r1.88 -r1.89 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 01:42:33 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): added event counters related to receive processing To generate a diff of this commit: cvs rdiff -u -r1.88 -r1.89 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_vioif.c diff -u src/sys/dev/pci/if_vioif.c:1.88 src/sys/dev/pci/if_vioif.c:1.89 --- src/sys/dev/pci/if_vioif.c:1.88 Thu Mar 23 01:39:52 2023 +++ src/sys/dev/pci/if_vioif.c Thu Mar 23 01:42:32 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: if_vioif.c,v 1.88 2023/03/23 01:39:52 yamaguchi Exp $ */ +/* $NetBSD: if_vioif.c,v 1.89 2023/03/23 01:42:32 yamaguchi Exp $ */ /* * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.88 2023/03/23 01:39:52 yamaguchi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.89 2023/03/23 01:42:32 yamaguchi Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -273,7 +273,9 @@ struct vioif_rxqueue { bool rxq_running_handle; char rxq_evgroup[16]; - struct evcnt rxq_mbuf_add_failed; + struct evcnt rxq_mbuf_enobufs; + struct evcnt rxq_mbuf_load_failed; + struct evcnt rxq_enqueue_reserve_failed; }; struct vioif_ctrlqueue { @@ -370,8 +372,6 @@ static void vioif_watchdog(struct ifnet static int vioif_ifflags_cb(struct ethercom *); /* rx */ -static int vioif_add_rx_mbuf(struct vioif_rxqueue *, int); -static void vioif_free_rx_mbuf(struct vioif_rxqueue *, int); static void vioif_populate_rx_mbufs_locked(struct vioif_softc *, struct vioif_rxqueue *); static void vioif_rx_queue_clear(struct vioif_rxqueue *); @@ -1519,54 +1519,13 @@ vioif_watchdog(struct ifnet *ifp) /* * Receive implementation */ -/* allocate and initialize a mbuf for receive */ -static int -vioif_add_rx_mbuf(struct vioif_rxqueue *rxq, int i) -{ - struct virtio_softc *vsc = rxq->rxq_vq->vq_owner; - struct mbuf *m; - int r; - - MGETHDR(m, M_DONTWAIT, MT_DATA); - if (m == NULL) - return ENOBUFS; - MCLGET(m, M_DONTWAIT); - if ((m->m_flags & M_EXT) == 0) { - m_freem(m); - return ENOBUFS; - } - m->m_len = m->m_pkthdr.len = MCLBYTES; - m_adj(m, ETHER_ALIGN); - - rxq->rxq_mbufs[i] = m; - r = bus_dmamap_load_mbuf(virtio_dmat(vsc), - rxq->rxq_dmamaps[i], m, BUS_DMA_READ | BUS_DMA_NOWAIT); - if (r) { - m_freem(m); - rxq->rxq_mbufs[i] = NULL; - return r; - } - - return 0; -} - -/* free a mbuf for receive */ -static void -vioif_free_rx_mbuf(struct vioif_rxqueue *rxq, int i) -{ - struct virtio_softc *vsc = rxq->rxq_vq->vq_owner; - - bus_dmamap_unload(virtio_dmat(vsc), rxq->rxq_dmamaps[i]); - m_freem(rxq->rxq_mbufs[i]); - rxq->rxq_mbufs[i] = NULL; -} - /* add mbufs for all the empty receive slots */ static void vioif_populate_rx_mbufs_locked(struct vioif_softc *sc, struct vioif_rxqueue *rxq) { struct virtqueue *vq = rxq->rxq_vq; struct virtio_softc *vsc = vq->vq_owner; + struct mbuf *m; int i, r, ndone = 0; KASSERT(mutex_owned(rxq->rxq_lock)); @@ -1581,19 +1540,46 @@ vioif_populate_rx_mbufs_locked(struct vi break; if (r != 0) panic("enqueue_prep for rx buffers"); - if (rxq->rxq_mbufs[slot] == NULL) { - r = vioif_add_rx_mbuf(rxq, slot); + + m = rxq->rxq_mbufs[slot]; + if (m == NULL) { + MGETHDR(m, M_DONTWAIT, MT_DATA); + if (m == NULL) { +rxq->rxq_mbuf_enobufs.ev_count++; +break; + } + MCLGET(m, M_DONTWAIT); + if ((m->m_flags & M_EXT) == 0) { +m_freem(m); +rxq->rxq_mbuf_enobufs.ev_count++; +break; + } + + m->m_len = m->m_pkthdr.len = MCLBYTES; + m_adj(m, ETHER_ALIGN); + + r = bus_dmamap_load_mbuf(virtio_dmat(vsc), + rxq->rxq_dmamaps[slot], m, BUS_DMA_READ | BUS_DMA_NOWAIT); + if (r != 0) { -rxq->rxq_mbuf_add_failed.ev_count++; +m_freem(m); +rxq->rxq_mbuf_load_failed.ev_count++; break; } + } else { + rxq->rxq_mbufs[slot] = NULL; } + r = virtio_enqueue_reserve(vsc, vq, slot, rxq->rxq_dmamaps[slot]->dm_nsegs + 1); if (r != 0) { - vioif_free_rx_mbuf(rxq, slot); + rxq->rxq_enqueue_reserve_failed.ev_count++; + bus_dmamap_unload(virtio_dmat(vsc), rxq->rxq_dmamaps[slot]); + m_freem(m); + /* slot already freed by virtio_enqueue_reserve */ break; } + rxq->rxq_mbufs[slot] = m; bus_dmamap_sync(virtio_dmat(vsc), rxq->rxq_hdr_dmamaps[slot], 0, sc->sc_hdr_size, BUS_DMASYNC_PREREAD); bus_dmamap_sync(virtio_dmat(vsc), rxq->rxq_dmamaps[slot], @@ -1783,12 +1769,17 @@ static void vioif_rx_drain(struct vioif_rxqueue *rxq) { struct virtqueue *vq = rxq->rxq_vq; + struct virtio_softc *vsc = vq->vq_owner; + struct mbuf *m; int i; for (i = 0; i < vq->vq_num; i++) { - if (rxq->rxq_mbufs[i] == NULL) + m = rxq->rxq_mbufs[i]; + if (m == NULL) continue; - vioif_free_rx_mbuf(rxq, i); + rxq->rxq_mbufs[i] = NULL; + bus_d
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 01:46:30 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): fix missing virtio_enqueue_abort for error handling To generate a diff of this commit: cvs rdiff -u -r1.89 -r1.90 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 01:46:30 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): fix missing virtio_enqueue_abort for error handling To generate a diff of this commit: cvs rdiff -u -r1.89 -r1.90 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_vioif.c diff -u src/sys/dev/pci/if_vioif.c:1.89 src/sys/dev/pci/if_vioif.c:1.90 --- src/sys/dev/pci/if_vioif.c:1.89 Thu Mar 23 01:42:32 2023 +++ src/sys/dev/pci/if_vioif.c Thu Mar 23 01:46:30 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: if_vioif.c,v 1.89 2023/03/23 01:42:32 yamaguchi Exp $ */ +/* $NetBSD: if_vioif.c,v 1.90 2023/03/23 01:46:30 yamaguchi Exp $ */ /* * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.89 2023/03/23 01:42:32 yamaguchi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.90 2023/03/23 01:46:30 yamaguchi Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -1545,11 +1545,13 @@ vioif_populate_rx_mbufs_locked(struct vi if (m == NULL) { MGETHDR(m, M_DONTWAIT, MT_DATA); if (m == NULL) { +virtio_enqueue_abort(vsc, vq, slot); rxq->rxq_mbuf_enobufs.ev_count++; break; } MCLGET(m, M_DONTWAIT); if ((m->m_flags & M_EXT) == 0) { +virtio_enqueue_abort(vsc, vq, slot); m_freem(m); rxq->rxq_mbuf_enobufs.ev_count++; break; @@ -1562,6 +1564,7 @@ vioif_populate_rx_mbufs_locked(struct vi rxq->rxq_dmamaps[slot], m, BUS_DMA_READ | BUS_DMA_NOWAIT); if (r != 0) { +virtio_enqueue_abort(vsc, vq, slot); m_freem(m); rxq->rxq_mbuf_load_failed.ev_count++; break;
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 01:52:42 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): drain receive buffer on stopping the device to remove branch in vioif_populate_rx_mbufs_locked() To generate a diff of this commit: cvs rdiff -u -r1.90 -r1.91 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 01:52:42 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): drain receive buffer on stopping the device to remove branch in vioif_populate_rx_mbufs_locked() To generate a diff of this commit: cvs rdiff -u -r1.90 -r1.91 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_vioif.c diff -u src/sys/dev/pci/if_vioif.c:1.90 src/sys/dev/pci/if_vioif.c:1.91 --- src/sys/dev/pci/if_vioif.c:1.90 Thu Mar 23 01:46:30 2023 +++ src/sys/dev/pci/if_vioif.c Thu Mar 23 01:52:42 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: if_vioif.c,v 1.90 2023/03/23 01:46:30 yamaguchi Exp $ */ +/* $NetBSD: if_vioif.c,v 1.91 2023/03/23 01:52:42 yamaguchi Exp $ */ /* * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.90 2023/03/23 01:46:30 yamaguchi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.91 2023/03/23 01:52:42 yamaguchi Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -1288,9 +1288,7 @@ vioif_stop(struct ifnet *ifp, int disabl txq = &sc->sc_txq[i]; rxq = &sc->sc_rxq[i]; - if (disable) - vioif_rx_drain(rxq); - + vioif_rx_drain(rxq); vioif_tx_drain(txq); } } @@ -1541,36 +1539,31 @@ vioif_populate_rx_mbufs_locked(struct vi if (r != 0) panic("enqueue_prep for rx buffers"); - m = rxq->rxq_mbufs[slot]; + MGETHDR(m, M_DONTWAIT, MT_DATA); if (m == NULL) { - MGETHDR(m, M_DONTWAIT, MT_DATA); - if (m == NULL) { -virtio_enqueue_abort(vsc, vq, slot); -rxq->rxq_mbuf_enobufs.ev_count++; -break; - } - MCLGET(m, M_DONTWAIT); - if ((m->m_flags & M_EXT) == 0) { -virtio_enqueue_abort(vsc, vq, slot); -m_freem(m); -rxq->rxq_mbuf_enobufs.ev_count++; -break; - } + virtio_enqueue_abort(vsc, vq, slot); + rxq->rxq_mbuf_enobufs.ev_count++; + break; + } + MCLGET(m, M_DONTWAIT); + if ((m->m_flags & M_EXT) == 0) { + virtio_enqueue_abort(vsc, vq, slot); + m_freem(m); + rxq->rxq_mbuf_enobufs.ev_count++; + break; + } - m->m_len = m->m_pkthdr.len = MCLBYTES; - m_adj(m, ETHER_ALIGN); + m->m_len = m->m_pkthdr.len = MCLBYTES; + m_adj(m, ETHER_ALIGN); - r = bus_dmamap_load_mbuf(virtio_dmat(vsc), - rxq->rxq_dmamaps[slot], m, BUS_DMA_READ | BUS_DMA_NOWAIT); + r = bus_dmamap_load_mbuf(virtio_dmat(vsc), + rxq->rxq_dmamaps[slot], m, BUS_DMA_READ | BUS_DMA_NOWAIT); - if (r != 0) { -virtio_enqueue_abort(vsc, vq, slot); -m_freem(m); -rxq->rxq_mbuf_load_failed.ev_count++; -break; - } - } else { - rxq->rxq_mbufs[slot] = NULL; + if (r != 0) { + virtio_enqueue_abort(vsc, vq, slot); + m_freem(m); + rxq->rxq_mbuf_load_failed.ev_count++; + break; } r = virtio_enqueue_reserve(vsc, vq, slot, @@ -1582,6 +1575,7 @@ vioif_populate_rx_mbufs_locked(struct vi /* slot already freed by virtio_enqueue_reserve */ break; } + KASSERT(rxq->rxq_mbufs[slot] == NULL); rxq->rxq_mbufs[slot] = m; bus_dmamap_sync(virtio_dmat(vsc), rxq->rxq_hdr_dmamaps[slot], 0, sc->sc_hdr_size, BUS_DMASYNC_PREREAD);
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 01:58:04 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): divide interrupt handler for receiving into dequeuing and preparing of buffers To generate a diff of this commit: cvs rdiff -u -r1.91 -r1.92 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 01:58:04 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): divide interrupt handler for receiving into dequeuing and preparing of buffers To generate a diff of this commit: cvs rdiff -u -r1.91 -r1.92 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_vioif.c diff -u src/sys/dev/pci/if_vioif.c:1.91 src/sys/dev/pci/if_vioif.c:1.92 --- src/sys/dev/pci/if_vioif.c:1.91 Thu Mar 23 01:52:42 2023 +++ src/sys/dev/pci/if_vioif.c Thu Mar 23 01:58:04 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: if_vioif.c,v 1.91 2023/03/23 01:52:42 yamaguchi Exp $ */ +/* $NetBSD: if_vioif.c,v 1.92 2023/03/23 01:58:04 yamaguchi Exp $ */ /* * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.91 2023/03/23 01:52:42 yamaguchi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.92 2023/03/23 01:58:04 yamaguchi Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -376,7 +376,7 @@ static void vioif_populate_rx_mbufs_lock struct vioif_rxqueue *); static void vioif_rx_queue_clear(struct vioif_rxqueue *); static bool vioif_rx_deq_locked(struct vioif_softc *, struct virtio_softc *, - struct vioif_rxqueue *, u_int); + struct vioif_rxqueue *, u_int, size_t *); static int vioif_rx_intr(void *); static void vioif_rx_handle(void *); static void vioif_rx_sched_handle(struct vioif_softc *, @@ -1528,9 +1528,6 @@ vioif_populate_rx_mbufs_locked(struct vi KASSERT(mutex_owned(rxq->rxq_lock)); - if (rxq->rxq_stopping) - return; - for (i = 0; i < vq->vq_num; i++) { int slot; r = virtio_enqueue_prep(vsc, vq, &slot); @@ -1600,11 +1597,9 @@ vioif_rx_queue_clear(struct vioif_rxqueu u_int limit = UINT_MAX; bool more; - KASSERT(rxq->rxq_stopping); - mutex_enter(rxq->rxq_lock); for (;;) { - more = vioif_rx_deq_locked(sc, vsc, rxq, limit); + more = vioif_rx_deq_locked(sc, vsc, rxq, limit, NULL); if (more == false) break; } @@ -1614,21 +1609,25 @@ vioif_rx_queue_clear(struct vioif_rxqueu /* dequeue received packets */ static bool vioif_rx_deq_locked(struct vioif_softc *sc, struct virtio_softc *vsc, -struct vioif_rxqueue *rxq, u_int limit) +struct vioif_rxqueue *rxq, u_int limit, size_t *ndeqp) { struct virtqueue *vq = rxq->rxq_vq; struct ifnet *ifp = &sc->sc_ethercom.ec_if; struct mbuf *m; int slot, len; - bool more = false, dequeued = false; + bool more; + size_t ndeq; KASSERT(mutex_owned(rxq->rxq_lock)); + more = false; + ndeq = 0; + if (virtio_vq_is_enqueued(vsc, vq) == false) - return false; + goto done; - for (;;) { - if (limit-- == 0) { + for (;;ndeq++) { + if (ndeq >= limit) { more = true; break; } @@ -1636,8 +1635,6 @@ vioif_rx_deq_locked(struct vioif_softc * if (virtio_dequeue(vsc, vq, &slot, &len) != 0) break; - dequeued = true; - len -= sc->sc_hdr_size; bus_dmamap_sync(virtio_dmat(vsc), rxq->rxq_hdr_dmamaps[slot], 0, sc->sc_hdr_size, BUS_DMASYNC_POSTREAD); @@ -1654,8 +1651,10 @@ vioif_rx_deq_locked(struct vioif_softc * if_percpuq_enqueue(ifp->if_percpuq, m); } - if (dequeued) - vioif_populate_rx_mbufs_locked(sc, rxq); + +done: + if (ndeqp != NULL) + *ndeqp = ndeq; return more; } @@ -1671,11 +1670,15 @@ vioif_rx_handle_locked(void *xrxq, u_int struct vioif_softc *sc = device_private(virtio_child(vsc)); bool more; int enqueued; + size_t ndeq; KASSERT(mutex_owned(rxq->rxq_lock)); KASSERT(!rxq->rxq_stopping); - more = vioif_rx_deq_locked(sc, vsc, rxq, limit); + more = vioif_rx_deq_locked(sc, vsc, rxq, limit, &ndeq); + if (ndeq > 0) + vioif_populate_rx_mbufs_locked(sc, rxq); + if (more) { vioif_rx_sched_handle(sc, rxq); return;
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 02:03:01 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): merge drain into clear of queue To generate a diff of this commit: cvs rdiff -u -r1.92 -r1.93 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 02:03:01 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): merge drain into clear of queue To generate a diff of this commit: cvs rdiff -u -r1.92 -r1.93 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_vioif.c diff -u src/sys/dev/pci/if_vioif.c:1.92 src/sys/dev/pci/if_vioif.c:1.93 --- src/sys/dev/pci/if_vioif.c:1.92 Thu Mar 23 01:58:04 2023 +++ src/sys/dev/pci/if_vioif.c Thu Mar 23 02:03:01 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: if_vioif.c,v 1.92 2023/03/23 01:58:04 yamaguchi Exp $ */ +/* $NetBSD: if_vioif.c,v 1.93 2023/03/23 02:03:01 yamaguchi Exp $ */ /* * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.92 2023/03/23 01:58:04 yamaguchi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.93 2023/03/23 02:03:01 yamaguchi Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -374,24 +374,24 @@ static int vioif_ifflags_cb(struct ether /* rx */ static void vioif_populate_rx_mbufs_locked(struct vioif_softc *, struct vioif_rxqueue *); -static void vioif_rx_queue_clear(struct vioif_rxqueue *); +static void vioif_rx_queue_clear(struct vioif_softc *, struct virtio_softc *, + struct vioif_rxqueue *); static bool vioif_rx_deq_locked(struct vioif_softc *, struct virtio_softc *, struct vioif_rxqueue *, u_int, size_t *); static int vioif_rx_intr(void *); static void vioif_rx_handle(void *); static void vioif_rx_sched_handle(struct vioif_softc *, struct vioif_rxqueue *); -static void vioif_rx_drain(struct vioif_rxqueue *); /* tx */ static int vioif_tx_intr(void *); static void vioif_tx_handle(void *); static void vioif_tx_sched_handle(struct vioif_softc *, struct vioif_txqueue *); -static void vioif_tx_queue_clear(struct vioif_txqueue *); +static void vioif_tx_queue_clear(struct vioif_softc *, struct virtio_softc *, + struct vioif_txqueue *); static bool vioif_tx_deq_locked(struct vioif_softc *, struct virtio_softc *, struct vioif_txqueue *, u_int); -static void vioif_tx_drain(struct vioif_txqueue *); static void vioif_deferred_transmit(void *); /* workqueue */ @@ -1262,8 +1262,8 @@ vioif_stop(struct ifnet *ifp, int disabl } for (i = 0; i < sc->sc_act_nvq_pairs; i++) { - vioif_rx_queue_clear(&sc->sc_rxq[i]); - vioif_tx_queue_clear(&sc->sc_txq[i]); + vioif_rx_queue_clear(sc, vsc, &sc->sc_rxq[i]); + vioif_tx_queue_clear(sc, vsc, &sc->sc_txq[i]); } ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); @@ -1283,14 +1283,6 @@ vioif_stop(struct ifnet *ifp, int disabl KASSERT(!txq->txq_running_handle); mutex_exit(txq->txq_lock); } - - for (i = 0; i < sc->sc_act_nvq_pairs; i++) { - txq = &sc->sc_txq[i]; - rxq = &sc->sc_rxq[i]; - - vioif_rx_drain(rxq); - vioif_tx_drain(txq); - } } static void @@ -1505,11 +1497,19 @@ void vioif_watchdog(struct ifnet *ifp) { struct vioif_softc *sc = ifp->if_softc; + struct vioif_txqueue *txq; int i; if (ifp->if_flags & IFF_RUNNING) { for (i = 0; i < sc->sc_act_nvq_pairs; i++) { - vioif_tx_queue_clear(&sc->sc_txq[i]); + txq = &sc->sc_txq[i]; + + mutex_enter(txq->txq_lock); + if (!txq->txq_running_handle) { +txq->txq_running_handle = true; +vioif_tx_sched_handle(sc, txq); + } + mutex_exit(txq->txq_lock); } } } @@ -1589,20 +1589,31 @@ vioif_populate_rx_mbufs_locked(struct vi } static void -vioif_rx_queue_clear(struct vioif_rxqueue *rxq) +vioif_rx_queue_clear(struct vioif_softc *sc, struct virtio_softc *vsc, +struct vioif_rxqueue *rxq) { - struct virtqueue *vq = rxq->rxq_vq; - struct virtio_softc *vsc = vq->vq_owner; - struct vioif_softc *sc = device_private(virtio_child(vsc)); - u_int limit = UINT_MAX; + struct mbuf *m; + unsigned int i, vq_num; bool more; mutex_enter(rxq->rxq_lock); + vq_num = rxq->rxq_vq->vq_num; + for (;;) { - more = vioif_rx_deq_locked(sc, vsc, rxq, limit, NULL); + more = vioif_rx_deq_locked(sc, vsc, rxq, vq_num, NULL); if (more == false) break; } + + for (i = 0; i < vq_num; i++) { + m = rxq->rxq_mbufs[i]; + if (m == NULL) + continue; + rxq->rxq_mbufs[i] = NULL; + + bus_dmamap_unload(virtio_dmat(vsc), rxq->rxq_dmamaps[i]); + m_freem(m); + } mutex_exit(rxq->rxq_lock); } @@ -1764,25 +1775,6 @@ vioif_rx_sched_handle(struct vioif_softc softint_schedule(rxq->rxq_handle_si); } -/* free all the mbufs; called from if_stop(disable) */ -static void -vioif_rx_drain(struct vioif_rxqueue *rxq) -{ - struct virtqueue *vq = rxq->rxq_vq; - struct virtio_softc *vsc = vq->vq_owner; - struct mbuf *m; - int i; - - for (i = 0; i < vq->vq_num; i++) { - m = rxq->rxq_mbufs[i]; - if (m == NULL) - continue; - rxq->rxq_mbufs[i] = NULL; - bus_dmamap_unload(virtio_dmat(vsc), rxq->rxq_dmamaps[i]); - m_freem
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 02:15:53 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): increase output error counter To generate a diff of this commit: cvs rdiff -u -r1.93 -r1.94 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 02:15:53 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): increase output error counter To generate a diff of this commit: cvs rdiff -u -r1.93 -r1.94 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_vioif.c diff -u src/sys/dev/pci/if_vioif.c:1.93 src/sys/dev/pci/if_vioif.c:1.94 --- src/sys/dev/pci/if_vioif.c:1.93 Thu Mar 23 02:03:01 2023 +++ src/sys/dev/pci/if_vioif.c Thu Mar 23 02:15:53 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: if_vioif.c,v 1.93 2023/03/23 02:03:01 yamaguchi Exp $ */ +/* $NetBSD: if_vioif.c,v 1.94 2023/03/23 02:15:53 yamaguchi Exp $ */ /* * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.93 2023/03/23 02:03:01 yamaguchi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.94 2023/03/23 02:15:53 yamaguchi Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -1322,6 +1322,7 @@ vioif_send_common_locked(struct ifnet *i if (r == EAGAIN) { ifp->if_flags |= IFF_OACTIVE; m_freem(m); + if_statinc(ifp, if_oerrors); break; } if (r != 0) @@ -1347,6 +1348,7 @@ vioif_send_common_locked(struct ifnet *i txq->txq_mbuf_load_failed.ev_count++; skip: m_freem(m); +if_statinc(ifp, if_oerrors); virtio_enqueue_abort(vsc, vq, slot); continue; } @@ -1361,6 +1363,7 @@ skip: txq->txq_dmamaps[slot]); /* slot already freed by virtio_enqueue_reserve */ m_freem(m); + if_statinc(ifp, if_oerrors); continue; }
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 02:26:43 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): added a structure to manage variables for packet processings To generate a diff of this commit: cvs rdiff -u -r1.94 -r1.95 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 02:26:43 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): added a structure to manage variables for packet processings To generate a diff of this commit: cvs rdiff -u -r1.94 -r1.95 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_vioif.c diff -u src/sys/dev/pci/if_vioif.c:1.94 src/sys/dev/pci/if_vioif.c:1.95 --- src/sys/dev/pci/if_vioif.c:1.94 Thu Mar 23 02:15:53 2023 +++ src/sys/dev/pci/if_vioif.c Thu Mar 23 02:26:43 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: if_vioif.c,v 1.94 2023/03/23 02:15:53 yamaguchi Exp $ */ +/* $NetBSD: if_vioif.c,v 1.95 2023/03/23 02:26:43 yamaguchi Exp $ */ /* * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.94 2023/03/23 02:15:53 yamaguchi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.95 2023/03/23 02:26:43 yamaguchi Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -229,6 +229,13 @@ struct vioif_work { unsigned int added; }; +struct vioif_net_map { + struct virtio_net_hdr *vnm_hdr; + bus_dmamap_t vnm_hdr_map; + struct mbuf *vnm_mbuf; + bus_dmamap_t vnm_mbuf_map; +}; + struct vioif_txqueue { kmutex_t *txq_lock; /* lock for tx operations */ @@ -237,11 +244,8 @@ struct vioif_txqueue { bool txq_link_active; pcq_t *txq_intrq; - struct virtio_net_hdr *txq_hdrs; - bus_dmamap_t *txq_hdr_dmamaps; - - struct mbuf **txq_mbufs; - bus_dmamap_t *txq_dmamaps; + void *txq_maps_kva; + struct vioif_net_map *txq_maps; void *txq_deferred_transmit; void *txq_handle_si; @@ -261,11 +265,8 @@ struct vioif_rxqueue { struct virtqueue *rxq_vq; bool rxq_stopping; - struct virtio_net_hdr *rxq_hdrs; - bus_dmamap_t *rxq_hdr_dmamaps; - - struct mbuf **rxq_mbufs; - bus_dmamap_t *rxq_dmamaps; + void *rxq_maps_kva; + struct vioif_net_map *rxq_maps; void *rxq_handle_si; struct vioif_work rxq_work; @@ -552,8 +553,8 @@ vioif_free_queues(struct vioif_softc *sc /* allocate memory */ /* * dma memory is used for: - * rxq_hdrs[slot]: metadata array for received frames (READ) - * txq_hdrs[slot]: metadata array for frames to be sent (WRITE) + * rxq_maps_kva: metadata array for received frames (READ) + * txq_maps_kva: metadata array for frames to be sent (WRITE) * ctrlq_cmd: command to be sent via ctrl vq (WRITE) * ctrlq_status: return value for a command via ctrl vq (READ) * ctrlq_rx: parameter for a VIRTIO_NET_CTRL_RX class command @@ -565,21 +566,13 @@ vioif_free_queues(struct vioif_softc *sc * ctrlq_* structures are allocated only one each; they are protected by * ctrlq_inuse variable and ctrlq_wait condvar. */ -/* - * dynamically allocated memory is used for: - * rxq_hdr_dmamaps[slot]: bus_dmamap_t array for sc_rx_hdrs[slot] - * txq_hdr_dmamaps[slot]: bus_dmamap_t array for sc_tx_hdrs[slot] - * rxq_dmamaps[slot]: bus_dmamap_t array for received payload - * txq_dmamaps[slot]: bus_dmamap_t array for sent payload - * rxq_mbufs[slot]: mbuf pointer array for received frames - * txq_mbufs[slot]: mbuf pointer array for sent frames - */ static int vioif_alloc_mems(struct vioif_softc *sc) { struct virtio_softc *vsc = sc->sc_virtio; struct vioif_txqueue *txq; struct vioif_rxqueue *rxq; + struct vioif_net_map *maps; struct vioif_ctrlqueue *ctrlq = &sc->sc_ctrlq; int allocsize, allocsize2, r, rsegs, i, qid; void *vaddr; @@ -628,9 +621,9 @@ vioif_alloc_mems(struct vioif_softc *sc) rxq = &sc->sc_rxq[qid]; txq = &sc->sc_txq[qid]; - rxq->rxq_hdrs = vioif_assign_mem(&p, + rxq->rxq_maps_kva = vioif_assign_mem(&p, sizeof(struct virtio_net_hdr) * rxq->rxq_vq->vq_num); - txq->txq_hdrs = vioif_assign_mem(&p, + txq->txq_maps_kva = vioif_assign_mem(&p, sizeof(struct virtio_net_hdr) * txq->txq_vq->vq_num); } if (sc->sc_has_ctrl) { @@ -657,16 +650,12 @@ vioif_alloc_mems(struct vioif_softc *sc) rxq = &sc->sc_rxq[qid]; txq = &sc->sc_txq[qid]; + rxqsize = rxq->rxq_vq->vq_num; txqsize = txq->txq_vq->vq_num; - allocsize2 += sizeof(rxq->rxq_dmamaps[0]) * rxqsize; - allocsize2 += sizeof(rxq->rxq_hdr_dmamaps[0]) * rxqsize; - allocsize2 += sizeof(rxq->rxq_mbufs[0]) * rxqsize; - - allocsize2 += sizeof(txq->txq_dmamaps[0]) * txqsize; - allocsize2 += sizeof(txq->txq_hdr_dmamaps[0]) * txqsize; - allocsize2 += sizeof(txq->txq_mbufs[0]) * txqsize; + allocsize2 += sizeof(rxq->rxq_maps[0]) * rxqsize; + allocsize2 += sizeof(txq->txq_maps[0]) * txqsize; } vaddr = kmem_zalloc(allocsize2, KM_SLEEP); sc->sc_kmem = vaddr; @@ -679,46 +668,48 @@ vioif_alloc_mems(struct vioif_softc *sc) rxqsize = rxq->rxq_vq->vq_num; txqsize = txq->txq_vq->vq_num; - rxq->rxq_hdr_dmamaps = vioif_assign_mem(&p, - sizeof(rxq->rxq_hdr_dmamaps[0]) *
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 02:30:14 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): prepare slot before dequeuing To generate a diff of this commit: cvs rdiff -u -r1.95 -r1.96 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 02:30:14 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): prepare slot before dequeuing To generate a diff of this commit: cvs rdiff -u -r1.95 -r1.96 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_vioif.c diff -u src/sys/dev/pci/if_vioif.c:1.95 src/sys/dev/pci/if_vioif.c:1.96 --- src/sys/dev/pci/if_vioif.c:1.95 Thu Mar 23 02:26:43 2023 +++ src/sys/dev/pci/if_vioif.c Thu Mar 23 02:30:14 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: if_vioif.c,v 1.95 2023/03/23 02:26:43 yamaguchi Exp $ */ +/* $NetBSD: if_vioif.c,v 1.96 2023/03/23 02:30:14 yamaguchi Exp $ */ /* * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.95 2023/03/23 02:26:43 yamaguchi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.96 2023/03/23 02:30:14 yamaguchi Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -1307,24 +1307,21 @@ vioif_send_common_locked(struct ifnet *i for (;;) { int slot, r; + r = virtio_enqueue_prep(vsc, vq, &slot); + if (r == EAGAIN) + break; + if (__predict_false(r != 0)) + panic("enqueue_prep for tx buffers"); if (is_transmit) m = pcq_get(txq->txq_intrq); else IFQ_DEQUEUE(&ifp->if_snd, m); - if (m == NULL) - break; - - r = virtio_enqueue_prep(vsc, vq, &slot); - if (r == EAGAIN) { - ifp->if_flags |= IFF_OACTIVE; - m_freem(m); - if_statinc(ifp, if_oerrors); + if (m == NULL) { + virtio_enqueue_abort(vsc, vq, slot); break; } - if (r != 0) - panic("enqueue_prep for a tx buffer"); map = &txq->txq_maps[slot]; KASSERT(map->vnm_mbuf == NULL);
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 02:33:34 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): added __predct_false to error check To generate a diff of this commit: cvs rdiff -u -r1.96 -r1.97 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 02:33:34 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): added __predct_false to error check To generate a diff of this commit: cvs rdiff -u -r1.96 -r1.97 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_vioif.c diff -u src/sys/dev/pci/if_vioif.c:1.96 src/sys/dev/pci/if_vioif.c:1.97 --- src/sys/dev/pci/if_vioif.c:1.96 Thu Mar 23 02:30:14 2023 +++ src/sys/dev/pci/if_vioif.c Thu Mar 23 02:33:34 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: if_vioif.c,v 1.96 2023/03/23 02:30:14 yamaguchi Exp $ */ +/* $NetBSD: if_vioif.c,v 1.97 2023/03/23 02:33:34 yamaguchi Exp $ */ /* * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.96 2023/03/23 02:30:14 yamaguchi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.97 2023/03/23 02:33:34 yamaguchi Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -1532,7 +1532,7 @@ vioif_populate_rx_mbufs_locked(struct vi r = virtio_enqueue_prep(vsc, vq, &slot); if (r == EAGAIN) break; - if (r != 0) + if (__predict_false(r != 0)) panic("enqueue_prep for rx buffers"); map = &rxq->rxq_maps[slot];
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 02:42:49 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): added new data structure for network queues and moved the same parameters in vioif_txqueue and vioif_rxqueue into the new structure To generate a diff of this commit: cvs rdiff -u -r1.97 -r1.98 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 02:42:49 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): added new data structure for network queues and moved the same parameters in vioif_txqueue and vioif_rxqueue into the new structure To generate a diff of this commit: cvs rdiff -u -r1.97 -r1.98 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_vioif.c diff -u src/sys/dev/pci/if_vioif.c:1.97 src/sys/dev/pci/if_vioif.c:1.98 --- src/sys/dev/pci/if_vioif.c:1.97 Thu Mar 23 02:33:34 2023 +++ src/sys/dev/pci/if_vioif.c Thu Mar 23 02:42:49 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: if_vioif.c,v 1.97 2023/03/23 02:33:34 yamaguchi Exp $ */ +/* $NetBSD: if_vioif.c,v 1.98 2023/03/23 02:42:49 yamaguchi Exp $ */ /* * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.97 2023/03/23 02:33:34 yamaguchi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.98 2023/03/23 02:42:49 yamaguchi Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -205,12 +205,13 @@ struct virtio_net_ctrl_mq { /* * Locking notes: - * + a field in vioif_txqueue is protected by txq_lock (a spin mutex), and - * a field in vioif_rxqueue is protected by rxq_lock (a spin mutex). + * + a field in vioif_netueue is protected by netq_lock (a spin mutex) * - more than one lock cannot be held at onece + * + a field in vioif_tx_context and vioif_rx_context is also protected + * by netq_lock. * + ctrlq_inuse is protected by ctrlq_wait_lock. * - other fields in vioif_ctrlqueue are protected by ctrlq_inuse - * - txq_lock or rxq_lock cannot be held along with ctrlq_wait_lock + * - netq_lock cannot be held along with ctrlq_wait_lock * + fields in vioif_softc except queues are protected by * sc->sc_lock(an adaptive mutex) * - the lock is held before acquisition of other locks @@ -236,49 +237,44 @@ struct vioif_net_map { bus_dmamap_t vnm_mbuf_map; }; -struct vioif_txqueue { - kmutex_t *txq_lock; /* lock for tx operations */ +#define VIOIF_NETQ_RX 0 +#define VIOIF_NETQ_TX 1 +#define VIOIF_NETQ_IDX 2 +#define VIOIF_NETQ_DIR(n) ((n) % VIOIF_NETQ_IDX) +#define VIOIF_NETQ_PAIRIDX(n) ((n) / VIOIF_NETQ_IDX) +#define VIOIF_NETQ_RXQID(n) ((n) * VIOIF_NETQ_IDX + VIOIF_NETQ_RX) +#define VIOIF_NETQ_TXQID(n) ((n) * VIOIF_NETQ_IDX + VIOIF_NETQ_TX) + +struct vioif_netqueue { + kmutex_t netq_lock; + struct virtqueue *netq_vq; + bool netq_stopping; + bool netq_running_handle; + void *netq_maps_kva; + struct vioif_net_map *netq_maps; + + void *netq_softint; + struct vioif_work netq_work; + bool netq_workqueue; + + char netq_evgroup[32]; + struct evcnt netq_mbuf_load_failed; + struct evcnt netq_enqueue_reserve_failed; - struct virtqueue *txq_vq; - bool txq_stopping; - bool txq_link_active; - pcq_t *txq_intrq; - - void *txq_maps_kva; - struct vioif_net_map *txq_maps; - - void *txq_deferred_transmit; - void *txq_handle_si; - struct vioif_work txq_work; - bool txq_workqueue; - bool txq_running_handle; - - char txq_evgroup[16]; - struct evcnt txq_defrag_failed; - struct evcnt txq_mbuf_load_failed; - struct evcnt txq_enqueue_reserve_failed; + void *netq_ctx; }; -struct vioif_rxqueue { - kmutex_t *rxq_lock; /* lock for rx operations */ +struct vioif_tx_context { + bool txc_link_active; + pcq_t *txc_intrq; + void *txc_deferred_transmit; - struct virtqueue *rxq_vq; - bool rxq_stopping; - - void *rxq_maps_kva; - struct vioif_net_map *rxq_maps; - - void *rxq_handle_si; - struct vioif_work rxq_work; - bool rxq_workqueue; - bool rxq_running_handle; - - char rxq_evgroup[16]; - struct evcnt rxq_mbuf_enobufs; - struct evcnt rxq_mbuf_load_failed; - struct evcnt rxq_enqueue_reserve_failed; + struct evcnt txc_defrag_failed; }; +struct vioif_rx_context { + struct evcnt rxc_mbuf_enobufs; +}; struct vioif_ctrlqueue { struct virtqueue *ctrlq_vq; enum { @@ -325,8 +321,7 @@ struct vioif_softc { struct ethercom sc_ethercom; int sc_link_state; - struct vioif_txqueue *sc_txq; - struct vioif_rxqueue *sc_rxq; + struct vioif_netqueue *sc_netqs; bool sc_has_ctrl; struct vioif_ctrlqueue sc_ctrlq; @@ -365,34 +360,34 @@ static int vioif_finalize_teardown(devic static int vioif_init(struct ifnet *); static void vioif_stop(struct ifnet *, int); static void vioif_start(struct ifnet *); -static void vioif_start_locked(struct ifnet *, struct vioif_txqueue *); +static void vioif_start_locked(struct ifnet *, struct vioif_netqueue *); static int vioif_transmit(struct ifnet *, struct mbuf *); -static void vioif_transmit_locked(struct ifnet *, struct vioif_txqueue *); +static void vioif_transmit_locked(struct ifnet *, struct vioif_netqueue *); static int vioif_ioctl(stru
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 02:48:30 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): added functions to manipulate network queues To generate a diff of this commit: cvs rdiff -u -r1.98 -r1.99 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_vioif.c diff -u src/sys/dev/pci/if_vioif.c:1.98 src/sys/dev/pci/if_vioif.c:1.99 --- src/sys/dev/pci/if_vioif.c:1.98 Thu Mar 23 02:42:49 2023 +++ src/sys/dev/pci/if_vioif.c Thu Mar 23 02:48:29 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: if_vioif.c,v 1.98 2023/03/23 02:42:49 yamaguchi Exp $ */ +/* $NetBSD: if_vioif.c,v 1.99 2023/03/23 02:48:29 yamaguchi Exp $ */ /* * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.98 2023/03/23 02:42:49 yamaguchi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.99 2023/03/23 02:48:29 yamaguchi Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -259,7 +259,7 @@ struct vioif_netqueue { char netq_evgroup[32]; struct evcnt netq_mbuf_load_failed; - struct evcnt netq_enqueue_reserve_failed; + struct evcnt netq_enqueue_failed; void *netq_ctx; }; @@ -370,6 +370,21 @@ static int vioif_ifflags_cb(struct ether /* tx & rx */ static void vioif_net_sched_handle(struct vioif_softc *, struct vioif_netqueue *); +static int vioif_net_load_mbuf(struct virtio_softc *, + struct vioif_net_map *, struct mbuf *, int); +static void vioif_net_unload_mbuf(struct virtio_softc *, + struct vioif_net_map *); +static int vioif_net_enqueue_tx(struct virtio_softc *, struct virtqueue *, + int, struct vioif_net_map *); +static int vioif_net_enqueue_rx(struct virtio_softc *, struct virtqueue *, + int, struct vioif_net_map *); +static struct mbuf * + vioif_net_dequeue_commit(struct virtio_softc *, + struct virtqueue *, int, struct vioif_net_map *, int); +static void vioif_net_intr_enable(struct vioif_softc *, + struct virtio_softc *); +static void vioif_net_intr_disable(struct vioif_softc *, + struct virtio_softc *); /* rx */ static void vioif_populate_rx_mbufs_locked(struct vioif_softc *, @@ -412,12 +427,11 @@ static int vioif_ctrl_intr(void *); static int vioif_config_change(struct virtio_softc *); static void vioif_ctl_softint(void *); static int vioif_ctrl_mq_vq_pairs_set(struct vioif_softc *, int); -static void vioif_enable_interrupt_vqpairs(struct vioif_softc *); -static void vioif_disable_interrupt_vqpairs(struct vioif_softc *); static int vioif_setup_sysctl(struct vioif_softc *); static void vioif_setup_stats(struct vioif_softc *); static int vioif_ifflags(struct vioif_softc *); static void vioif_intr_barrier(void); +static void vioif_notify(struct virtio_softc *, struct virtqueue *); CFATTACH_DECL_NEW(vioif, sizeof(struct vioif_softc), vioif_match, vioif_attach, NULL, NULL); @@ -1180,34 +1194,6 @@ vioif_finalize_teardown(device_t self) return 0; } -static void -vioif_enable_interrupt_vqpairs(struct vioif_softc *sc) -{ - struct virtio_softc *vsc = sc->sc_virtio; - struct vioif_netqueue *netq; - size_t i, netq_act_num; - - netq_act_num = sc->sc_act_nvq_pairs * 2; - for (i = 0; i < netq_act_num; i++) { - netq = &sc->sc_netqs[i]; - virtio_start_vq_intr(vsc, netq->netq_vq); - } -} - -static void -vioif_disable_interrupt_vqpairs(struct vioif_softc *sc) -{ - struct virtio_softc *vsc = sc->sc_virtio; - struct vioif_netqueue *netq; - size_t i, netq_act_num; - - netq_act_num = sc->sc_act_nvq_pairs * 2; - for (i = 0; i < netq_act_num; i++) { - netq = &sc->sc_netqs[i]; - virtio_stop_vq_intr(vsc, netq->netq_vq); - } -} - /* * Interface functions for ifnet */ @@ -1252,7 +1238,7 @@ vioif_init(struct ifnet *ifp) SET(ifp->if_flags, IFF_RUNNING); CLR(ifp->if_flags, IFF_OACTIVE); - vioif_enable_interrupt_vqpairs(sc); + vioif_net_intr_enable(sc, vsc); vioif_update_link_status(sc); r = vioif_rx_filter(sc); @@ -1267,12 +1253,12 @@ vioif_stop(struct ifnet *ifp, int disabl struct virtio_softc *vsc = sc->sc_virtio; struct vioif_netqueue *netq; struct vioif_ctrlqueue *ctrlq = &sc->sc_ctrlq; - size_t i, netq_act_num; + size_t i, act_qnum; - netq_act_num = sc->sc_act_nvq_pairs * 2; + act_qnum = sc->sc_act_nvq_pairs * 2; CLR(ifp->if_flags, IFF_RUNNING); - for (i = 0; i < netq_act_num; i++) { + for (i = 0; i < act_qnum; i++) { netq = &sc->sc_netqs[i]; mutex_enter(&netq->netq_lock); @@ -1281,7 +1267,7 @@ vioif_stop(struct ifnet *ifp, int disabl } /* disable interrupts */ - vioif_disable_interrupt_vqpairs(sc); + vioif_net_intr_disable(sc, vsc); if (sc->sc_has_ctrl) virtio_stop_vq_intr(vsc, ctrlq->ctrlq_vq); @@ -1295,7 +1281,7 @@ vioif_stop(struct ifnet *ifp, int disabl vioif_intr_barrier(); - for (i = 0; i < netq_act_num; i++) { + for (i = 0; i <
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 02:48:30 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): added functions to manipulate network queues To generate a diff of this commit: cvs rdiff -u -r1.98 -r1.99 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 02:52:29 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): rename sc_hdr_segs to sc_segs To generate a diff of this commit: cvs rdiff -u -r1.99 -r1.100 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_vioif.c diff -u src/sys/dev/pci/if_vioif.c:1.99 src/sys/dev/pci/if_vioif.c:1.100 --- src/sys/dev/pci/if_vioif.c:1.99 Thu Mar 23 02:48:29 2023 +++ src/sys/dev/pci/if_vioif.c Thu Mar 23 02:52:29 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: if_vioif.c,v 1.99 2023/03/23 02:48:29 yamaguchi Exp $ */ +/* $NetBSD: if_vioif.c,v 1.100 2023/03/23 02:52:29 yamaguchi Exp $ */ /* * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.99 2023/03/23 02:48:29 yamaguchi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.100 2023/03/23 02:52:29 yamaguchi Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -326,7 +326,7 @@ struct vioif_softc { bool sc_has_ctrl; struct vioif_ctrlqueue sc_ctrlq; - bus_dma_segment_t sc_hdr_segs[1]; + bus_dma_segment_t sc_segs[1]; void *sc_dmamem; void *sc_kmem; @@ -752,14 +752,14 @@ vioif_alloc_mems(struct vioif_softc *sc) } r = bus_dmamem_alloc(virtio_dmat(vsc), dmamemsize, 0, 0, - &sc->sc_hdr_segs[0], 1, &rsegs, BUS_DMA_NOWAIT); + &sc->sc_segs[0], 1, &rsegs, BUS_DMA_NOWAIT); if (r != 0) { aprint_error_dev(sc->sc_dev, "DMA memory allocation failed, size %zu, " "error code %d\n", dmamemsize, r); goto err_none; } - r = bus_dmamem_map(virtio_dmat(vsc),&sc->sc_hdr_segs[0], 1, + r = bus_dmamem_map(virtio_dmat(vsc), &sc->sc_segs[0], 1, dmamemsize, &vaddr, BUS_DMA_NOWAIT); if (r != 0) { aprint_error_dev(sc->sc_dev, @@ -953,7 +953,7 @@ err_reqs: } bus_dmamem_unmap(virtio_dmat(vsc), sc->sc_dmamem, dmamemsize); err_dmamem_alloc: - bus_dmamem_free(virtio_dmat(vsc), &sc->sc_hdr_segs[0], 1); + bus_dmamem_free(virtio_dmat(vsc), &sc->sc_segs[0], 1); err_none: return -1; }
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 02:52:29 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): rename sc_hdr_segs to sc_segs To generate a diff of this commit: cvs rdiff -u -r1.99 -r1.100 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 02:57:54 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): reorganize functions iThis change is move of function and rename, and this is no functional change. To generate a diff of this commit: cvs rdiff -u -r1.100 -r1.101 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: yamaguchi Date: Thu Mar 23 02:57:54 UTC 2023 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: vioif(4): reorganize functions iThis change is move of function and rename, and this is no functional change. To generate a diff of this commit: cvs rdiff -u -r1.100 -r1.101 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_vioif.c diff -u src/sys/dev/pci/if_vioif.c:1.100 src/sys/dev/pci/if_vioif.c:1.101 --- src/sys/dev/pci/if_vioif.c:1.100 Thu Mar 23 02:52:29 2023 +++ src/sys/dev/pci/if_vioif.c Thu Mar 23 02:57:54 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: if_vioif.c,v 1.100 2023/03/23 02:52:29 yamaguchi Exp $ */ +/* $NetBSD: if_vioif.c,v 1.101 2023/03/23 02:57:54 yamaguchi Exp $ */ /* * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.100 2023/03/23 02:52:29 yamaguchi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.101 2023/03/23 02:57:54 yamaguchi Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -330,7 +330,7 @@ struct vioif_softc { void *sc_dmamem; void *sc_kmem; - void *sc_ctl_softint; + void *sc_cfg_softint; struct workqueue *sc_txrx_workqueue; bool sc_txrx_workqueue_sysctl; @@ -360,1171 +360,1213 @@ static int vioif_finalize_teardown(devic static int vioif_init(struct ifnet *); static void vioif_stop(struct ifnet *, int); static void vioif_start(struct ifnet *); -static void vioif_start_locked(struct ifnet *, struct vioif_netqueue *); static int vioif_transmit(struct ifnet *, struct mbuf *); -static void vioif_transmit_locked(struct ifnet *, struct vioif_netqueue *); static int vioif_ioctl(struct ifnet *, u_long, void *); static void vioif_watchdog(struct ifnet *); +static int vioif_ifflags(struct vioif_softc *); static int vioif_ifflags_cb(struct ethercom *); /* tx & rx */ -static void vioif_net_sched_handle(struct vioif_softc *, - struct vioif_netqueue *); -static int vioif_net_load_mbuf(struct virtio_softc *, - struct vioif_net_map *, struct mbuf *, int); -static void vioif_net_unload_mbuf(struct virtio_softc *, - struct vioif_net_map *); -static int vioif_net_enqueue_tx(struct virtio_softc *, struct virtqueue *, - int, struct vioif_net_map *); -static int vioif_net_enqueue_rx(struct virtio_softc *, struct virtqueue *, - int, struct vioif_net_map *); -static struct mbuf * - vioif_net_dequeue_commit(struct virtio_softc *, - struct virtqueue *, int, struct vioif_net_map *, int); +static int vioif_netqueue_init(struct vioif_softc *, + struct virtio_softc *, size_t, u_int); +static void vioif_netqueue_teardown(struct vioif_softc *, + struct virtio_softc *, size_t); static void vioif_net_intr_enable(struct vioif_softc *, struct virtio_softc *); static void vioif_net_intr_disable(struct vioif_softc *, struct virtio_softc *); +static void vioif_net_sched_handle(struct vioif_softc *, + struct vioif_netqueue *); /* rx */ static void vioif_populate_rx_mbufs_locked(struct vioif_softc *, struct vioif_netqueue *); -static void vioif_rx_queue_clear(struct vioif_softc *, struct virtio_softc *, - struct vioif_netqueue *); -static bool vioif_rx_deq_locked(struct vioif_softc *, struct virtio_softc *, - struct vioif_netqueue *, u_int, size_t *); static int vioif_rx_intr(void *); static void vioif_rx_handle(void *); +static void vioif_rx_queue_clear(struct vioif_softc *, + struct virtio_softc *, struct vioif_netqueue *); /* tx */ +static void vioif_start_locked(struct ifnet *, struct vioif_netqueue *); +static void vioif_transmit_locked(struct ifnet *, struct vioif_netqueue *); +static void vioif_deferred_transmit(void *); static int vioif_tx_intr(void *); static void vioif_tx_handle(void *); static void vioif_tx_queue_clear(struct vioif_softc *, struct virtio_softc *, struct vioif_netqueue *); -static bool vioif_tx_deq_locked(struct vioif_softc *, struct virtio_softc *, - struct vioif_netqueue *, u_int); -static void vioif_deferred_transmit(void *); - -/* workqueue */ -static struct workqueue* - vioif_workq_create(const char *, pri_t, int, int); -static void vioif_workq_destroy(struct workqueue *); -static void vioif_workq_work(struct work *, void *); -static void vioif_work_set(struct vioif_work *, void(*)(void *), void *); -static void vioif_work_add(struct workqueue *, struct vioif_work *); -static void vioif_work_wait(struct workqueue *, struct vioif_work *); -/* other control */ -static int vioif_get_link_status(struct vioif_softc *); -static void vioif_update_link_status(struct vioif_softc *); +/* controls */ +static int vioif_ctrl_intr(void *); static int vioif_ctrl_rx(struct vioif_softc *, int, bool); static int vioif_set_promisc(struct vioif_softc *, bool); static int vioif_set_allm