> On 5 Aug 2019, at 22:38, Alexander Bluhm <alexander.bl...@gmx.net> wrote:
>
> On Thu, Jul 18, 2019 at 11:31:26PM +1000, David Gwynne wrote:
>>> And I have to do ifconfig vio0 down and ifconfig vio0 up to receive
>>> packets on the interface again.
>>
>> Can you look at systat mb when this happens to check what value
>> vio0 has in the ALIVE column? If ALIVE is 0, it means the ring is
>> empty. It looks like the driver does try to cope with this situation,
>> but maybe it doesn't cope well enough. Let's start with checking
>> if it is an empty ring first.
>
> After a bit of testing it looks that the codition for adding the
> timeout is never true. It is a consequence of converting to
> if_rxr_get().
>
> The easiest fix is to add the rx tick timeout unconditionaly.
> Runnning this code every second is not too much waste. Other drivers
> also do that.
>
> ok?
I don't like how big this hammer is, but it is better than the current
situation.
It doesn't look like vio uses MPSAFE interrupts, so the timeout can't run
concurrently with the rxeof stuff, so this should be fine.
ok.
>
> bluhm
>
> Index: dev/pv/if_vio.c
> ===================================================================
> RCS file: /data/mirror/openbsd/cvs/src/sys/dev/pv/if_vio.c,v
> retrieving revision 1.12
> diff -u -p -r1.12 if_vio.c
> --- dev/pv/if_vio.c 26 May 2019 15:22:31 -0000 1.12
> +++ dev/pv/if_vio.c 5 Aug 2019 06:52:04 -0000
> @@ -982,10 +982,7 @@ vio_populate_rx_mbufs(struct vio_softc *
>
> if (done)
> virtio_notify(vsc, vq);
> - if (vq->vq_used_idx != vq->vq_avail_idx)
> - timeout_del(&sc->sc_rxtick);
> - else
> - timeout_add_sec(&sc->sc_rxtick, 1);
> + timeout_add_sec(&sc->sc_rxtick, 1);
> }
>
> /* dequeue received packets */