netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] tuntap: correct the return value in tun_set_iff()
@ 2013-04-23  6:40 Jason Wang
  2013-04-23  7:23 ` Jerry Chu
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jason Wang @ 2013-04-23  6:40 UTC (permalink / raw)
  To: davem, netdev, linux-kernel
  Cc: Jason Wang, Jerry Chu, Wei Yongjun, Eric Dumazet

commit (3be8fbab tuntap: fix error return code in tun_set_iff()) breaks the
creation of multiqueue tuntap since it forbids to create more than one queues
for a multiqueue tuntap device. We need return 0 instead -EBUSY here since we
don't want to re-initialize the device when one or more queues has been already
attached. Add a comment and correct the return value to zero.

Reported-by: Jerry Chu <hkchu@google.com>
Cc: Jerry Chu <hkchu@google.com>
Cc: Wei Yongjun <weiyj.lk@gmail.com>
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 drivers/net/tun.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 729ed53..3a8977e 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1594,7 +1594,10 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
 
 		if (tun->flags & TUN_TAP_MQ &&
 		    (tun->numqueues + tun->numdisabled > 1))
-			return -EBUSY;
+			/* One or more queue has already been attached, no need
+			 * to initialize the device again.
+			 */
+			return 0;
 	}
 	else {
 		char *name;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net] tuntap: correct the return value in tun_set_iff()
  2013-04-23  6:40 [PATCH net] tuntap: correct the return value in tun_set_iff() Jason Wang
@ 2013-04-23  7:23 ` Jerry Chu
  2013-04-24  8:16 ` Michael S. Tsirkin
  2013-04-25  5:49 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Jerry Chu @ 2013-04-23  7:23 UTC (permalink / raw)
  To: Jason Wang
  Cc: David Miller, netdev@vger.kernel.org, linux-kernel, Wei Yongjun,
	Eric Dumazet

On Mon, Apr 22, 2013 at 11:40 PM, Jason Wang <jasowang@redhat.com> wrote:
> commit (3be8fbab tuntap: fix error return code in tun_set_iff()) breaks the
> creation of multiqueue tuntap since it forbids to create more than one queues
> for a multiqueue tuntap device. We need return 0 instead -EBUSY here since we
> don't want to re-initialize the device when one or more queues has been already
> attached. Add a comment and correct the return value to zero.
>
> Reported-by: Jerry Chu <hkchu@google.com>
> Cc: Jerry Chu <hkchu@google.com>
> Cc: Wei Yongjun <weiyj.lk@gmail.com>
> Cc: Eric Dumazet <edumazet@google.com>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
>  drivers/net/tun.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> index 729ed53..3a8977e 100644
> --- a/drivers/net/tun.c
> +++ b/drivers/net/tun.c
> @@ -1594,7 +1594,10 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
>
>                 if (tun->flags & TUN_TAP_MQ &&
>                     (tun->numqueues + tun->numdisabled > 1))
> -                       return -EBUSY;
> +                       /* One or more queue has already been attached, no need
> +                        * to initialize the device again.
> +                        */
> +                       return 0;
>         }
>         else {
>                 char *name;
> --
> 1.7.1
>

Acked-by:  Jerry Chu <hkchu@google.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] tuntap: correct the return value in tun_set_iff()
  2013-04-23  6:40 [PATCH net] tuntap: correct the return value in tun_set_iff() Jason Wang
  2013-04-23  7:23 ` Jerry Chu
@ 2013-04-24  8:16 ` Michael S. Tsirkin
  2013-04-25  5:49 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2013-04-24  8:16 UTC (permalink / raw)
  To: Jason Wang
  Cc: davem, netdev, linux-kernel, Jerry Chu, Wei Yongjun, Eric Dumazet

On Tue, Apr 23, 2013 at 02:40:39PM +0800, Jason Wang wrote:
> commit (3be8fbab tuntap: fix error return code in tun_set_iff()) breaks the
> creation of multiqueue tuntap since it forbids to create more than one queues
> for a multiqueue tuntap device. We need return 0 instead -EBUSY here since we
> don't want to re-initialize the device when one or more queues has been already
> attached. Add a comment and correct the return value to zero.
> 
> Reported-by: Jerry Chu <hkchu@google.com>
> Cc: Jerry Chu <hkchu@google.com>
> Cc: Wei Yongjun <weiyj.lk@gmail.com>
> Cc: Eric Dumazet <edumazet@google.com>
> Signed-off-by: Jason Wang <jasowang@redhat.com>

Acked-by: Michael S. Tsirkin <mst@redhat.com>

> ---
>  drivers/net/tun.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> index 729ed53..3a8977e 100644
> --- a/drivers/net/tun.c
> +++ b/drivers/net/tun.c
> @@ -1594,7 +1594,10 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
>  
>  		if (tun->flags & TUN_TAP_MQ &&
>  		    (tun->numqueues + tun->numdisabled > 1))
> -			return -EBUSY;
> +			/* One or more queue has already been attached, no need
> +			 * to initialize the device again.
> +			 */
> +			return 0;
>  	}
>  	else {
>  		char *name;
> -- 
> 1.7.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] tuntap: correct the return value in tun_set_iff()
  2013-04-23  6:40 [PATCH net] tuntap: correct the return value in tun_set_iff() Jason Wang
  2013-04-23  7:23 ` Jerry Chu
  2013-04-24  8:16 ` Michael S. Tsirkin
@ 2013-04-25  5:49 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2013-04-25  5:49 UTC (permalink / raw)
  To: jasowang; +Cc: netdev, linux-kernel, hkchu, weiyj.lk, edumazet

From: Jason Wang <jasowang@redhat.com>
Date: Tue, 23 Apr 2013 14:40:39 +0800

> commit (3be8fbab tuntap: fix error return code in tun_set_iff()) breaks the
> creation of multiqueue tuntap since it forbids to create more than one queues
> for a multiqueue tuntap device. We need return 0 instead -EBUSY here since we
> don't want to re-initialize the device when one or more queues has been already
> attached. Add a comment and correct the return value to zero.
> 
> Reported-by: Jerry Chu <hkchu@google.com>
> Cc: Jerry Chu <hkchu@google.com>
> Cc: Wei Yongjun <weiyj.lk@gmail.com>
> Cc: Eric Dumazet <edumazet@google.com>
> Signed-off-by: Jason Wang <jasowang@redhat.com>

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-04-25  5:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-23  6:40 [PATCH net] tuntap: correct the return value in tun_set_iff() Jason Wang
2013-04-23  7:23 ` Jerry Chu
2013-04-24  8:16 ` Michael S. Tsirkin
2013-04-25  5:49 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).