netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Lebrun <dav.lebrun@gmail.com>
To: Mathieu Xhonneux <m.xhonneux@gmail.com>,
	Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: netdev@vger.kernel.org, David Lebrun <dlebrun@google.com>,
	Daniel Borkmann <daniel@iogearbox.net>
Subject: Re: [PATCH net-next RFC 0/5] ipv6: sr: introduce seg6local End.BPF action
Date: Tue, 3 Apr 2018 14:40:22 +0100	[thread overview]
Message-ID: <e8cef615-04e7-aa38-ee29-9e8d81f67f20@gmail.com> (raw)
In-Reply-To: <CAKSCvkRKS42K8rCfCBYgtfFf7MdCi3iM8O3-YOSa=ezkOZv=cw@mail.gmail.com>

On 04/03/2018 12:16 PM, Mathieu Xhonneux wrote:
> 
>> In patch 2 I was a bit concerned that:
>> +       struct seg6_bpf_srh_state *srh_state = (struct seg6_bpf_srh_state *)
>> +                                              &skb->cb;
>> would not collide with other users of skb->cb, but it seems the way
>> the hook is placed such usage should always be valid.
>> Would be good to add a comment describing the situation.
> Yes, it's indeed a little hack, but this should be OK since the IPv6 layer does
> not use the cb field. Another solution would be to create a new field in
> __sk_buff but it's more cumbersome.
> I will add a comment.

Good point. The IPv6 layer *does* use the cb field through the IP6CB() 
macro. It is first filled in ipv6_rcv() for ingress packets and used, 
among others, in the input path by extension headers processing 
functions to store EH offsets.

Given that input_action_end_bpf is called in the forwarding path 	 and 
terminates with a call to dst_input(), IP6CB() will be then reset by 
ipv6_rcv(), and the use of skb->cb here indeed should not collide with 
other users.

> 
>> Looks like somewhat odd 'End.BPF' name comes from similar names in SRv6 draft.
>> Do you plan to disclose such End.BPF action in the draft as well?
> This is something I've discussed with David Lebrun (the author of the Segment
> Routing implementation). There's no plan to disclose an End.BPF action as-is
> in the draft, since eBPF is really specific to Linux, and David doesn't mind not
> having a 1:1 mapping between the actions of the draft and the implemented
> ones. Writing "End.BPF" instead of just "bpf" is important to indicate that the
> action will advance to the next segment by itself, like all other End actions.
> One could imagine adding later a T.BPF action (a transit action), whose SID
> wouldn't have to be a segment, but that could still e.g. add/edit/delete TLVs.
> 

To clarify, I don't see why we shouldn't support "experimental" features 
that are not defined in draft-6man-segment-routing-header. However, we 
could create a separate draft describing the End.BPF feature, but that's 
perhaps best left for after the ongoing draft's last call.

David

  reply	other threads:[~2018-04-03 13:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-23 10:15 [PATCH net-next RFC 0/5] ipv6: sr: introduce seg6local End.BPF action Mathieu Xhonneux
2018-03-23 10:16 ` [PATCH net-next RFC 1/5] ipv6: sr: export function lookup_nexthop Mathieu Xhonneux
2018-03-23 10:16 ` [PATCH next-next RFC 2/5] bpf: Add IPv6 Segment Routing helpers Mathieu Xhonneux
2018-03-23 10:16 ` [PATCH net-next RFC 3/5] bpf: Split lwt inout verifier structures Mathieu Xhonneux
2018-03-23 10:16 ` [PATCH net-next RFC 4/5] ipv6: sr: Add seg6local action End.BPF Mathieu Xhonneux
2018-03-23 10:16 ` [PATCH net-next RFC 5/5] selftests/bpf: test for seg6local End.BPF action Mathieu Xhonneux
2018-03-30 23:03 ` [PATCH net-next RFC 0/5] ipv6: sr: introduce " Alexei Starovoitov
2018-04-03 11:16   ` Mathieu Xhonneux
2018-04-03 13:40     ` David Lebrun [this message]
2018-04-03 14:25       ` David Lebrun
2018-04-03 14:51         ` Eric Dumazet
2018-04-04  9:34         ` Mathieu Xhonneux
  -- strict thread matches above, loose matches on Subject: below --
2018-04-05  5:10 Alexei Starovoitov

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=e8cef615-04e7-aa38-ee29-9e8d81f67f20@gmail.com \
    --to=dav.lebrun@gmail.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=dlebrun@google.com \
    --cc=m.xhonneux@gmail.com \
    --cc=netdev@vger.kernel.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).