Re: [PATCH net V5] virtio-net: validate features during probe

2014-11-20 Thread David Miller
From: Jason Wang Date: Thu, 20 Nov 2014 17:03:05 +0800 > We currently trigger BUG when VIRTIO_NET_F_CTRL_VQ > is not set but one of features depending on it is. > That's not a friendly way to report errors to > hypervisors. > Let's check, and fail probe instead. > > Cc: Rusty Russell > Cc: Corn

Re: [PATCH v2 net 1/2] drivers/net: Disable UFO through virtio

2014-11-20 Thread Jason Wang
On 11/19/2014 05:14 PM, Michael S. Tsirkin wrote: > On Thu, Oct 30, 2014 at 06:27:12PM +, Ben Hutchings wrote: >> > IPv6 does not allow fragmentation by routers, so there is no >> > fragmentation ID in the fixed header. UFO for IPv6 requires the ID to >> > be passed separately, but there is no

Re: [PATCH v3] virtio_balloon: Convert "vballoon" kthread into a workqueue

2014-11-20 Thread Petr Mladek
On Thu 2014-11-20 19:00:16, Michael S. Tsirkin wrote: > On Thu, Nov 20, 2014 at 05:55:58PM +0100, Petr Mladek wrote: > > On Thu 2014-11-20 11:29:35, Tejun Heo wrote: > > > On Thu, Nov 20, 2014 at 06:26:24PM +0200, Michael S. Tsirkin wrote: > > > > On Thu, Nov 20, 2014 at 06:25:43PM +0200, Michael S

Re: [PATCH v3] virtio_balloon: Convert "vballoon" kthread into a workqueue

2014-11-20 Thread Michael S. Tsirkin
On Thu, Nov 20, 2014 at 05:55:58PM +0100, Petr Mladek wrote: > On Thu 2014-11-20 11:29:35, Tejun Heo wrote: > > On Thu, Nov 20, 2014 at 06:26:24PM +0200, Michael S. Tsirkin wrote: > > > On Thu, Nov 20, 2014 at 06:25:43PM +0200, Michael S. Tsirkin wrote: > > > > On Thu, Nov 20, 2014 at 11:07:46AM -0

Re: [PATCH v3] virtio_balloon: Convert "vballoon" kthread into a workqueue

2014-11-20 Thread Petr Mladek
On Thu 2014-11-20 11:29:35, Tejun Heo wrote: > On Thu, Nov 20, 2014 at 06:26:24PM +0200, Michael S. Tsirkin wrote: > > On Thu, Nov 20, 2014 at 06:25:43PM +0200, Michael S. Tsirkin wrote: > > > On Thu, Nov 20, 2014 at 11:07:46AM -0500, Tejun Heo wrote: > > > > On Thu, Nov 20, 2014 at 05:03:17PM +010

Re: [PATCH v3] virtio_balloon: Convert "vballoon" kthread into a workqueue

2014-11-20 Thread Michael S. Tsirkin
On Thu, Nov 20, 2014 at 11:49:33AM -0500, Tejun Heo wrote: > On Thu, Nov 20, 2014 at 06:47:11PM +0200, Michael S. Tsirkin wrote: > > > There's cancel_work_sync() to stop the self-requeueing ones. > > > > What happens if queue_work runs while cancel_work_sync is in progress? > > Does it fail to que

Re: [PATCH v3] virtio_balloon: Convert "vballoon" kthread into a workqueue

2014-11-20 Thread Tejun Heo
On Thu, Nov 20, 2014 at 11:49:33AM -0500, Tejun Heo wrote: > On Thu, Nov 20, 2014 at 06:47:11PM +0200, Michael S. Tsirkin wrote: > > > There's cancel_work_sync() to stop the self-requeueing ones. > > > > What happens if queue_work runs while cancel_work_sync is in progress? > > Does it fail to que

Re: [PATCH v3] virtio_balloon: Convert "vballoon" kthread into a workqueue

2014-11-20 Thread Tejun Heo
On Thu, Nov 20, 2014 at 06:47:11PM +0200, Michael S. Tsirkin wrote: > > There's cancel_work_sync() to stop the self-requeueing ones. > > What happens if queue_work runs while cancel_work_sync is in progress? > Does it fail to queue? cancel_work_sync() is guaranteed to take self-requeueing work it

Re: [PATCH v3] virtio_balloon: Convert "vballoon" kthread into a workqueue

2014-11-20 Thread Michael S. Tsirkin
On Thu, Nov 20, 2014 at 11:29:35AM -0500, Tejun Heo wrote: > On Thu, Nov 20, 2014 at 06:26:24PM +0200, Michael S. Tsirkin wrote: > > On Thu, Nov 20, 2014 at 06:25:43PM +0200, Michael S. Tsirkin wrote: > > > On Thu, Nov 20, 2014 at 11:07:46AM -0500, Tejun Heo wrote: > > > > On Thu, Nov 20, 2014 at 0

Re: [PATCH v3] virtio_balloon: Convert "vballoon" kthread into a workqueue

