NetBSD-Bugs archive

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

kern/51448: vioif(4) initializes wrong queues



>Number:         51448
>Category:       kern
>Synopsis:       vioif(4) initializes wrong queues
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 29 04:15:00 +0000 2016
>Originator:     Ryota Ozaki
>Release:        NetBSD-current, -7, -6
>Organization:
>Environment:
NetBSD kvm 7.99.35 NetBSD 7.99.35 (KVM) #274: Mon Aug 29 12:39:21 JST 2016  ozaki-r@rangeley:(hidden) amd64
>Description:
vioif(4) wrongly initializes (bus_dmamap_create & bus_dmamap_load) tx/rx queues:

        for (i = 0; i < rxqsize; i++) {
                C_L1(rxhdr_dmamaps[i], rx_hdrs[i], ...

        ...

        for (i = 0; i < txqsize; i++) {
                C_L1(txhdr_dmamaps[i], rx_hdrs[i], ...
                                       ^^^^^^^
                                       should be tx_hdrs

It causes queue stalls on some environments, e.g., GCE.

Pointed out by Mike Larkin.

>How-To-Repeat:

>Fix:
diff --git a/sys/dev/pci/if_vioif.c b/sys/dev/pci/if_vioif.c
index 2defe41..73b83f6 100644
--- a/sys/dev/pci/if_vioif.c
+++ b/sys/dev/pci/if_vioif.c
@@ -427,7 +427,7 @@ vioif_alloc_mems(struct vioif_softc *sc)
        }
 
        for (i = 0; i < txqsize; i++) {
-               C_L1(txhdr_dmamaps[i], rx_hdrs[i],
+               C_L1(txhdr_dmamaps[i], tx_hdrs[i],
                    sizeof(struct virtio_net_hdr), 1,
                    WRITE, "tx header");
                C(tx_dmamaps[i], NULL, ETHER_MAX_LEN, 16 /* XXX */, 0,



Home | Main Index | Thread Index | Old Index