Netdev List
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: David Ahern <dsa@cumulusnetworks.com>
Cc: netdev@vger.kernel.org, daniel@zonque.org, ast@fb.com,
	daniel@iogearbox.net, maheshb@google.com, tgraf@suug.ch
Subject: Re: [PATCH net-next v5 2/3] bpf: Add new cgroup attach type to enable sock modifications
Date: Tue, 29 Nov 2016 21:41:56 -0800	[thread overview]
Message-ID: <20161130054154.GC31581@ast-mbp.thefacebook.com> (raw)
In-Reply-To: <d3359d0c-8995-d605-cd2d-f0558fdd0408@cumulusnetworks.com>

On Tue, Nov 29, 2016 at 06:07:18PM -0700, David Ahern wrote:
> On 11/29/16 5:59 PM, Alexei Starovoitov wrote:
> > On Tue, Nov 29, 2016 at 05:43:08PM -0700, David Ahern wrote:
> >> On 11/29/16 1:01 PM, Alexei Starovoitov wrote:
> >>> Could you also expose sk_protcol and sk_type as read only fields?
> >>
> >> Those are bitfields in struct sock, so can't use offsetof or sizeof. Any existing use cases that try to load a bitfield in a bpf that I can look at?
> > 
> > pkt_type, vlan are also bitfileds in skb. Please see convert_skb_access()
> > There is a bit of ugliness due to __BIG_ENDIAN_BITFIELD though..
> > 
> 
> Given the added complexity I'd prefer to defer this second use case to a follow on patch set. This one introduces the infra for sockets and I don't see anything needing to change with it to add the read of 3 more sock elements. Agree?

I don't see a complexity. It was straightforward for skb bitfields,
but if there is some unforeseen issue, it's better to tackle it now
otherwise the feature may never come and this 'infra for sockets' will
stay as 'infra for vrf only' and I'm struggling to convince myself that it's ok.
So I'll try to tweak this patch to add these 3 fields...

  reply	other threads:[~2016-11-30  5:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-29 15:53 [PATCH net-next v5 0/3] net: Add bpf support to set sk_bound_dev_if David Ahern
2016-11-29 15:53 ` [PATCH net-next v5 1/3] bpf: Refactor cgroups code in prep for new type David Ahern
2016-11-29 19:41   ` Alexei Starovoitov
2016-11-29 15:53 ` [PATCH net-next v5 2/3] bpf: Add new cgroup attach type to enable sock modifications David Ahern
2016-11-29 20:01   ` Alexei Starovoitov
2016-11-29 21:01     ` David Ahern
2016-11-30  0:43     ` David Ahern
2016-11-30  0:59       ` Alexei Starovoitov
2016-11-30  1:07         ` David Ahern
2016-11-30  5:41           ` Alexei Starovoitov [this message]
2016-11-30 16:24             ` David Ahern
2016-11-29 15:53 ` [PATCH net-next v5 3/3] samples: bpf: add userspace example for modifying sk_bound_dev_if David Ahern

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=20161130054154.GC31581@ast-mbp.thefacebook.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=ast@fb.com \
    --cc=daniel@iogearbox.net \
    --cc=daniel@zonque.org \
    --cc=dsa@cumulusnetworks.com \
    --cc=maheshb@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=tgraf@suug.ch \
    /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