1. 06 Jan, 2016 4 commits
  2. 03 Jan, 2016 1 commit
  3. 31 Dec, 2015 4 commits
  4. 30 Dec, 2015 2 commits
  5. 22 Dec, 2015 3 commits
  6. 18 Dec, 2015 12 commits
  7. 10 Dec, 2015 7 commits
  8. 29 Nov, 2015 7 commits
    • Stephen Hemminger's avatar
      iptunnel: cleanup code · a96a5d94
      Stephen Hemminger authored
      Make iptunnel pass checkpatch (mostly).
      a96a5d94
    • Konstantin Shemyak's avatar
      ip_tunnel: determine tunnel address family from the tunnel type · cc9c1dfa
      Konstantin Shemyak authored
      On 24.11.2015 02:26, Stephen Hemminger wrote:
      > On Thu, 12 Nov 2015 21:10:08 +0000
      > Konstantin Shemyak <konstantin@shemyak.com> wrote:
      >
      >> When creating an IP tunnel over IPv6, the address family must be passed in
      >> the option, e.g.
      >>
      >> ip -6 tunnel add mode ip6gre local 1::1 remote 2::2
      >>
      >> This makes it impossible to create both IPv4 and IPv6 tunnels in one batch.
      >>
      >> In fact the address family option is redundant here, as each tunnel mode is
      >> relevant for only one address family.
      >> The patch determines whether the applicable address family is AF_INET6
      >> instead of the default AF_INET and makes the "-6" option unnecessary for
      >> "ip tunnel add".
      >>
      >> Signed-off-by: Konstantin Shemyak <konstantin@shemyak.com>
      >> ---
      >>   ip/iptunnel.c                          | 26 ++++++++++++++++++++++++++
      >>   testsuite/tests/ip/tunnel/add_tunnel.t | 14 ++++++++++++++
      >>   2 files changed, 40 insertions(+)
      >>   create mode 100755 testsuite/tests/ip/tunnel/add_tunnel.t
      >>
      >> diff --git a/ip/iptunnel.c b/ip/iptunnel.c
      >> index 78fa988..7826a37 100644
      >> --- a/ip/iptunnel.c
      >> +++ b/ip/iptunnel.c
      >> @@ -629,8 +629,34 @@ static int do_6rd(int argc, char **argv)
      >>          return tnl_6rd_ioctl(cmd, medium, &ip6rd);
      >>   }
      >>
      >> +static int tunnel_mode_is_ipv6(char *tunnel_mode) {
      >> +       char *ipv6_modes[] = {
      >> +               "ipv6/ipv6", "ip6ip6",
      >> +               "vti6",
      >> +               "ip/ipv6", "ipv4/ipv6", "ipip6", "ip4ip6",
      >> +               "ip6gre", "gre/ipv6",
      >> +               "any/ipv6", "any"
      >> +       };
      >> +       int i;
      >> +
      >> +       for (i = 0; i < sizeof(ipv6_modes) / sizeof(char *); i++) {
      >> +               if (strcmp(ipv6_modes[i], tunnel_mode) == 0)
      >> +                       return 1;
      >> +       }
      >> +       return 0;
      >> +}
      >> +
      >
      > The ipv6_modes table should be static const.
      
      Thank you for the note! attached the corrected patch.
      
      > Also is it possible to use strstr for ipv6 and ip6 or even strchr(tunnel_mode, '6')
      > to simplify this?
      
      There is IPv6 tunnel mode 'any', and IPv4 tunnel mode 'ipv6/ip' (aka
      'sit'). It looks to me that attempts to find some substring match
      would not make the code much shorter, but definitely less readable.
      
      Konstantin Shemyak.
      
      >From 42d27db0055c3a114fe6eb86d680bef9ec098ad4 Mon Sep 17 00:00:00 2001
      From: Konstantin Shemyak <konstantin@shemyak.com>
      Date: Thu, 12 Nov 2015 20:52:02 +0200
      Subject: [PATCH] Tunnel address family is determined from the tunnel mode
      
      When the tunnel mode already tells the IP address family, "ip tunnel"
      command determines it and does not require option "-4"/"-6" to be passed.
      
      This makes possible creating both IPv4 and IPv6 tunnels in one batch.
      Signed-off-by: default avatarKonstantin Shemyak <konstantin@shemyak.com>
      cc9c1dfa
    • Daniel Borkmann's avatar
      {f,m}_bpf: add more example code · 0b7e3fc8
      Daniel Borkmann authored
      I've added three examples to examples/bpf/ that demonstrate how one can
      implement eBPF tail calls in tc with f.e. multiple levels of nesting.
      That should act as a good starting point, but also as test cases for the
      ELF loader and kernel. A real test suite for {f,m,e}_bpf is still to be
      developed in future work.
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      0b7e3fc8
    • Daniel Borkmann's avatar
      {f,m}_bpf: allow updates on program arrays · 91d88eeb
      Daniel Borkmann authored
      Since we have all infrastructure in place now, allow atomic live updates
      on program arrays. This can be very useful e.g. in case programs that are
      being tail-called need to be replaced, f.e. when classifier functionality
      needs to be changed, new protocols added/removed during runtime, etc.
      
      Thus, provide a way for in-place code updates, minimal example: Given is
      an object file cls.o that contains the entry point in section 'classifier',
      has a globally pinned program array 'jmp' with 2 slots and id of 0, and
      two tail called programs under section '0/0' (prog array key 0) and '0/1'
      (prog array key 1), the section encoding for the loader is <id/key>.
      Adding the filter loads everything into cls_bpf:
      
        tc filter add dev foo parent ffff: bpf da obj cls.o
      
      Now, the program under section '0/1' needs to be replaced with an updated
      version that resides in the same section (also full path to tc's subfolder
      of the mount point can be passed, e.g. /sys/fs/bpf/tc/globals/jmp):
      
        tc exec bpf graft m:globals/jmp obj cls.o sec 0/1
      
      In case the program resides under a different section 'foo', it can also
      be injected into the program array like:
      
        tc exec bpf graft m:globals/jmp key 1 obj cls.o sec foo
      
      If the new tail called classifier program is already available as a pinned
      object somewhere (here: /sys/fs/bpf/tc/progs/parser), it can be injected
      into the prog array like:
      
        tc exec bpf graft m:globals/jmp key 1 fd m:progs/parser
      
      In the kernel, the program on key 1 is being atomically replaced and the
      old one's refcount dropped.
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      91d88eeb
    • Daniel Borkmann's avatar
      {f, m}_bpf: allow for user-defined object pinnings · f6793eec
      Daniel Borkmann authored
      The recently introduced object pinning can be further extended in order
      to allow sharing maps beyond tc namespace. F.e. maps that are being pinned
      from tracing side, can be accessed through this facility as well.
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      f6793eec
    • Daniel Borkmann's avatar
      {f, m}_bpf: check map attributes when fetching as pinned · 9e607f2e
      Daniel Borkmann authored
      Make use of the new show_fdinfo() facility and verify that when a
      pinned map is being fetched that its basic attributes are the same
      as the map we declared from the ELF file. I.e. when placed into the
      globalns, collisions could occur. In such a case warn the user and
      bail out.
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      9e607f2e
    • Daniel Borkmann's avatar
      {f,m}_bpf: make tail calls working · 910b543d
      Daniel Borkmann authored
      Now that we have the possibility of sharing maps, it's time we get the
      ELF loader fully working with regards to tail calls. Since program array
      maps are pinned, we can keep them finally alive. I've noticed two bugs
      that are being fixed in bpf_fill_prog_arrays() with this patch. Example
      code comes as follow-up.
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      910b543d