Re: [kvm-devel] [PATCH resent] virtio_net: Fix stalled inbound trafficon early packets

2007-12-11 Thread Dor Laor
Christian Borntraeger wrote: Hello Rusty, while implementing and testing virtio on s390 I found a problem in virtio_net: The current virtio_net driver has a startup race, which prevents any incoming traffic: If try_fill_recv submits buffers to the host system data might be filled in and an int

Re: [kvm-devel] [PATCH resent] virtio_net: Fix stalled inbound trafficon early packets

2007-12-11 Thread Dor Laor
This time I send in text so netdev list won't reject it; sorry. Dor Laor wrote: > Christian Borntraeger wrote: >> >> Hello Rusty, >> >> while implementing and testing virtio on s390 I found a problem in >> virtio_net: The current virtio_net driver has a startup race, which >> prevents any incoming

Re: [kvm-devel] [PATCH resent] virtio_net: Fix stalled inbound trafficon early packets

2007-12-11 Thread Christian Borntraeger
Dor Laor wrote: > Christian Borntraeger wrote: >> >> Hello Rusty, >> >> while implementing and testing virtio on s390 I found a problem in >> virtio_net: The current virtio_net driver has a startup race, which >> prevents any incoming traffic: >> >> If try_fill_recv submits buffers to the host syst

Re: [kvm-devel] [PATCH resent] virtio_net: Fix stalled inbound trafficon early packets

2007-12-11 Thread Christian Borntraeger
2nd try. I somehow enable html on the last post Dor Laor wrote: > Christian Borntraeger wrote: >> >> Hello Rusty, >> >> while implementing and testing virtio on s390 I found a problem in >> virtio_net: The current virtio_net driver has a startup race, which >> prevents any incoming traffic: >> >>

Re: [kvm-devel] [PATCH resent] virtio_net: Fix stalled inbound trafficon early packets

2007-12-11 Thread Christian Borntraeger
Am Dienstag, 11. Dezember 2007 schrieb Christian Borntraeger: > > The way other physical NICs doing it is by dis/en/abling interrupt > > using registers (look at e1000). > > I suggest we can export add_status and use the original code but > > before enabling napi add a call to add_status(dev, > >

Re: [kvm-devel] [PATCH resent] virtio_net: Fix stalled inbound trafficon early packets

2007-12-11 Thread Dor Laor
Christian Borntraeger wrote: > Am Dienstag, 11. Dezember 2007 schrieb Christian Borntraeger: > >>> The way other physical NICs doing it is by dis/en/abling interrupt >>> using registers (look at e1000). >>> I suggest we can export add_status and use the original code but >>> before enabling nap

Re: [kvm-devel] [PATCH resent] virtio_net: Fix stalled inbound trafficon early packets

2007-12-11 Thread Rusty Russell
On Wednesday 12 December 2007 00:16:12 Christian Borntraeger wrote: > That would also work. We already have VRING_AVAIL_F_NO_INTERRUPT in > virtio_ring.c - maybe we can use that. Its hidden in callback and > restart handling, what about adding an explicit startup? Yes, I debated whether to make th

Re: [kvm-devel] [PATCH resent] virtio_net: Fix stalled inbound trafficon early packets

2007-12-12 Thread Christian Borntraeger
Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor: > This is why initially I suggested another status code in order to split > the ring logic with driver status. > > but also not filling any buffers as long as VIRTIO_CONFIG_DEV_OPEN is not > > set. I will have a look but I think that add_status ne

Re: [kvm-devel] [PATCH resent] virtio_net: Fix stalled inbound trafficon early packets

2007-12-12 Thread Christian Borntraeger
Am Mittwoch, 12. Dezember 2007 schrieb Rusty Russell: > On Wednesday 12 December 2007 00:16:12 Christian Borntraeger wrote: > > That would also work. We already have VRING_AVAIL_F_NO_INTERRUPT in > > virtio_ring.c - maybe we can use that. Its hidden in callback and > > restart handling, what about

Re: [kvm-devel] [PATCH resent] virtio_net: Fix stalled inbound trafficon early packets

2007-12-12 Thread Dor Laor
Christian Borntraeger wrote: > > Am Mittwoch, 12. Dezember 2007 schrieb Rusty Russell: > > On Wednesday 12 December 2007 00:16:12 Christian Borntraeger wrote: > > > That would also work. We already have VRING_AVAIL_F_NO_INTERRUPT in > > > virtio_ring.c - maybe we can use that. Its hidden in callbac

Re: [kvm-devel] [PATCH resent] virtio_net: Fix stalled inbound trafficon early packets

2007-12-12 Thread Christian Borntraeger
Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor: > I think the change below handles the race. Otherwise please detail the > use case. [...] > > @@ -292,6 +292,9 @@ static int virtnet_open(struct net_devic > > return -ENOMEM; > > > > napi_enable(&vi->napi); > > + > > +

Re: [kvm-devel] [PATCH resent] virtio_net: Fix stalled inbound trafficon early packets

2007-12-13 Thread Dor Laor
Christian Borntraeger wrote: > Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor: > >> I think the change below handles the race. Otherwise please detail the >> use case. >> > [...] > >>> @@ -292,6 +292,9 @@ static int virtnet_open(struct net_devic >>> return -ENOMEM; >>>

Re: [kvm-devel] [PATCH resent] virtio_net: Fix stalled inbound trafficon early packets

2007-12-13 Thread Christian Borntraeger
Am Donnerstag, 13. Dezember 2007 schrieb Dor Laor: > You're right I got confused somehow. > So in that case setting the driver status field on open in addition to > your enable will do the trick. > On DRIVER_OPEN the host will trigger an interrupt if the queue is not > empty.. > Thanks, > Dor Af

Re: [kvm-devel] [PATCH resent] virtio_net: Fix stalled inbound trafficon early packets

2007-12-17 Thread Rusty Russell
On Friday 14 December 2007 05:30:31 Christian Borntraeger wrote: > Rusty, if you decide to apply my patch, there is one downside: The > debugging code in virtio_ring sometimes triggers with a false positive: > > try_fill_recv calls vring_kick. Here we do a notify to the host. This might > cause an