From: "Michael S. Tsirkin" <mst-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Dan Williams <dcbw-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org,
davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org,
Jason Wang <jasowang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Zhi Yong Wu
<wuzhy-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>,
Tom Herbert <therbert-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
Ben Hutchings <ben-/+tVBieCtBitmTQ+vhA3Yw@public.gmane.org>,
Masatake YAMATO <yamato-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Xi Wang <xii-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/3] tun: move internal flag defines out of uapi
Date: Wed, 19 Nov 2014 19:08:35 +0200 [thread overview]
Message-ID: <20141119170835.GA29928@redhat.com> (raw)
In-Reply-To: <20141119165017.GA29759-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
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
> >
next prev parent reply other threads:[~2014-11-19 17:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[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 [this message]
2014-11-19 17:11 ` Dan Williams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141119170835.GA29928@redhat.com \
--to=mst-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=ben-/+tVBieCtBitmTQ+vhA3Yw@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=dcbw-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=jasowang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org \
--cc=therbert-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=wuzhy-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
--cc=xii-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=yamato-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).