[dpdk-dev] [PATCH] vhost: flush used->idx update before reading avail->flags

2015-06-11 Thread Linhaifeng
On 2015/6/10 16:30, Luke Gorrie wrote: > On 9 June 2015 at 10:46, Michael S. Tsirkin wrote: > >> By the way, similarly, host side must re-check avail idx after writing >> used flags. I don't see where snabbswitch does it - is that a bug >> in snabbswitch? > > > Good question. > > Snabb

[dpdk-dev] [PATCH] vhost: flush used->idx update before reading avail->flags

2015-06-10 Thread Linhaifeng
On 2015/6/9 21:34, Xie, Huawei wrote: > On 6/9/2015 4:47 PM, Michael S. Tsirkin wrote: >> On Tue, Jun 09, 2015 at 03:04:02PM +0800, Linhaifeng wrote: >>> >>> On 2015/4/24 15:27, Luke Gorrie wrote: On 24 April 2015 at 03:01, Linhaifeng wrote: > If not add memory fence what would

[dpdk-dev] [PATCH] vhost: flush used->idx update before reading avail->flags

2015-06-10 Thread Luke Gorrie
On 9 June 2015 at 10:46, Michael S. Tsirkin wrote: > By the way, similarly, host side must re-check avail idx after writing > used flags. I don't see where snabbswitch does it - is that a bug > in snabbswitch? Good question. Snabb Switch does not use interrupts from the guest. We always set

[dpdk-dev] [PATCH] vhost: flush used->idx update before reading avail->flags

2015-06-09 Thread Linhaifeng
On 2015/4/24 15:27, Luke Gorrie wrote: > On 24 April 2015 at 03:01, Linhaifeng wrote: > >> If not add memory fence what would happen? Packets loss or interrupt >> loss?How to test it ? >> > > You should be able to test it like this: > > 1. Boot two Linux kernel (e.g. 3.13) guests. > 2.

[dpdk-dev] [PATCH] vhost: flush used->idx update before reading avail->flags

2015-06-09 Thread Xie, Huawei
On 6/9/2015 4:47 PM, Michael S. Tsirkin wrote: > On Tue, Jun 09, 2015 at 03:04:02PM +0800, Linhaifeng wrote: >> >> On 2015/4/24 15:27, Luke Gorrie wrote: >>> On 24 April 2015 at 03:01, Linhaifeng wrote: >>> If not add memory fence what would happen? Packets loss or interrupt loss?How to

[dpdk-dev] [PATCH] vhost: flush used->idx update before reading avail->flags

2015-06-09 Thread Michael S. Tsirkin
On Tue, Jun 09, 2015 at 03:04:02PM +0800, Linhaifeng wrote: > > > On 2015/4/24 15:27, Luke Gorrie wrote: > > On 24 April 2015 at 03:01, Linhaifeng wrote: > > > >> If not add memory fence what would happen? Packets loss or interrupt > >> loss?How to test it ? > >> > > > > You should be able to

[dpdk-dev] [PATCH] vhost: flush used->idx update before reading avail->flags

2015-06-09 Thread Luke Gorrie
On 9 June 2015 at 09:04, Linhaifeng wrote: > On 2015/4/24 15:27, Luke Gorrie wrote: > > You should be able to test it like this: > > > > 1. Boot two Linux kernel (e.g. 3.13) guests. > > 2. Connect them via vhost switch. > > 3. Run continuous traffic between them (e.g. iperf). > > > > I would

[dpdk-dev] [PATCH] vhost: flush used->idx update before reading avail->flags

2015-04-24 Thread Luke Gorrie
On 24 April 2015 at 03:01, Linhaifeng wrote: > If not add memory fence what would happen? Packets loss or interrupt > loss?How to test it ? > You should be able to test it like this: 1. Boot two Linux kernel (e.g. 3.13) guests. 2. Connect them via vhost switch. 3. Run continuous traffic

[dpdk-dev] [PATCH] vhost: flush used->idx update before reading avail->flags

2015-04-24 Thread Linhaifeng
On 2015/4/23 0:33, Huawei Xie wrote: > update of used->idx and read of avail->flags could be reordered. > memory fence should be used to ensure the order, otherwise guest could see a > stale used->idx value after it toggles the interrupt suppression flag. > > Signed-off-by: Huawei Xie > --- >

[dpdk-dev] [PATCH] vhost: flush used->idx update before reading avail->flags

2015-04-24 Thread Xie, Huawei
> -Original Message- > From: Linhaifeng [mailto:haifeng.lin at huawei.com] > Sent: Friday, April 24, 2015 9:01 AM > To: Xie, Huawei; dev at dpdk.org > Cc: luke at snabb.co; mst at redhat.com > Subject: Re: [PATCH] vhost: flush used->idx update before reading avail- > >flags > > > > On

[dpdk-dev] [PATCH] vhost: flush used->idx update before reading avail->flags

2015-04-23 Thread Huawei Xie
update of used->idx and read of avail->flags could be reordered. memory fence should be used to ensure the order, otherwise guest could see a stale used->idx value after it toggles the interrupt suppression flag. Signed-off-by: Huawei Xie --- lib/librte_vhost/vhost_rxtx.c | 3 +++ 1 file