Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Remove VIRTIO_F_PCI_INTR_SOFTINT support for mul...



details:   https://anonhg.NetBSD.org/src/rev/fc532dceb11f
branches:  trunk
changeset: 933345:fc532dceb11f
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Mon May 25 07:29:52 2020 +0000

description:
Remove VIRTIO_F_PCI_INTR_SOFTINT support for multiqueue

The functionality is no longer used by obsolating VIOIF_SOFTINT_INTR.

diffstat:

 sys/dev/pci/virtio.c     |  64 +++--------------------------------------------
 sys/dev/pci/virtio_pci.c |  15 +++--------
 sys/dev/pci/virtiovar.h  |   3 +-
 3 files changed, 10 insertions(+), 72 deletions(-)

diffs (160 lines):

diff -r 6a7179cc99bc -r fc532dceb11f sys/dev/pci/virtio.c
--- a/sys/dev/pci/virtio.c      Mon May 25 07:20:14 2020 +0000
+++ b/sys/dev/pci/virtio.c      Mon May 25 07:29:52 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: virtio.c,v 1.38 2019/10/01 18:00:08 chs Exp $  */
+/*     $NetBSD: virtio.c,v 1.39 2020/05/25 07:29:52 yamaguchi Exp $    */
 
 /*
  * Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.38 2019/10/01 18:00:08 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.39 2020/05/25 07:29:52 yamaguchi Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -235,54 +235,6 @@
                        ops);
 }
 
-static void
-virtio_vq_soft_intr(void *arg)
-{
-       struct virtqueue *vq = arg;
-
-       KASSERT(vq->vq_intrhand != NULL);
-
-       (vq->vq_intrhand)(vq);
-}
-
-static int
-virtio_vq_softint_establish(struct virtio_softc *sc)
-{
-       struct virtqueue *vq;
-       int qid;
-       u_int flags;
-
-       flags = SOFTINT_NET;
-       if (sc->sc_flags & VIRTIO_F_PCI_INTR_MPSAFE)
-               flags |= SOFTINT_MPSAFE;
-
-       for (qid = 0; qid < sc->sc_nvqs; qid++) {
-               vq = &sc->sc_vqs[qid];
-               vq->vq_soft_ih =
-                   softint_establish(flags, virtio_vq_soft_intr, vq);
-               if (vq->vq_soft_ih == NULL)
-                       return -1;
-       }
-
-       return 0;
-}
-
-static void
-virtio_vq_softint_disestablish(struct virtio_softc *sc)
-{
-       struct virtqueue *vq;
-       int qid;
-
-       for (qid = 0; qid < sc->sc_nvqs; qid++) {
-               vq = &sc->sc_vqs[qid];
-               if (vq->vq_soft_ih == NULL)
-                       continue;
-
-               softint_disestablish(vq->vq_soft_ih);
-               vq->vq_soft_ih = NULL;
-       }
-}
-
 /*
  * Can be used as sc_intrhand.
  */
@@ -910,6 +862,9 @@
 virtio_child_attach_set_vqs(struct virtio_softc *sc,
     struct virtqueue *vqs, int nvq_pairs)
 {
+
+       KASSERT(nvq_pairs == 1 ||
+           (sc->sc_flags & VIRTIO_F_PCI_INTR_SOFTINT) == 0);
        if (nvq_pairs > 1)
                sc->sc_child_mq = true;
 
@@ -940,13 +895,6 @@
                            "failed to establish soft interrupt\n");
                        goto fail;
                }
-
-               if (sc->sc_child_mq) {
-                       r = virtio_vq_softint_establish(sc);
-                       aprint_error_dev(sc->sc_dev,
-                           "failed to establish softint interrupt\n");
-                       goto fail;
-               }
        }
 
        virtio_set_status(sc, VIRTIO_CONFIG_DEVICE_STATUS_DRIVER_OK);
@@ -958,8 +906,6 @@
                sc->sc_soft_ih = NULL;
        }
 
-       virtio_vq_softint_disestablish(sc);
-
        virtio_set_status(sc, VIRTIO_CONFIG_DEVICE_STATUS_FAILED);
        return 1;
 }
diff -r 6a7179cc99bc -r fc532dceb11f sys/dev/pci/virtio_pci.c
--- a/sys/dev/pci/virtio_pci.c  Mon May 25 07:20:14 2020 +0000
+++ b/sys/dev/pci/virtio_pci.c  Mon May 25 07:29:52 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: virtio_pci.c,v 1.7 2019/01/27 02:08:42 pgoyette Exp $ */
+/* $NetBSD: virtio_pci.c,v 1.8 2020/05/25 07:29:52 yamaguchi Exp $ */
 
 /*
  * Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: virtio_pci.c,v 1.7 2019/01/27 02:08:42 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio_pci.c,v 1.8 2020/05/25 07:29:52 yamaguchi Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -801,16 +801,9 @@
 virtio_pci_msix_vq_intr(void *arg)
 {
        struct virtqueue *vq = arg;
-       int r = 0;
 
-       if (vq->vq_intrhand != NULL) {
-               if (vq->vq_soft_ih)
-                       softint_schedule(vq->vq_soft_ih);
-               else
-                       r |= vq->vq_intrhand(vq);
-       }
-
-       return r;
+       KASSERT(vq->vq_intrhand != NULL);
+       return vq->vq_intrhand(vq);
 }
 
 static int
diff -r 6a7179cc99bc -r fc532dceb11f sys/dev/pci/virtiovar.h
--- a/sys/dev/pci/virtiovar.h   Mon May 25 07:20:14 2020 +0000
+++ b/sys/dev/pci/virtiovar.h   Mon May 25 07:29:52 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: virtiovar.h,v 1.13 2019/01/14 14:55:37 yamaguchi Exp $ */
+/*     $NetBSD: virtiovar.h,v 1.14 2020/05/25 07:29:52 yamaguchi Exp $ */
 
 /*
  * Copyright (c) 2010 Minoura Makoto.
@@ -117,7 +117,6 @@
        /* interrupt handler */
        int                     (*vq_done)(struct virtqueue*);
        void                    *vq_done_ctx;
-       void                    *vq_soft_ih;
        int                     (*vq_intrhand)(struct virtqueue*);
 };
 



Home | Main Index | Thread Index | Old Index