[PATCH net,stable v3] vhost: fix a few skb leaks

2017-12-01 Thread wexu
From: Wei Xu Matthew found a roughly 40% tcp throughput regression with commit c67df11f(vhost_net: try batch dequing from skb array) as discussed in the following thread: https://www.mail-archive.com/netdev@vger.kernel.org/msg187936.html This is v3. v3: - move freeing skb from

[PATCH] virtio-mmio: Use PTR_ERR_OR_ZERO()

2017-12-01 Thread Vasyl Gomonovych
Fix ptr_ret.cocci warnings: drivers/virtio/virtio_mmio.c:653:1-3: WARNING: PTR_ERR_OR_ZERO can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: scripts/coccinelle/api/ptr_ret.cocci Signed-off-by: Vasyl Gomonovych ---

Re: [PATCH net,stable] vhost: fix skb leak in handle_rx()

2017-12-01 Thread Wei Xu
On Tue, Nov 28, 2017 at 07:50:58PM +0200, Michael S. Tsirkin wrote: > On Tue, Nov 28, 2017 at 12:17:16PM -0500, w...@redhat.com wrote: > > From: Wei Xu > > > > Matthew found a roughly 40% tcp throughput regression with commit > > c67df11f(vhost_net: try batch dequing from skb

Re: [RFC] virtio-net: help live migrate SR-IOV devices

2017-12-01 Thread achiad shochat
On 30 November 2017 at 05:29, Jason Wang wrote: > > > On 2017年11月29日 03:27, Jesse Brandeburg wrote: >> >> Hi, I'd like to get some feedback on a proposal to enhance virtio-net >> to ease configuration of a VM and that would enable live migration of >> passthrough network

Re: [RFC] virtio-net: help live migrate SR-IOV devices

2017-12-01 Thread Shannon Nelson
On 11/30/2017 6:11 AM, Michael S. Tsirkin wrote: On Thu, Nov 30, 2017 at 10:08:45AM +0200, achiad shochat wrote: Re. problem #2: Indeed the best way to address it seems to be to enslave the VF driver netdev under a persistent anchor netdev. And it's indeed desired to allow (but not enforce) PV

Re: [PATCH net,stable] vhost: fix skb leak in handle_rx()

2017-12-01 Thread Wei Xu
On Tue, Nov 28, 2017 at 07:53:33PM +0200, Michael S. Tsirkin wrote: > On Tue, Nov 28, 2017 at 12:17:16PM -0500, w...@redhat.com wrote: > > From: Wei Xu > > > > Matthew found a roughly 40% tcp throughput regression with commit > > c67df11f(vhost_net: try batch dequing from skb

Re: [RFC] virtio-net: help live migrate SR-IOV devices

2017-12-01 Thread Jakub Kicinski
On Thu, 30 Nov 2017 15:54:40 +0200, Michael S. Tsirkin wrote: > On Wed, Nov 29, 2017 at 07:51:38PM -0800, Jakub Kicinski wrote: > > On Thu, 30 Nov 2017 11:29:56 +0800, Jason Wang wrote: > > > On 2017年11月29日 03:27, Jesse Brandeburg wrote: > > > > Hi, I'd like to get some feedback on a proposal

[PATCH 1/3] vhost: fix skb leak in handle_rx()

2017-12-01 Thread wexu
From: Wei Xu Matthew found a roughly 40% tcp throughput regression with commit c67df11f(vhost_net: try batch dequing from skb array) as discussed in the following thread: https://www.mail-archive.com/netdev@vger.kernel.org/msg187936.html Eventually we figured out that it was a

[PATCH] drm/virtio: Don't return invalid caps on timeout

2017-12-01 Thread Tomeu Vizoso
If the wait timeouts, the caps are probably invalid and we shouldn't be passing them to userspace. Signed-off-by: Tomeu Vizoso --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c

[PATCH] virtio_balloon: fix increment of vb->num_pfns in fill_balloon()

2017-12-01 Thread Jan Stancek
commit c7cdff0e8647 ("virtio_balloon: fix deadlock on OOM") changed code to increment vb->num_pfns before call to set_page_pfns(), which used to happen only after. This patch fixes boot hang for me on ppc64le KVM guests. Fixes: c7cdff0e8647 ("virtio_balloon: fix deadlock on OOM") Cc: Michael S.

[PATCH net,stable v4 0/3] vhost: fix a few skb leaks

2017-12-01 Thread wexu
From: Wei Xu Matthew found a roughly 40% tcp throughput regression with commit c67df11f(vhost_net: try batch dequing from skb array) as discussed in the following thread: https://www.mail-archive.com/netdev@vger.kernel.org/msg187936.html v4: - fix zero iov iterator count in

Re: [PATCH net,stable v2] vhost: fix skb leak in handle_rx()

2017-12-01 Thread Wei Xu
On Thu, Nov 30, 2017 at 10:46:17AM +0800, Jason Wang wrote: > > > On 2017年11月29日 23:31, Michael S. Tsirkin wrote: > > On Wed, Nov 29, 2017 at 09:23:24AM -0500,w...@redhat.com wrote: > > > From: Wei Xu > > > > > > Matthew found a roughly 40% tcp throughput regression with

Re: [PATCH net,stable v2] vhost: fix skb leak in handle_rx()

2017-12-01 Thread Wei Xu
On Wed, Nov 29, 2017 at 10:43:33PM +0800, Jason Wang wrote: > > > On 2017年11月29日 22:23, w...@redhat.com wrote: > > From: Wei Xu > > > > Matthew found a roughly 40% tcp throughput regression with commit > > c67df11f(vhost_net: try batch dequing from skb array) as discussed > >

Re: [PATCH net,stable v4 0/3] vhost: fix a few skb leaks

2017-12-01 Thread Matthew Rosato
On 12/01/2017 09:47 AM, Michael S. Tsirkin wrote: > On Fri, Dec 01, 2017 at 05:10:35AM -0500, w...@redhat.com wrote: >> From: Wei Xu >> >> Matthew found a roughly 40% tcp throughput regression with commit >> c67df11f(vhost_net: try batch dequing from skb array) as discussed >> in

[PATCH 2/3] tun: free skb in early errors

2017-12-01 Thread wexu
From: Wei Xu tun_recvmsg() supports accepting skb by msg_control after commit ac77cfd4258f ("tun: support receiving skb through msg_control"), the skb if presented should be freed no matter how far it can go along, otherwise it would be leaked. This patch fixes several missed

[PATCH 1/3] vhost: fix skb leak in handle_rx()

2017-12-01 Thread wexu
From: Wei Xu Matthew found a roughly 40% tcp throughput regression with commit c67df11f(vhost_net: try batch dequing from skb array) as discussed in the following thread: https://www.mail-archive.com/netdev@vger.kernel.org/msg187936.html Eventually we figured out that it was a

Re: [RFC] virtio-net: help live migrate SR-IOV devices

2017-12-01 Thread Jakub Kicinski
On Wed, 29 Nov 2017 20:10:09 -0800, Stephen Hemminger wrote: > On Wed, 29 Nov 2017 19:51:38 -0800 Jakub Kicinski wrote: > > On Thu, 30 Nov 2017 11:29:56 +0800, Jason Wang wrote: > > > On 2017年11月29日 03:27, Jesse Brandeburg wrote: > > > commit 0c195567a8f6e82ea5535cd9f1d54a1626dd233e > > >

[PATCH 3/3] tap: free skb if flags error

2017-12-01 Thread wexu
From: Wei Xu tap_recvmsg() supports accepting skb by msg_control after commit 3b4ba04acca8 ("tap: support receiving skb from msg_control"), the skb if presented should be freed within the function, otherwise it would be leaked. Signed-off-by: Wei Xu

[PATCH 2/3] tun: free skb in early errors

2017-12-01 Thread wexu
From: Wei Xu tun_recvmsg() supports accepting skb by msg_control after commit ac77cfd4258f ("tun: support receiving skb through msg_control"), the skb if presented should be freed within the function, otherwise it would be leaked. Signed-off-by: Wei Xu

[PATCH net,stable] vhost: fix skb leak in handle_rx()

2017-12-01 Thread wexu
From: Wei Xu Matthew found a roughly 40% tcp throughput regression with commit c67df11f(vhost_net: try batch dequing from skb array) as discussed in the following thread: https://www.mail-archive.com/netdev@vger.kernel.org/msg187936.html Eventually we figured out that it was a

[PATCH net,stable v2] vhost: fix skb leak in handle_rx()

2017-12-01 Thread wexu
From: Wei Xu Matthew found a roughly 40% tcp throughput regression with commit c67df11f(vhost_net: try batch dequing from skb array) as discussed in the following thread: https://www.mail-archive.com/netdev@vger.kernel.org/msg187936.html Eventually we figured out that it was a

Re: [RFC] virtio-net: help live migrate SR-IOV devices

2017-12-01 Thread Jakub Kicinski
On Thu, 30 Nov 2017 11:29:56 +0800, Jason Wang wrote: > On 2017年11月29日 03:27, Jesse Brandeburg wrote: > > Hi, I'd like to get some feedback on a proposal to enhance virtio-net > > to ease configuration of a VM and that would enable live migration of > > passthrough network SR-IOV devices. > > > >

[PATCH] virtio: release virtio index when fail to device_register

2017-12-01 Thread weiping zhang
index can be reused by other virtio device. Signed-off-by: weiping zhang --- drivers/virtio/virtio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c index 48230a5..bf7ff39 100644 --- a/drivers/virtio/virtio.c

Re: [PATCH 00/13] remove_conflicting_framebuffers() cleanup

2017-12-01 Thread Thierry Reding
On Mon, Nov 27, 2017 at 11:30:44AM +0100, Daniel Vetter wrote: > On Fri, Nov 24, 2017 at 06:53:25PM +0100, Michał Mirosław wrote: > > This series cleans up duplicated code for replacing firmware FB > > driver with proper DRI driver and adds handover support to > > Tegra driver. > > > > The last

Re: [PATCH v18 05/10] xbitmap: add more operations

2017-12-01 Thread Wei Wang
On 11/30/2017 06:34 PM, Tetsuo Handa wrote: Wei Wang wrote: + * @start: the start of the bit range, inclusive + * @end: the end of the bit range, inclusive + * + * This function is used to clear a bit in the xbitmap. If all the bits of the + * bitmap are 0, the bitmap will be freed. + */ +void

Re: [PATCH v18 06/10] virtio_ring: add a new API, virtqueue_add_one_desc

2017-12-01 Thread Wei Wang
On 12/01/2017 03:38 AM, Michael S. Tsirkin wrote: On Wed, Nov 29, 2017 at 09:55:22PM +0800, Wei Wang wrote: Current virtqueue_add API implementation is based on the scatterlist struct, which uses kaddr. This is inadequate to all the use case of vring. For example: - Some usages don't use IOMMU,

[PATCH tip/core/rcu 21/21] drivers/vhost: Remove now-redundant read_barrier_depends()

2017-12-01 Thread Paul E. McKenney
Because READ_ONCE() now implies read_barrier_depends(), the read_barrier_depends() in next_desc() is now redundant. This commit therefore removes it and the related comments. Signed-off-by: Paul E. McKenney Cc: "Michael S. Tsirkin" Cc: Jason Wang

[PATCH] virtio_mmio: add cleanup for virtio_mmio_probe

2017-12-01 Thread weiping zhang
cleanup all resource allocated by virtio_mmio_probe. Signed-off-by: weiping zhang --- drivers/virtio/virtio_mmio.c | 34 ++ 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/drivers/virtio/virtio_mmio.c

Re: [PATCH v18 05/10] xbitmap: add more operations

2017-12-01 Thread Matthew Wilcox
On Fri, Dec 01, 2017 at 10:02:01PM +0900, Tetsuo Handa wrote: > If start == end is legal, > >for (; start < end; start = (start | (IDA_BITMAP_BITS - 1)) + 1) { > > makes this loop do nothing because 10 < 10 is false. ... and this is why we add tests to the test-suite!

Memory corruption in powerpc guests with virtio_balloon (was Re: [PATCH v3] virtio_balloon: fix deadlock on OOM)

2017-12-01 Thread Michael Ellerman
"Michael S. Tsirkin" writes: > fill_balloon doing memory allocations under balloon_lock > can cause a deadlock when leak_balloon is called from > virtballoon_oom_notify and tries to take same lock. > > To fix, split page allocation and enqueue and do allocations outside the

Re: [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()

2017-12-01 Thread Sudip Mukherjee
On Fri, Dec 01, 2017 at 08:19:16AM +0100, Daniel Vetter wrote: > On Thu, Nov 30, 2017 at 11:49:53PM +, Sudip Mukherjee wrote: > > Hi Daniel, > > > > > > > > > > > > > > > > > > Greg? > > > > > > > > > > Yes, if no one is working to get it out of staging, that means no one > > > > > cares

Re: Memory corruption in powerpc guests with virtio_balloon (was Re: [PATCH v3] virtio_balloon: fix deadlock on OOM)

2017-12-01 Thread Michael S. Tsirkin
On Fri, Dec 01, 2017 at 11:31:08PM +1100, Michael Ellerman wrote: > "Michael S. Tsirkin" writes: > > > fill_balloon doing memory allocations under balloon_lock > > can cause a deadlock when leak_balloon is called from > > virtballoon_oom_notify and tries to take same lock. > > >

Re: [PATCH net,stable v4 0/3] vhost: fix a few skb leaks

2017-12-01 Thread Michael S. Tsirkin
On Fri, Dec 01, 2017 at 09:54:02AM -0500, Matthew Rosato wrote: > On 12/01/2017 09:47 AM, Michael S. Tsirkin wrote: > > On Fri, Dec 01, 2017 at 05:10:35AM -0500, w...@redhat.com wrote: > >> From: Wei Xu > >> > >> Matthew found a roughly 40% tcp throughput regression with commit >

Re: [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()

2017-12-01 Thread Emil Velikov
On 30 November 2017 at 23:49, Sudip Mukherjee wrote: > Hi Daniel, > > On Wed, Nov 29, 2017 at 10:56:34AM +0100, Daniel Vetter wrote: >> On Tue, Nov 28, 2017 at 12:30:30PM +, Sudip Mukherjee wrote: >> > On Tue, Nov 28, 2017 at 12:32:38PM +0100, Greg KH wrote: >> > >

Re: [PATCH net,stable v4 0/3] vhost: fix a few skb leaks

2017-12-01 Thread Michael S. Tsirkin
On Fri, Dec 01, 2017 at 05:10:35AM -0500, w...@redhat.com wrote: > From: Wei Xu > > Matthew found a roughly 40% tcp throughput regression with commit > c67df11f(vhost_net: try batch dequing from skb array) as discussed > in the following thread: >

Re: [PATCH 2/3] tun: free skb in early errors

2017-12-01 Thread Michael S. Tsirkin
On Fri, Dec 01, 2017 at 05:10:37AM -0500, w...@redhat.com wrote: > From: Wei Xu > > tun_recvmsg() supports accepting skb by msg_control after > commit ac77cfd4258f ("tun: support receiving skb through msg_control"), > the skb if presented should be freed no matter how far it can

Re: [PATCH 1/3] vhost: fix skb leak in handle_rx()

2017-12-01 Thread Michael S. Tsirkin
On Fri, Dec 01, 2017 at 05:10:36AM -0500, w...@redhat.com wrote: > From: Wei Xu > > Matthew found a roughly 40% tcp throughput regression with commit > c67df11f(vhost_net: try batch dequing from skb array) as discussed > in the following thread: >

Re: [PATCH 3/3] tap: free skb if flags error

2017-12-01 Thread Michael S. Tsirkin
On Fri, Dec 01, 2017 at 05:10:38AM -0500, w...@redhat.com wrote: > From: Wei Xu > > tap_recvmsg() supports accepting skb by msg_control after > commit 3b4ba04acca8 ("tap: support receiving skb from msg_control"), > the skb if presented should be freed within the function,

Re: [PATCH v18 07/10] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-12-01 Thread Michael S. Tsirkin
On Wed, Nov 29, 2017 at 09:55:23PM +0800, Wei Wang wrote: > Add a new feature, VIRTIO_BALLOON_F_SG, which enables the transfer of > balloon (i.e. inflated/deflated) pages using scatter-gather lists to the > host. A scatter-gather list is described by a vring desc. > > The implementation of the

Re: [PATCH 1/3] vhost: fix skb leak in handle_rx()

2017-12-01 Thread Michael S. Tsirkin
On Fri, Dec 01, 2017 at 03:11:05PM +0800, Jason Wang wrote: > > > On 2017年12月01日 13:54, w...@redhat.com wrote: > > From: Wei Xu > > > > Matthew found a roughly 40% tcp throughput regression with commit > > c67df11f(vhost_net: try batch dequing from skb array) as discussed > >

Re: [PATCH 2/3] tun: free skb in early errors

2017-12-01 Thread Michael S. Tsirkin
On Fri, Dec 01, 2017 at 03:07:44PM +0800, Jason Wang wrote: > > > On 2017年12月01日 13:54, w...@redhat.com wrote: > > From: Wei Xu > > > > tun_recvmsg() supports accepting skb by msg_control after > > commit ac77cfd4258f ("tun: support receiving skb through msg_control"), > > the

RE: [PATCH v18 05/10] xbitmap: add more operations

2017-12-01 Thread Wang, Wei W
On Friday, December 1, 2017 9:02 PM, Tetsuo Handa wrote: > Wei Wang wrote: > > On 11/30/2017 06:34 PM, Tetsuo Handa wrote: > > > Wei Wang wrote: > > >> + * @start: the start of the bit range, inclusive > > >> + * @end: the end of the bit range, inclusive > > >> + * > > >> + * This function is used

Re: [PATCH v18 10/10] virtio-balloon: don't report free pages when page poisoning is enabled

2017-12-01 Thread Michael S. Tsirkin
On Wed, Nov 29, 2017 at 09:55:26PM +0800, Wei Wang wrote: > The guest free pages should not be discarded by the live migration thread > when page poisoning is enabled with PAGE_POISONING_NO_SANITY=n, because > skipping the transfer of such poisoned free pages will trigger false > positive when new

Re: [PATCH v18 05/10] xbitmap: add more operations

2017-12-01 Thread Matthew Wilcox
On Fri, Dec 01, 2017 at 03:09:08PM +, Wang, Wei W wrote: > On Friday, December 1, 2017 9:02 PM, Tetsuo Handa wrote: > > If start == end is legal, > > > >for (; start < end; start = (start | (IDA_BITMAP_BITS - 1)) + 1) { > > > > makes this loop do nothing because 10 < 10 is false. > >

Re: [PATCH] virtio: release virtio index when fail to device_register

2017-12-01 Thread weiping zhang
2017-12-02 0:55 GMT+08:00 weiping zhang : > On Wed, Nov 29, 2017 at 10:50:44AM +0100, Cornelia Huck wrote: >> On Wed, 29 Nov 2017 09:23:01 +0800 >> weiping zhang wrote: >> >> > index can be reused by other virtio device. >> > >> > Signed-off-by: weiping