2014-11-20 Thread Tejun Heo
On Thu, Nov 20, 2014 at 06:26:24PM +0200, Michael S. Tsirkin wrote: > On Thu, Nov 20, 2014 at 06:25:43PM +0200, Michael S. Tsirkin wrote: > > On Thu, Nov 20, 2014 at 11:07:46AM -0500, Tejun Heo wrote: > > > On Thu, Nov 20, 2014 at 05:03:17PM +0100, Petr Mladek wrote: > > > ... > > > > @@ -476,7 +46

Re: [PATCH v3] virtio_balloon: Convert "vballoon" kthread into a workqueue

2014-11-20 Thread Michael S. Tsirkin
On Thu, Nov 20, 2014 at 06:25:43PM +0200, Michael S. Tsirkin wrote: > On Thu, Nov 20, 2014 at 11:07:46AM -0500, Tejun Heo wrote: > > On Thu, Nov 20, 2014 at 05:03:17PM +0100, Petr Mladek wrote: > > ... > > > @@ -476,7 +460,6 @@ static void virtballoon_remove(struct virtio_device > > > *vdev) > > >

Re: [PATCH v3] virtio_balloon: Convert "vballoon" kthread into a workqueue

2014-11-20 Thread Michael S. Tsirkin
On Thu, Nov 20, 2014 at 11:07:46AM -0500, Tejun Heo wrote: > On Thu, Nov 20, 2014 at 05:03:17PM +0100, Petr Mladek wrote: > ... > > @@ -476,7 +460,6 @@ static void virtballoon_remove(struct virtio_device > > *vdev) > > { > > struct virtio_balloon *vb = vdev->priv; > > > > - kthread_stop(v

Re: [PATCH v3] virtio_balloon: Convert "vballoon" kthread into a workqueue

2014-11-20 Thread Tejun Heo
On Thu, Nov 20, 2014 at 05:03:17PM +0100, Petr Mladek wrote: ... > @@ -476,7 +460,6 @@ static void virtballoon_remove(struct virtio_device *vdev) > { > struct virtio_balloon *vb = vdev->priv; > > - kthread_stop(vb->thread); > remove_common(vb); > kfree(vb); > } Shouldn't

[PATCH v3] virtio_balloon: Convert "vballoon" kthread into a workqueue

2014-11-20 Thread Petr Mladek
Workqueues have clean and rich API for all basic operations. The code is usually easier and better readable. It can be easily tuned for the given purpose. In many cases, it allows to avoid an extra kernel thread. It helps to stop the growing number of them. Also there will be less thread-specific

Re: [PATCH net V5] virtio-net: validate features during probe

2014-11-20 Thread Michael S. Tsirkin
On Thu, Nov 20, 2014 at 05:03:05PM +0800, Jason Wang wrote: > We currently trigger BUG when VIRTIO_NET_F_CTRL_VQ > is not set but one of features depending on it is. > That's not a friendly way to report errors to > hypervisors. > Let's check, and fail probe instead. > > Cc: Rusty Russell > Cc: C

Re: [PATCH net V5] virtio-net: validate features during probe

2014-11-20 Thread Jason Wang
On 11/20/2014 05:48 PM, Cornelia Huck wrote: > On Thu, 20 Nov 2014 17:03:05 +0800 > Jason Wang wrote: > >> We currently trigger BUG when VIRTIO_NET_F_CTRL_VQ >> is not set but one of features depending on it is. >> That's not a friendly way to report errors to >> hypervisors. >> Let's check, and f

Re: [PATCH net V5] virtio-net: validate features during probe

2014-11-20 Thread Cornelia Huck
On Thu, 20 Nov 2014 17:03:05 +0800 Jason Wang wrote: > We currently trigger BUG when VIRTIO_NET_F_CTRL_VQ > is not set but one of features depending on it is. > That's not a friendly way to report errors to > hypervisors. > Let's check, and fail probe instead. > > Cc: Rusty Russell > Cc: Cornel

[PATCH net V5] virtio-net: validate features during probe

2014-11-20 Thread Jason Wang
We currently trigger BUG when VIRTIO_NET_F_CTRL_VQ is not set but one of features depending on it is. That's not a friendly way to report errors to hypervisors. Let's check, and fail probe instead. Cc: Rusty Russell Cc: Cornelia Huck Cc: Wanlong Gao Signed-off-by: Michael S. Tsirkin Signed-off

Re: [PATCH v4 net] virtio-net: validate features during probe

2014-11-20 Thread Jason Wang
On 11/20/2014 04:27 PM, Jason Wang wrote: > We currently trigger BUG when VIRTIO_NET_F_CTRL_VQ > is not set but one of features depending on it is. > That's not a friendly way to report errors to > hypervisors. > Let's check, and fail probe instead. > > Cc: Rusty Russell > Cc: Cornelia Huck > Cc:

[PATCH v4 net] virtio-net: validate features during probe

2014-11-20 Thread Jason Wang
We currently trigger BUG when VIRTIO_NET_F_CTRL_VQ is not set but one of features depending on it is. That's not a friendly way to report errors to hypervisors. Let's check, and fail probe instead. Cc: Rusty Russell Cc: Cornelia Huck Cc: Wanlong Gao Signed-off-by: Michael S. Tsirkin Signed-off