Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1492368 > unrolled thread

[PATCH v5] net: ip, diag -- Add diag interface for raw sockets

Started byCyrill Gorcunov <gorcunov@gmail.com>
First post2016-09-28 11:10 +0200
Last post2016-09-28 15:10 +0200
Articles 7 on this page of 27 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v5] net: ip, diag -- Add diag interface for raw sockets Cyrill Gorcunov <gorcunov@gmail.com> - 2016-09-28 11:10 +0200
    Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets Jamal Hadi Salim <jhs@mojatatu.com> - 2016-09-28 12:10 +0200
      Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets Cyrill Gorcunov <gorcunov@gmail.com> - 2016-09-28 12:20 +0200
        Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets Jamal Hadi Salim <jhs@mojatatu.com> - 2016-09-28 12:50 +0200
          Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets Cyrill Gorcunov <gorcunov@gmail.com> - 2016-09-28 13:00 +0200
            Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets Jamal Hadi Salim <jhs@mojatatu.com> - 2016-09-28 13:10 +0200
              Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets Cyrill Gorcunov <gorcunov@gmail.com> - 2016-09-28 13:30 +0200
                Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets Jamal Hadi Salim <jhs@mojatatu.com> - 2016-09-28 14:10 +0200
                  Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets David Miller <davem@davemloft.net> - 2016-09-28 14:20 +0200
                  Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets Cyrill Gorcunov <gorcunov@gmail.com> - 2016-09-28 14:30 +0200
                Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets David Miller <davem@davemloft.net> - 2016-09-28 14:10 +0200
                  Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets Cyrill Gorcunov <gorcunov@gmail.com> - 2016-09-28 14:20 +0200
                  Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets David Miller <davem@davemloft.net> - 2016-09-28 14:20 +0200
                    Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets Jamal Hadi Salim <jhs@mojatatu.com> - 2016-09-28 14:30 +0200
                      Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets Jamal Hadi Salim <jhs@mojatatu.com> - 2016-09-28 14:40 +0200
                      Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets Cyrill Gorcunov <gorcunov@gmail.com> - 2016-09-28 14:50 +0200
                        Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets Cyrill Gorcunov <gorcunov@gmail.com> - 2016-09-28 15:00 +0200
                        Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets Jamal Hadi Salim <jhs@mojatatu.com> - 2016-09-28 15:00 +0200
                  Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets Jamal Hadi Salim <jhs@mojatatu.com> - 2016-09-28 14:20 +0200
                Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets Eric Dumazet <eric.dumazet@gmail.com> - 2016-09-28 15:00 +0200
                  Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets Cyrill Gorcunov <gorcunov@gmail.com> - 2016-09-28 15:10 +0200
                  Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets Cyrill Gorcunov <gorcunov@gmail.com> - 2016-09-28 15:10 +0200
                    Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets Eric Dumazet <eric.dumazet@gmail.com> - 2016-09-28 15:30 +0200
                      Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets Cyrill Gorcunov <gorcunov@gmail.com> - 2016-09-28 15:50 +0200
                        Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets Eric Dumazet <eric.dumazet@gmail.com> - 2016-09-28 16:00 +0200
                          Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets Cyrill Gorcunov <gorcunov@gmail.com> - 2016-09-28 17:00 +0200
                  Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets Eric Dumazet <eric.dumazet@gmail.com> - 2016-09-28 15:10 +0200

Page 2 of 2 — ← Prev page 1 [2]


#1492585

FromCyrill Gorcunov <gorcunov@gmail.com>
Date2016-09-28 15:10 +0200
Message-ID<smmMx-70o-1@gated-at.bofh.it>
In reply to#1492583
On Wed, Sep 28, 2016 at 06:02:11AM -0700, Eric Dumazet wrote:
> 
> This is a bit different of course, since struct tc_fq_qd_stats is only
> one way : Kernel produces the content and gives it to user space.
> 
> User space should probably not need to initialize such a structure, but
> who knows what a programmer can write ;)

It's the same issue as I have: the users may have initialized tc_fq_qd_stats for
some reson. But since nobody complained yet about such change -- it is a good
sign of catching the luck :)

You know at the moment I'm not sure how to be then -- either leave it as
uninon, either rename it (via patch on top), or even simply require the
protocol to be passed as additional data in netlink packet...

[toc] | [prev] | [next] | [standalone]


#1492586

FromCyrill Gorcunov <gorcunov@gmail.com>
Date2016-09-28 15:10 +0200
Message-ID<smmMx-70o-5@gated-at.bofh.it>
In reply to#1492583
On Wed, Sep 28, 2016 at 05:57:12AM -0700, Eric Dumazet wrote:
...
> Note that some programs could fail to compile with the added union
> anyway.
> 
> Some gcc versions are unable to compile a static init with an union
> 
> struct inet_diag_req_v2 foo = { .pad = 0, sdiag_family = AF_INET, };
> 
> When I cooked my recent fq commit I simply removed a pad and replaced
> it :
> 
> git show fefa569a9d4bc4 -- include

