* [PATCH 1/3] tun: move internal flag defines out of uapi
[not found] ` <1416413891-29562-1-git-send-email-mst-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2014-11-19 16:18 ` Michael S. Tsirkin
[not found] ` <1416413891-29562-2-git-send-email-mst-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Michael S. Tsirkin @ 2014-11-19 16:18 UTC (permalink / raw)
To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: rusty-8n+1lVoiYb80n/F98K4Iww, davem-fT/PcQaiUtIeIZ0/mPfg9Q,
Jason Wang, Zhi Yong Wu, Tom Herbert, Ben Hutchings,
Masatake YAMATO, Xi Wang, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-api-u79uwXL29TY76Z2rM5mHXA
TUN_ flags are internal and never exposed
to userspace. Any application using it is almost
certainly buggy.
Move them out to tun.c, we'll remove them in follow-up patches.
Signed-off-by: Michael S. Tsirkin <mst-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
include/uapi/linux/if_tun.h | 14 --------------
drivers/net/tun.c | 14 ++++++++++++++
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/include/uapi/linux/if_tun.h b/include/uapi/linux/if_tun.h
index e9502dd..b82c276 100644
--- a/include/uapi/linux/if_tun.h
+++ b/include/uapi/linux/if_tun.h
@@ -23,20 +23,6 @@
/* Read queue size */
#define TUN_READQ_SIZE 500
-/* TUN device flags */
-#define TUN_TUN_DEV 0x0001
-#define TUN_TAP_DEV 0x0002
-#define TUN_TYPE_MASK 0x000f
-
-#define TUN_FASYNC 0x0010
-#define TUN_NOCHECKSUM 0x0020
-#define TUN_NO_PI 0x0040
-/* This flag has no real effect */
-#define TUN_ONE_QUEUE 0x0080
-#define TUN_PERSIST 0x0100
-#define TUN_VNET_HDR 0x0200
-#define TUN_TAP_MQ 0x0400
-
/* Ioctl defines */
#define TUNSETNOCSUM _IOW('T', 200, int)
#define TUNSETDEBUG _IOW('T', 201, int)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 2e18ddd..81735f5 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -103,6 +103,20 @@ do { \
} while (0)
#endif
+/* TUN device flags */
+#define TUN_TUN_DEV 0x0001
+#define TUN_TAP_DEV 0x0002
+#define TUN_TYPE_MASK 0x000f
+
+#define TUN_FASYNC 0x0010
+#define TUN_NOCHECKSUM 0x0020
+#define TUN_NO_PI 0x0040
+/* This flag has no real effect */
+#define TUN_ONE_QUEUE 0x0080
+#define TUN_PERSIST 0x0100
+#define TUN_VNET_HDR 0x0200
+#define TUN_TAP_MQ 0x0400
+
#define GOODCOPY_LEN 128
#define FLT_EXACT_COUNT 8
--
MST
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/3] tun: move internal flag defines out of uapi
[not found] ` <1416413891-29562-2-git-send-email-mst-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2014-11-19 16:47 ` Dan Williams
2014-11-19 16:50 ` Michael S. Tsirkin
0 siblings, 1 reply; 5+ messages in thread
From: Dan Williams @ 2014-11-19 16:47 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, rusty-8n+1lVoiYb80n/F98K4Iww,
davem-fT/PcQaiUtIeIZ0/mPfg9Q, Jason Wang, Zhi Yong Wu,
Tom Herbert, Ben Hutchings, Masatake YAMATO, Xi Wang,
netdev-u79uwXL29TY76Z2rM5mHXA, linux-api-u79uwXL29TY76Z2rM5mHXA
On Wed, 2014-11-19 at 18:18 +0200, Michael S. Tsirkin wrote:
> TUN_ flags are internal and never exposed
> to userspace. Any application using it is almost
> certainly buggy.
Except for TUN_TUN_DEV and TUN_TAP_DEV and TUN_TYPE_MASK... which we're
using (for some reason) in NetworkManager, though I'll happily convert
those to IFF_* instead. It might be worth #defining those to their
IFF_* equivalents since their usage is not technically broken.
Dan
> Move them out to tun.c, we'll remove them in follow-up patches.
> Signed-off-by: Michael S. Tsirkin <mst-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
> include/uapi/linux/if_tun.h | 14 --------------
> drivers/net/tun.c | 14 ++++++++++++++
> 2 files changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/include/uapi/linux/if_tun.h b/include/uapi/linux/if_tun.h
> index e9502dd..b82c276 100644
> --- a/include/uapi/linux/if_tun.h
> +++ b/include/uapi/linux/if_tun.h
> @@ -23,20 +23,6 @@
> /* Read queue size */
> #define TUN_READQ_SIZE 500
>
> -/* TUN device flags */
> -#define TUN_TUN_DEV 0x0001
> -#define TUN_TAP_DEV 0x0002
> -#define TUN_TYPE_MASK 0x000f
> -
> -#define TUN_FASYNC 0x0010
> -#define TUN_NOCHECKSUM 0x0020
> -#define TUN_NO_PI 0x0040
> -/* This flag has no real effect */
> -#define TUN_ONE_QUEUE 0x0080
> -#define TUN_PERSIST 0x0100
> -#define TUN_VNET_HDR 0x0200
> -#define TUN_TAP_MQ 0x0400
> -
> /* Ioctl defines */
> #define TUNSETNOCSUM _IOW('T', 200, int)
> #define TUNSETDEBUG _IOW('T', 201, int)
> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> index 2e18ddd..81735f5 100644
> --- a/drivers/net/tun.c
> +++ b/drivers/net/tun.c
> @@ -103,6 +103,20 @@ do { \
> } while (0)
> #endif
>
> +/* TUN device flags */
> +#define TUN_TUN_DEV 0x0001
> +#define TUN_TAP_DEV 0x0002
> +#define TUN_TYPE_MASK 0x000f
> +
> +#define TUN_FASYNC 0x0010
> +#define TUN_NOCHECKSUM 0x0020
> +#define TUN_NO_PI 0x0040
> +/* This flag has no real effect */
> +#define TUN_ONE_QUEUE 0x0080
> +#define TUN_PERSIST 0x0100
> +#define TUN_VNET_HDR 0x0200
> +#define TUN_TAP_MQ 0x0400
> +
> #define GOODCOPY_LEN 128
>
> #define FLT_EXACT_COUNT 8
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/3] tun: move internal flag defines out of uapi
2014-11-19 16:47 ` Dan Williams
@ 2014-11-19 16:50 ` Michael S. Tsirkin
[not found] ` <20141119165017.GA29759-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Michael S. Tsirkin @ 2014-11-19 16:50 UTC (permalink / raw)
To: Dan Williams
Cc: linux-kernel, rusty, davem, Jason Wang, Zhi Yong Wu, Tom Herbert,
Ben Hutchings, Masatake YAMATO, Xi Wang, netdev, linux-api
On Wed, Nov 19, 2014 at 10:47:14AM -0600, Dan Williams wrote:
> On Wed, 2014-11-19 at 18:18 +0200, Michael S. Tsirkin wrote:
> > TUN_ flags are internal and never exposed
> > to userspace. Any application using it is almost
> > certainly buggy.
>
> Except for TUN_TUN_DEV and TUN_TAP_DEV and TUN_TYPE_MASK... which we're
> using (for some reason) in NetworkManager, though I'll happily convert
> those to IFF_* instead. It might be worth #defining those to their
> IFF_* equivalents since their usage is not technically broken.
>
> Dan
Hmm you are right, they happen to have the same value.
I'll send v2 leaving these in place.
> > Move them out to tun.c, we'll remove them in follow-up patches.
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > ---
> > include/uapi/linux/if_tun.h | 14 --------------
> > drivers/net/tun.c | 14 ++++++++++++++
> > 2 files changed, 14 insertions(+), 14 deletions(-)
> >
> > diff --git a/include/uapi/linux/if_tun.h b/include/uapi/linux/if_tun.h
> > index e9502dd..b82c276 100644
> > --- a/include/uapi/linux/if_tun.h
> > +++ b/include/uapi/linux/if_tun.h
> > @@ -23,20 +23,6 @@
> > /* Read queue size */
> > #define TUN_READQ_SIZE 500
> >
> > -/* TUN device flags */
> > -#define TUN_TUN_DEV 0x0001
> > -#define TUN_TAP_DEV 0x0002
> > -#define TUN_TYPE_MASK 0x000f
> > -
> > -#define TUN_FASYNC 0x0010
> > -#define TUN_NOCHECKSUM 0x0020
> > -#define TUN_NO_PI 0x0040
> > -/* This flag has no real effect */
> > -#define TUN_ONE_QUEUE 0x0080
> > -#define TUN_PERSIST 0x0100
> > -#define TUN_VNET_HDR 0x0200
> > -#define TUN_TAP_MQ 0x0400
> > -
> > /* Ioctl defines */
> > #define TUNSETNOCSUM _IOW('T', 200, int)
> > #define TUNSETDEBUG _IOW('T', 201, int)
> > diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> > index 2e18ddd..81735f5 100644
> > --- a/drivers/net/tun.c
> > +++ b/drivers/net/tun.c
> > @@ -103,6 +103,20 @@ do { \
> > } while (0)
> > #endif
> >
> > +/* TUN device flags */
> > +#define TUN_TUN_DEV 0x0001
> > +#define TUN_TAP_DEV 0x0002
> > +#define TUN_TYPE_MASK 0x000f
> > +
> > +#define TUN_FASYNC 0x0010
> > +#define TUN_NOCHECKSUM 0x0020
> > +#define TUN_NO_PI 0x0040
> > +/* This flag has no real effect */
> > +#define TUN_ONE_QUEUE 0x0080
> > +#define TUN_PERSIST 0x0100
> > +#define TUN_VNET_HDR 0x0200
> > +#define TUN_TAP_MQ 0x0400
> > +
> > #define GOODCOPY_LEN 128
> >
> > #define FLT_EXACT_COUNT 8
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/3] tun: move internal flag defines out of uapi
[not found] ` <20141119165017.GA29759-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2014-11-19 17:08 ` Michael S. Tsirkin
2014-11-19 17:11 ` Dan Williams
0 siblings, 1 reply; 5+ messages in thread
From: Michael S. Tsirkin @ 2014-11-19 17:08 UTC (permalink / raw)
To: Dan Williams
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, rusty-8n+1lVoiYb80n/F98K4Iww,
davem-fT/PcQaiUtIeIZ0/mPfg9Q, Jason Wang, Zhi Yong Wu,
Tom Herbert, Ben Hutchings, Masatake YAMATO, Xi Wang,
netdev-u79uwXL29TY76Z2rM5mHXA, linux-api-u79uwXL29TY76Z2rM5mHXA
On Wed, Nov 19, 2014 at 06:50:17PM +0200, Michael S. Tsirkin wrote:
> On Wed, Nov 19, 2014 at 10:47:14AM -0600, Dan Williams wrote:
> > On Wed, 2014-11-19 at 18:18 +0200, Michael S. Tsirkin wrote:
> > > TUN_ flags are internal and never exposed
> > > to userspace. Any application using it is almost
> > > certainly buggy.
> >
> > Except for TUN_TUN_DEV and TUN_TAP_DEV and TUN_TYPE_MASK... which we're
> > using (for some reason) in NetworkManager, though I'll happily convert
> > those to IFF_* instead. It might be worth #defining those to their
> > IFF_* equivalents since their usage is not technically broken.
> >
> > Dan
>
> Hmm you are right, they happen to have the same value.
> I'll send v2 leaving these in place.
>
Though I do think userspace shouldn't depend on them generally,
so it might be a good idea to stop using them, even though
I'll fix up my patches to avoid breaking this usecase.
> > > Move them out to tun.c, we'll remove them in follow-up patches.
> > > Signed-off-by: Michael S. Tsirkin <mst-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> > > ---
> > > include/uapi/linux/if_tun.h | 14 --------------
> > > drivers/net/tun.c | 14 ++++++++++++++
> > > 2 files changed, 14 insertions(+), 14 deletions(-)
> > >
> > > diff --git a/include/uapi/linux/if_tun.h b/include/uapi/linux/if_tun.h
> > > index e9502dd..b82c276 100644
> > > --- a/include/uapi/linux/if_tun.h
> > > +++ b/include/uapi/linux/if_tun.h
> > > @@ -23,20 +23,6 @@
> > > /* Read queue size */
> > > #define TUN_READQ_SIZE 500
> > >
> > > -/* TUN device flags */
> > > -#define TUN_TUN_DEV 0x0001
> > > -#define TUN_TAP_DEV 0x0002
> > > -#define TUN_TYPE_MASK 0x000f
> > > -
> > > -#define TUN_FASYNC 0x0010
> > > -#define TUN_NOCHECKSUM 0x0020
> > > -#define TUN_NO_PI 0x0040
> > > -/* This flag has no real effect */
> > > -#define TUN_ONE_QUEUE 0x0080
> > > -#define TUN_PERSIST 0x0100
> > > -#define TUN_VNET_HDR 0x0200
> > > -#define TUN_TAP_MQ 0x0400
> > > -
> > > /* Ioctl defines */
> > > #define TUNSETNOCSUM _IOW('T', 200, int)
> > > #define TUNSETDEBUG _IOW('T', 201, int)
> > > diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> > > index 2e18ddd..81735f5 100644
> > > --- a/drivers/net/tun.c
> > > +++ b/drivers/net/tun.c
> > > @@ -103,6 +103,20 @@ do { \
> > > } while (0)
> > > #endif
> > >
> > > +/* TUN device flags */
> > > +#define TUN_TUN_DEV 0x0001
> > > +#define TUN_TAP_DEV 0x0002
> > > +#define TUN_TYPE_MASK 0x000f
> > > +
> > > +#define TUN_FASYNC 0x0010
> > > +#define TUN_NOCHECKSUM 0x0020
> > > +#define TUN_NO_PI 0x0040
> > > +/* This flag has no real effect */
> > > +#define TUN_ONE_QUEUE 0x0080
> > > +#define TUN_PERSIST 0x0100
> > > +#define TUN_VNET_HDR 0x0200
> > > +#define TUN_TAP_MQ 0x0400
> > > +
> > > #define GOODCOPY_LEN 128
> > >
> > > #define FLT_EXACT_COUNT 8
> >
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/3] tun: move internal flag defines out of uapi
2014-11-19 17:08 ` Michael S. Tsirkin
@ 2014-11-19 17:11 ` Dan Williams
0 siblings, 0 replies; 5+ messages in thread
From: Dan Williams @ 2014-11-19 17:11 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: linux-kernel, rusty, davem, Jason Wang, Zhi Yong Wu, Tom Herbert,
Ben Hutchings, Masatake YAMATO, Xi Wang, netdev, linux-api
On Wed, 2014-11-19 at 19:08 +0200, Michael S. Tsirkin wrote:
> On Wed, Nov 19, 2014 at 06:50:17PM +0200, Michael S. Tsirkin wrote:
> > On Wed, Nov 19, 2014 at 10:47:14AM -0600, Dan Williams wrote:
> > > On Wed, 2014-11-19 at 18:18 +0200, Michael S. Tsirkin wrote:
> > > > TUN_ flags are internal and never exposed
> > > > to userspace. Any application using it is almost
> > > > certainly buggy.
> > >
> > > Except for TUN_TUN_DEV and TUN_TAP_DEV and TUN_TYPE_MASK... which we're
> > > using (for some reason) in NetworkManager, though I'll happily convert
> > > those to IFF_* instead. It might be worth #defining those to their
> > > IFF_* equivalents since their usage is not technically broken.
> > >
> > > Dan
> >
> > Hmm you are right, they happen to have the same value.
> > I'll send v2 leaving these in place.
> >
>
> Though I do think userspace shouldn't depend on them generally,
> so it might be a good idea to stop using them, even though
> I'll fix up my patches to avoid breaking this usecase.
Yeah, I'm doing an NM patch right now to use IFF_*.
Dan
>
>
> > > > Move them out to tun.c, we'll remove them in follow-up patches.
> > > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > > > ---
> > > > include/uapi/linux/if_tun.h | 14 --------------
> > > > drivers/net/tun.c | 14 ++++++++++++++
> > > > 2 files changed, 14 insertions(+), 14 deletions(-)
> > > >
> > > > diff --git a/include/uapi/linux/if_tun.h b/include/uapi/linux/if_tun.h
> > > > index e9502dd..b82c276 100644
> > > > --- a/include/uapi/linux/if_tun.h
> > > > +++ b/include/uapi/linux/if_tun.h
> > > > @@ -23,20 +23,6 @@
> > > > /* Read queue size */
> > > > #define TUN_READQ_SIZE 500
> > > >
> > > > -/* TUN device flags */
> > > > -#define TUN_TUN_DEV 0x0001
> > > > -#define TUN_TAP_DEV 0x0002
> > > > -#define TUN_TYPE_MASK 0x000f
> > > > -
> > > > -#define TUN_FASYNC 0x0010
> > > > -#define TUN_NOCHECKSUM 0x0020
> > > > -#define TUN_NO_PI 0x0040
> > > > -/* This flag has no real effect */
> > > > -#define TUN_ONE_QUEUE 0x0080
> > > > -#define TUN_PERSIST 0x0100
> > > > -#define TUN_VNET_HDR 0x0200
> > > > -#define TUN_TAP_MQ 0x0400
> > > > -
> > > > /* Ioctl defines */
> > > > #define TUNSETNOCSUM _IOW('T', 200, int)
> > > > #define TUNSETDEBUG _IOW('T', 201, int)
> > > > diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> > > > index 2e18ddd..81735f5 100644
> > > > --- a/drivers/net/tun.c
> > > > +++ b/drivers/net/tun.c
> > > > @@ -103,6 +103,20 @@ do { \
> > > > } while (0)
> > > > #endif
> > > >
> > > > +/* TUN device flags */
> > > > +#define TUN_TUN_DEV 0x0001
> > > > +#define TUN_TAP_DEV 0x0002
> > > > +#define TUN_TYPE_MASK 0x000f
> > > > +
> > > > +#define TUN_FASYNC 0x0010
> > > > +#define TUN_NOCHECKSUM 0x0020
> > > > +#define TUN_NO_PI 0x0040
> > > > +/* This flag has no real effect */
> > > > +#define TUN_ONE_QUEUE 0x0080
> > > > +#define TUN_PERSIST 0x0100
> > > > +#define TUN_VNET_HDR 0x0200
> > > > +#define TUN_TAP_MQ 0x0400
> > > > +
> > > > #define GOODCOPY_LEN 128
> > > >
> > > > #define FLT_EXACT_COUNT 8
> > >
> --
> 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] 5+ messages in thread
end of thread, other threads:[~2014-11-19 17:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1416413891-29562-1-git-send-email-mst@redhat.com>
[not found] ` <1416413891-29562-1-git-send-email-mst-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-11-19 16:18 ` [PATCH 1/3] tun: move internal flag defines out of uapi Michael S. Tsirkin
[not found] ` <1416413891-29562-2-git-send-email-mst-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-11-19 16:47 ` Dan Williams
2014-11-19 16:50 ` Michael S. Tsirkin
[not found] ` <20141119165017.GA29759-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-11-19 17:08 ` Michael S. Tsirkin
2014-11-19 17:11 ` Dan Williams
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).