netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: ast@plumgrid.com
Cc: daniel@iogearbox.net, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] bpf: add helpers to access tunnel metadata
Date: Fri, 31 Jul 2015 15:20:35 -0700 (PDT)	[thread overview]
Message-ID: <20150731.152035.178009344109129845.davem@davemloft.net> (raw)
In-Reply-To: <1438295817-27295-1-git-send-email-ast@plumgrid.com>

From: Alexei Starovoitov <ast@plumgrid.com>
Date: Thu, 30 Jul 2015 15:36:57 -0700

> Introduce helpers to let eBPF programs attached to TC manipulate tunnel metadata:
> bpf_skb_[gs]et_tunnel_key(skb, key, size, flags)
> skb: pointer to skb
> key: pointer to 'struct bpf_tunnel_key'
> size: size of 'struct bpf_tunnel_key'
> flags: room for future extensions
> 
> First eBPF program that uses these helpers will allocate per_cpu
> metadata_dst structures that will be used on TX.
> On RX metadata_dst is allocated by tunnel driver.
> 
> Typical usage for TX:
> struct bpf_tunnel_key tkey;
> ... populate tkey ...
> bpf_skb_set_tunnel_key(skb, &tkey, sizeof(tkey), 0);
> bpf_clone_redirect(skb, vxlan_dev_ifindex, 0);
> 
> RX:
> struct bpf_tunnel_key tkey = {};
> bpf_skb_get_tunnel_key(skb, &tkey, sizeof(tkey), 0);
> ... lookup or redirect based on tkey ...
> 
> 'struct bpf_tunnel_key' will be extended in the future by adding
> elements to the end and the 'size' argument will indicate which fields
> are populated, thereby keeping backwards compatibility.
> The 'flags' argument may be used as well when the 'size' is not enough or
> to indicate completely different layout of bpf_tunnel_key.
> 
> Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>

Applied, thanks.

      parent reply	other threads:[~2015-07-31 22:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-30 22:36 [PATCH net-next] bpf: add helpers to access tunnel metadata Alexei Starovoitov
2015-07-31  8:11 ` Thomas Graf
2015-07-31  8:14 ` Thomas Graf
2015-07-31 15:43   ` Alexei Starovoitov
2015-07-31 22:20 ` David Miller [this message]

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=20150731.152035.178009344109129845.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=ast@plumgrid.com \
    --cc=daniel@iogearbox.net \
    --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).