Oh, crap :( I've been looking into uapi headers, found that we
use anonymous unions (for example include/uapi/linux/bcache.h)
and thought it will be safe (and my test builds didn't fail).
Are you happen to know which gcc versions cant do that?

[toc] | [prev] | [next] | [standalone]


#1492596

FromEric Dumazet <eric.dumazet@gmail.com>
Date2016-09-28 15:30 +0200
Message-ID<smn5U-7hG-15@gated-at.bofh.it>
In reply to#1492586
On Wed, 2016-09-28 at 16:03 +0300, Cyrill Gorcunov wrote:
> On Wed, Sep 28, 2016 at 05:57:12AM -0700, Eric Dumazet wrote:
> ...
> > Note that some programs could fail to compile with the added union
> > anyway.
> > 
> > Some gcc versions are unable to compile a static init with an union
> > 
> > struct inet_diag_req_v2 foo = { .pad = 0, sdiag_family = AF_INET, };
> > 
> > When I cooked my recent fq commit I simply removed a pad and replaced
> > it :
> > 
> > git show fefa569a9d4bc4 -- include
> 
> Oh, crap :( I've been looking into uapi headers, found that we
> use anonymous unions (for example include/uapi/linux/bcache.h)
> and thought it will be safe (and my test builds didn't fail).
> Are you happen to know which gcc versions cant do that?

The most recent example I have in mind is a kbuild bot report on the
recent TCP BBR patches. We had to rework the patch to avoid the problem.

If I remember well, this was a gcc-4.7, but not on x86.

[toc] | [prev] | [next] | [standalone]


#1492612

FromCyrill Gorcunov <gorcunov@gmail.com>
Date2016-09-28 15:50 +0200
Message-ID<smnpf-7q5-9@gated-at.bofh.it>
In reply to#1492596
On Wed, Sep 28, 2016 at 06:29:08AM -0700, Eric Dumazet wrote:
> > 
> > Oh, crap :( I've been looking into uapi headers, found that we
> > use anonymous unions (for example include/uapi/linux/bcache.h)
> > and thought it will be safe (and my test builds didn't fail).
> > Are you happen to know which gcc versions cant do that?
> 
> The most recent example I have in mind is a kbuild bot report on the
> recent TCP BBR patches. We had to rework the patch to avoid the problem.
> 
> If I remember well, this was a gcc-4.7, but not on x86.

4.7 is pretty widespread, so I've to think...

[toc] | [prev] | [next] | [standalone]


#1492616

FromEric Dumazet <eric.dumazet@gmail.com>
Date2016-09-28 16:00 +0200
Message-ID<smnyV-7th-23@gated-at.bofh.it>
In reply to#1492612
On Wed, 2016-09-28 at 16:43 +0300, Cyrill Gorcunov wrote:
> On Wed, Sep 28, 2016 at 06:29:08AM -0700, Eric Dumazet wrote:
> > > 
> > > Oh, crap :( I've been looking into uapi headers, found that we
> > > use anonymous unions (for example include/uapi/linux/bcache.h)
> > > and thought it will be safe (and my test builds didn't fail).
> > > Are you happen to know which gcc versions cant do that?
> > 
> > The most recent example I have in mind is a kbuild bot report on the
> > recent TCP BBR patches. We had to rework the patch to avoid the problem.
> > 
> > If I remember well, this was a gcc-4.7, but not on x86.
> 
> 4.7 is pretty widespread, so I've to think...

Sorry, 4.4.7 it was

https://www.mail-archive.com/netdev@vger.kernel.org/msg128714.html

[toc] | [prev] | [next] | [standalone]


#1492641

FromCyrill Gorcunov <gorcunov@gmail.com>
Date2016-09-28 17:00 +0200
Message-ID<smouZ-82i-11@gated-at.bofh.it>
In reply to#1492616
On Wed, Sep 28, 2016 at 06:49:51AM -0700, Eric Dumazet wrote:
> > 
> > 4.7 is pretty widespread, so I've to think...
> 
> Sorry, 4.4.7 it was
> 
> https://www.mail-archive.com/netdev@vger.kernel.org/msg128714.html

Ah, thanks for info!

[toc] | [prev] | [next] | [standalone]


#1492588

FromEric Dumazet <eric.dumazet@gmail.com>
Date2016-09-28 15:10 +0200
Message-ID<smmMx-70o-3@gated-at.bofh.it>
In reply to#1492583
On Wed, 2016-09-28 at 05:57 -0700, Eric Dumazet wrote:

> Note that some programs could fail to compile with the added union
> anyway.
> 
> Some gcc versions are unable to compile a static init with an union
> 
> struct inet_diag_req_v2 foo = { .pad = 0, sdiag_family = AF_INET, };
> 
> When I cooked my recent fq commit I simply removed a pad and replaced
> it :
> 
> git show fefa569a9d4bc4 -- include

This is a bit different of course, since struct tc_fq_qd_stats is only
one way : Kernel produces the content and gives it to user space.

User space should probably not need to initialize such a structure, but
who knows what a programmer can write ;)

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | linux.kernel


csiph-web