Re: [RFC 2/4] virtio: Override device's DMA OPS with virtio_direct_dma_ops selectively

2018-07-31 Thread Anshuman Khandual
On 07/30/2018 03:00 PM, Christoph Hellwig wrote: >>> + >>> + if (xen_domain()) >>> + goto skip_override; >>> + >>> + if (virtio_has_iommu_quirk(dev)) >>> + set_dma_ops(dev->dev.parent, _direct_dma_ops); >>> + >>> + skip_override: >>> + >> >> I prefer normal if scoping as

[PULL] vhost: last-minute fixes

2018-07-31 Thread Michael S. Tsirkin
The following changes since commit d72e90f33aa4709ebecc5005562f52335e106a60: Linux 4.18-rc6 (2018-07-22 14:12:20 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus for you to fetch changes up to

Re: [PATCH net-next 2/2] virtio-net: get rid of unnecessary container of rq stats

2018-07-31 Thread Michael S. Tsirkin
On Tue, Jul 31, 2018 at 05:43:39PM +0800, Jason Wang wrote: > We don't maintain tx counters in rx stats any more. There's no need > for an extra container of rq stats. > > Cc: Toshiaki Makita > Signed-off-by: Jason Wang Acked-by: Michael S. Tsirkin > --- > drivers/net/virtio_net.c | 80 >

Re: [PATCH net-next 1/2] virtio-net: correctly update XDP_TX counters

2018-07-31 Thread Michael S. Tsirkin
On Tue, Jul 31, 2018 at 05:43:38PM +0800, Jason Wang wrote: > Commit 5b8f3c8d30a6 ("virtio_net: Add XDP related stats") tries to > count TX XDP stats in virtnet_receive(). This will cause several > issues: > > - virtnet_xdp_sq() was called without checking whether or not XDP is > set. This may

Re: [PATCH net-next 2/2] virtio-net: get rid of unnecessary container of rq stats

2018-07-31 Thread David Miller
From: Jason Wang Date: Tue, 31 Jul 2018 17:43:39 +0800 > We don't maintain tx counters in rx stats any more. There's no need > for an extra container of rq stats. > > Cc: Toshiaki Makita > Signed-off-by: Jason Wang Applied. ___ Virtualization

Re: KASAN: use-after-free Read in vhost_transport_send_pkt

2018-07-31 Thread Stefan Hajnoczi
On Mon, Jul 30, 2018 at 11:15:03AM -0700, syzbot wrote: > Hello, > > syzbot found the following crash on: > > HEAD commit:acb1872577b3 Linux 4.18-rc7 > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=14eb932c40 > kernel config:

Re: [RFC 0/4] Virtio uses DMA API for all devices

2018-07-31 Thread Benjamin Herrenschmidt
On Tue, 2018-07-31 at 10:30 -0700, Christoph Hellwig wrote: > > However the question people raise is that DMA API is already full of > > arch-specific tricks the likes of which are outlined in your post linked > > above. How is this one much worse? > > None of these warts is visible to the

[PATCH net-next v7 1/4] net: vhost: lock the vqs one by one

2018-07-31 Thread xiangxia . m . yue
From: Tonghao Zhang This patch changes the way that lock all vqs at the same, to lock them one by one. It will be used for next patch to avoid the deadlock. Signed-off-by: Tonghao Zhang Acked-by: Jason Wang Signed-off-by: Jason Wang --- drivers/vhost/vhost.c | 24 +++- 1

[PATCH net-next v7 2/4] net: vhost: replace magic number of lock annotation

2018-07-31 Thread xiangxia . m . yue
From: Tonghao Zhang Use the VHOST_NET_VQ_XXX as a subclass for mutex_lock_nested. Signed-off-by: Tonghao Zhang Acked-by: Jason Wang --- drivers/vhost/net.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index

[PATCH net-next v7 0/4] net: vhost: improve performance when enable busyloop

2018-07-31 Thread xiangxia . m . yue
From: Tonghao Zhang This patches improve the guest receive performance. On the handle_tx side, we poll the sock receive queue at the same time. handle_rx do that in the same way. For more performance report, see patch 4. v6->v7: fix issue and rebase codes: 1. on tx, busypoll will

Re: [PATCH net-next 1/2] virtio-net: correctly update XDP_TX counters

2018-07-31 Thread Toshiaki Makita
On 2018/08/01 10:31, Jason Wang wrote: > On 2018年07月31日 17:57, Toshiaki Makita wrote: >> On 2018/07/31 18:43, Jason Wang wrote: >>> Commit 5b8f3c8d30a6 ("virtio_net: Add XDP related stats") tries to >>> count TX XDP stats in virtnet_receive(). This will cause several >>> issues: >>> >>> -

Re: [PATCH net-next 1/2] virtio-net: correctly update XDP_TX counters

2018-07-31 Thread Jason Wang
On 2018年07月31日 17:57, Toshiaki Makita wrote: On 2018/07/31 18:43, Jason Wang wrote: Commit 5b8f3c8d30a6 ("virtio_net: Add XDP related stats") tries to count TX XDP stats in virtnet_receive(). This will cause several issues: - virtnet_xdp_sq() was called without checking whether or not XDP is

Re: [PATCH net-next 2/2] virtio-net: get rid of unnecessary container of rq stats

2018-07-31 Thread Jason Wang
On 2018年07月31日 18:02, Toshiaki Makita wrote: On 2018/07/31 18:43, Jason Wang wrote: We don't maintain tx counters in rx stats any more. There's no need for an extra container of rq stats. Cc: Toshiaki Makita Signed-off-by: Jason Wang --- drivers/net/virtio_net.c | 80

Re: [PATCH net-next 2/2] virtio-net: get rid of unnecessary container of rq stats

2018-07-31 Thread Toshiaki Makita
On 2018/08/01 10:39, Jason Wang wrote: > On 2018年07月31日 18:02, Toshiaki Makita wrote: >> On 2018/07/31 18:43, Jason Wang wrote: >>> We don't maintain tx counters in rx stats any more. There's no need >>> for an extra container of rq stats. >>> >>> Cc: Toshiaki Makita >>> Signed-off-by: Jason Wang

[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()

2018-07-31 Thread xiangxia . m . yue
From: Tonghao Zhang Factor out generic busy polling logic and will be used for in tx path in the next patch. And with the patch, qemu can set differently the busyloop_timeout for rx queue. In the handle_tx, the busypoll will vhost_net_disable/enable_vq because we have poll the sock. This can

[PATCH net-next v7 4/4] net: vhost: add rx busy polling in tx path

2018-07-31 Thread xiangxia . m . yue
From: Tonghao Zhang This patch improves the guest receive performance. On the handle_tx side, we poll the sock receive queue at the same time. handle_rx do that in the same way. We set the poll-us=100us and use the netperf to test throughput and mean latency. When running the tests, the

Re: [RFC 2/4] virtio: Override device's DMA OPS with virtio_direct_dma_ops selectively

2018-07-31 Thread Anshuman Khandual
On 07/30/2018 02:55 PM, Christoph Hellwig wrote: >> +const struct dma_map_ops virtio_direct_dma_ops; > > This belongs into a header if it is non-static. If you only > use it in this file anyway please mark it static and avoid a forward > declaration. Sure, will make it static, move the

[PATCH net-next 1/2] virtio-net: correctly update XDP_TX counters

2018-07-31 Thread Jason Wang
Commit 5b8f3c8d30a6 ("virtio_net: Add XDP related stats") tries to count TX XDP stats in virtnet_receive(). This will cause several issues: - virtnet_xdp_sq() was called without checking whether or not XDP is set. This may cause out of bound access when there's no enough txq for XDP. - Stats

Re: [PATCH net-next 1/2] virtio-net: correctly update XDP_TX counters

2018-07-31 Thread Toshiaki Makita
On 2018/07/31 18:43, Jason Wang wrote: > Commit 5b8f3c8d30a6 ("virtio_net: Add XDP related stats") tries to > count TX XDP stats in virtnet_receive(). This will cause several > issues: > > - virtnet_xdp_sq() was called without checking whether or not XDP is > set. This may cause out of bound

Re: [PATCH net-next 2/2] virtio-net: get rid of unnecessary container of rq stats

2018-07-31 Thread Toshiaki Makita
On 2018/07/31 18:43, Jason Wang wrote: > We don't maintain tx counters in rx stats any more. There's no need > for an extra container of rq stats. > > Cc: Toshiaki Makita > Signed-off-by: Jason Wang > --- > drivers/net/virtio_net.c | 80 > ++-- > 1

[PATCH net-next 2/2] virtio-net: get rid of unnecessary container of rq stats

2018-07-31 Thread Jason Wang
We don't maintain tx counters in rx stats any more. There's no need for an extra container of rq stats. Cc: Toshiaki Makita Signed-off-by: Jason Wang --- drivers/net/virtio_net.c | 80 ++-- 1 file changed, 36 insertions(+), 44 deletions(-) diff