Re: vio(4): fixup crash on up/down

2016-11-25 Thread Reyk Floeter
On Wed, Nov 23, 2016 at 09:10:44PM +0100, Stefan Fritsch wrote: > On Wed, 23 Nov 2016, Rafael Zalamena wrote: > > > > Maybe something like this is enough already (untested): > > > > I tried your diff without Mike's if_vio diff and it doesn't panic anymore, > > however it doesn't work. > > > >

Re: vio(4): fixup crash on up/down

2016-11-24 Thread Mike Belopuhov
On Wed, Nov 23, 2016 at 21:10 +0100, Stefan Fritsch wrote: > On Wed, 23 Nov 2016, Rafael Zalamena wrote: > > > > Maybe something like this is enough already (untested): > > > > I tried your diff without Mike's if_vio diff and it doesn't panic anymore, > > however it doesn't work. > > > > vioX

Re: vio(4): fixup crash on up/down

2016-11-24 Thread Rafael Zalamena
On Wed, Nov 23, 2016 at 09:10:44PM +0100, Stefan Fritsch wrote: > On Wed, 23 Nov 2016, Rafael Zalamena wrote: > > > > Maybe something like this is enough already (untested): > > > > I tried your diff without Mike's if_vio diff and it doesn't panic anymore, > > however it doesn't work. > > > >

Re: vio(4): fixup crash on up/down

2016-11-23 Thread Mike Larkin
On Wed, Nov 23, 2016 at 09:10:44PM +0100, Stefan Fritsch wrote: > On Wed, 23 Nov 2016, Rafael Zalamena wrote: > > > > Maybe something like this is enough already (untested): > > > > I tried your diff without Mike's if_vio diff and it doesn't panic anymore, > > however it doesn't work. > > > >

Re: vio(4): fixup crash on up/down

2016-11-23 Thread Stefan Fritsch
On Wed, 23 Nov 2016, Rafael Zalamena wrote: > > Maybe something like this is enough already (untested): > > I tried your diff without Mike's if_vio diff and it doesn't panic anymore, > however it doesn't work. > > vioX can send packets to host, host receives them and reply, but vioX > doesn't

Re: vio(4): fixup crash on up/down

2016-11-23 Thread Rafael Zalamena
On Wed, Nov 23, 2016 at 09:03:46AM +0100, Stefan Fritsch wrote: > On Wed, 23 Nov 2016, Mike Belopuhov wrote: > > > I guess we could do that. But then we cannot free the mbufs on DOWN > > > until the device has used them. > > > > Diff to this effect is below. Works on vmd and qemu (original > >

Re: vio(4): fixup crash on up/down

2016-11-23 Thread Stefan Fritsch
On Wed, 23 Nov 2016, Mike Belopuhov wrote: > > I am not convinced. Doing a reset allows to recover from all kinds of > > problems with DOWN/UP. That was useful when we had bugs in the event_idx > > implementation. > > > > I don't think this justifies it since bugs need to be fixed regardless.

Re: vio(4): fixup crash on up/down

2016-11-23 Thread Mike Belopuhov
On Wed, Nov 23, 2016 at 09:03 +0100, Stefan Fritsch wrote: > On Wed, 23 Nov 2016, Mike Belopuhov wrote: > > > I guess we could do that. But then we cannot free the mbufs on DOWN > > > until the device has used them. > > > > Diff to this effect is below. Works on vmd and qemu (original > > one

Re: vio(4): fixup crash on up/down

2016-11-23 Thread Stefan Fritsch
On Wed, 23 Nov 2016, Mike Belopuhov wrote: > > I guess we could do that. But then we cannot free the mbufs on DOWN > > until the device has used them. > > Diff to this effect is below. Works on vmd and qemu (original > one didn't because I kept the virtio_reset). > > > That sounds like an

Re: vio(4): fixup crash on up/down

2016-11-22 Thread Mike Belopuhov
On Wed, Nov 23, 2016 at 00:42 +0100, Stefan Fritsch wrote: > On Wednesday, 23 November 2016 00:34:42 CET Mike Belopuhov wrote: > > Yes, after looking closer at virtio code I agree with you. > > However, stop/init is purely OpenBSD specific action. There > > are no provisions or requirements from

Re: vio(4): fixup crash on up/down

2016-11-22 Thread Stefan Fritsch
On Wednesday, 23 November 2016 00:34:42 CET Mike Belopuhov wrote: > Yes, after looking closer at virtio code I agree with you. > However, stop/init is purely OpenBSD specific action. There > are no provisions or requirements from the hardware really. > Thus we can treat UP/DOWN as purely software

Re: vio(4): fixup crash on up/down

2016-11-22 Thread Mike Belopuhov
On Wed, Nov 23, 2016 at 00:09 +0100, s...@openbsd.org wrote: > On Tue, 22 Nov 2016, Mike Belopuhov wrote: > > > vmd hackers and users seem to be able to trigger the assertion > > below every time they do down and then up (with a dhclient for > > instance): > > > > panic: kernel diagnostic

Re: vio(4): fixup crash on up/down

2016-11-22 Thread Mike Larkin
On Wed, Nov 23, 2016 at 12:09:57AM +0100, s...@openbsd.org wrote: > On Tue, 22 Nov 2016, Mike Belopuhov wrote: > > > vmd hackers and users seem to be able to trigger the assertion > > below every time they do down and then up (with a dhclient for > > instance): > > > > panic: kernel diagnostic

Re: vio(4): fixup crash on up/down

2016-11-22 Thread sf
On Tue, 22 Nov 2016, Mike Belopuhov wrote: > vmd hackers and users seem to be able to trigger the assertion > below every time they do down and then up (with a dhclient for > instance): > > panic: kernel diagnostic assertion "m != NULL" failed: file > "/usr/src/sys/dev/pci/if_vio.c", line

Re: vio(4): fixup crash on up/down

2016-11-22 Thread Mike Larkin
On Tue, Nov 22, 2016 at 09:45:30PM +0100, Mike Belopuhov wrote: > vmd hackers and users seem to be able to trigger the assertion > below every time they do down and then up (with a dhclient for > instance): > > panic: kernel diagnostic assertion "m != NULL" failed: file >