1. 03 Nov, 2015 10 commits
    • Mahesh Bandewar's avatar
      bonding: simplify / unify event handling code for 3ad mode. · 52bc6716
      Mahesh Bandewar authored
      Old logic of updating state-machine is not required since
      ad_update_actor_keys() does it implicitly. The only loss is
      the notification differentiation between speed vs. duplex
      change. Now only one unified notification is printed.
      Signed-off-by: default avatarMahesh Bandewar <maheshb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      52bc6716
    • Mahesh Bandewar's avatar
      bonding: unify all places where actor-oper key needs to be updated. · 7bb11dc9
      Mahesh Bandewar authored
      actor_admin, and actor_oper key is changed at multiple locations in
      the code. This patch brings all those updates into one location in
      an attempt to avoid possible inconsistent updates causing LACP state
      machine to go in weird state.
      
      The unified place is ad_update_actor_key() with simple state-machine
      logic -
        (a) If port is "duplex" then only it can participate in LACP
        (b) Speed change reinitializes the LACP state-machine.
      Signed-off-by: default avatarMahesh Bandewar <maheshb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7bb11dc9
    • Mahesh Bandewar's avatar
      bonding: Simplify __get_duplex function. · b25c2e7d
      Mahesh Bandewar authored
      Eliminate 'else' clause by simply initializing variable
      Signed-off-by: default avatarMahesh Bandewar <maheshb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b25c2e7d
    • David S. Miller's avatar
      Merge branch 'bpf-persistent' · 12d43096
      David S. Miller authored
      Daniel Borkmann says:
      
      ====================
      BPF updates
      
      This set adds support for persistent maps/progs. Please see
      individual patches for further details. A man-page update
      to bpf(2) will be sent later on, also a iproute2 patch for
      support in tc.
      
      v1 -> v2:
        - Reworked most of patch 4 and 5
        - Rebased to latest net-next
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      12d43096
    • Daniel Borkmann's avatar
      bpf: add sample usages for persistent maps/progs · 42984d7c
      Daniel Borkmann authored
      This patch adds a couple of stand-alone examples on how BPF_OBJ_PIN
      and BPF_OBJ_GET commands can be used.
      
      Example with maps:
      
        # ./fds_example -F /sys/fs/bpf/m -P -m -k 1 -v 42
        bpf: map fd:3 (Success)
        bpf: pin ret:(0,Success)
        bpf: fd:3 u->(1:42) ret:(0,Success)
        # ./fds_example -F /sys/fs/bpf/m -G -m -k 1
        bpf: get fd:3 (Success)
        bpf: fd:3 l->(1):42 ret:(0,Success)
        # ./fds_example -F /sys/fs/bpf/m -G -m -k 1 -v 24
        bpf: get fd:3 (Success)
        bpf: fd:3 u->(1:24) ret:(0,Success)
        # ./fds_example -F /sys/fs/bpf/m -G -m -k 1
        bpf: get fd:3 (Success)
        bpf: fd:3 l->(1):24 ret:(0,Success)
      
        # ./fds_example -F /sys/fs/bpf/m2 -P -m
        bpf: map fd:3 (Success)
        bpf: pin ret:(0,Success)
        # ./fds_example -F /sys/fs/bpf/m2 -G -m -k 1
        bpf: get fd:3 (Success)
        bpf: fd:3 l->(1):0 ret:(0,Success)
        # ./fds_example -F /sys/fs/bpf/m2 -G -m
        bpf: get fd:3 (Success)
      
      Example with progs:
      
        # ./fds_example -F /sys/fs/bpf/p -P -p
        bpf: prog fd:3 (Success)
        bpf: pin ret:(0,Success)
        bpf sock:4 <- fd:3 attached ret:(0,Success)
        # ./fds_example -F /sys/fs/bpf/p -G -p
        bpf: get fd:3 (Success)
        bpf: sock:4 <- fd:3 attached ret:(0,Success)
      
        # ./fds_example -F /sys/fs/bpf/p2 -P -p -o ./sockex1_kern.o
        bpf: prog fd:5 (Success)
        bpf: pin ret:(0,Success)
        bpf: sock:3 <- fd:5 attached ret:(0,Success)
        # ./fds_example -F /sys/fs/bpf/p2 -G -p
        bpf: get fd:3 (Success)
        bpf: sock:4 <- fd:3 attached ret:(0,Success)
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      42984d7c
    • Daniel Borkmann's avatar
      bpf: add support for persistent maps/progs · b2197755
      Daniel Borkmann authored
      This work adds support for "persistent" eBPF maps/programs. The term
      "persistent" is to be understood that maps/programs have a facility
      that lets them survive process termination. This is desired by various
      eBPF subsystem users.
      
      Just to name one example: tc classifier/action. Whenever tc parses
      the ELF object, extracts and loads maps/progs into the kernel, these
      file descriptors will be out of reach after the tc instance exits.
      So a subsequent tc invocation won't be able to access/relocate on this
      resource, and therefore maps cannot easily be shared, f.e. between the
      ingress and egress networking data path.
      
      The current workaround is that Unix domain sockets (UDS) need to be
      instrumented in order to pass the created eBPF map/program file
      descriptors to a third party management daemon through UDS' socket
      passing facility. This makes it a bit complicated to deploy shared
      eBPF maps or programs (programs f.e. for tail calls) among various
      processes.
      
      We've been brainstorming on how we could tackle this issue and various
      approches have been tried out so far, which can be read up further in
      the below reference.
      
      The architecture we eventually ended up with is a minimal file system
      that can hold map/prog objects. The file system is a per mount namespace
      singleton, and the default mount point is /sys/fs/bpf/. Any subsequent
      mounts within a given namespace will point to the same instance. The
      file system allows for creating a user-defined directory structure.
      The objects for maps/progs are created/fetched through bpf(2) with
      two new commands (BPF_OBJ_PIN/BPF_OBJ_GET). I.e. a bpf file descriptor
      along with a pathname is being passed to bpf(2) that in turn creates
      (we call it eBPF object pinning) the file system nodes. Only the pathname
      is being passed to bpf(2) for getting a new BPF file descriptor to an
      existing node. The user can use that to access maps and progs later on,
      through bpf(2). Removal of file system nodes is being managed through
      normal VFS functions such as unlink(2), etc. The file system code is
      kept to a very minimum and can be further extended later on.
      
      The next step I'm working on is to add dump eBPF map/prog commands
      to bpf(2), so that a specification from a given file descriptor can
      be retrieved. This can be used by things like CRIU but also applications
      can inspect the meta data after calling BPF_OBJ_GET.
      
      Big thanks also to Alexei and Hannes who significantly contributed
      in the design discussion that eventually let us end up with this
      architecture here.
      
      Reference: https://lkml.org/lkml/2015/10/15/925Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b2197755
    • Daniel Borkmann's avatar
      bpf: consolidate bpf_prog_put{, _rcu} dismantle paths · e9d8afa9
      Daniel Borkmann authored
      We currently have duplicated cleanup code in bpf_prog_put() and
      bpf_prog_put_rcu() cleanup paths. Back then we decided that it was
      not worth it to make it a common helper called by both, but with
      the recent addition of resource charging, we could have avoided
      the fix in commit ac00737f ("bpf: Need to call bpf_prog_uncharge_memlock
      from bpf_prog_put") if we would have had only a single, common path.
      We can simplify it further by assigning aux->prog only once during
      allocation time.
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e9d8afa9
    • Daniel Borkmann's avatar
      bpf: align and clean bpf_{map,prog}_get helpers · c2101297
      Daniel Borkmann authored
      Add a bpf_map_get() function that we're going to use later on and
      align/clean the remaining helpers a bit so that we have them a bit
      more consistent:
      
        - __bpf_map_get() and __bpf_prog_get() that both work on the fd
          struct, check whether the descriptor is eBPF and return the
          pointer to the map/prog stored in the private data.
      
          Also, we can return f.file->private_data directly, the function
          signature is enough of a documentation already.
      
        - bpf_map_get() and bpf_prog_get() that both work on u32 user fd,
          call their respective __bpf_map_get()/__bpf_prog_get() variants,
          and take a reference.
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c2101297
    • Daniel Borkmann's avatar
      bpf: abstract anon_inode_getfd invocations · aa79781b
      Daniel Borkmann authored
      Since we're going to use anon_inode_getfd() invocations in more than just
      the current places, make a helper function for both, so that we only need
      to pass a map/prog pointer to the helper itself in order to get a fd. The
      new helpers are called bpf_map_new_fd() and bpf_prog_new_fd().
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aa79781b
    • Eric Dumazet's avatar
      net: fix percpu memory leaks · 1d6119ba
      Eric Dumazet authored
      This patch fixes following problems :
      
      1) percpu_counter_init() can return an error, therefore
        init_frag_mem_limit() must propagate this error so that
        inet_frags_init_net() can do the same up to its callers.
      
      2) If ip[46]_frags_ns_ctl_register() fail, we must unwind
         properly and free the percpu_counter.
      
      Without this fix, we leave freed object in percpu_counters
      global list (if CONFIG_HOTPLUG_CPU) leading to crashes.
      
      This bug was detected by KASAN and syzkaller tool
      (http://github.com/google/syzkaller)
      
      Fixes: 6d7b857d ("net: use lib/percpu_counter API for fragmentation mem accounting")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarDmitry Vyukov <dvyukov@google.com>
      Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
      Cc: Jesper Dangaard Brouer <brouer@redhat.com>
      Acked-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1d6119ba
  2. 02 Nov, 2015 17 commits
  3. 01 Nov, 2015 10 commits
  4. 31 Oct, 2015 3 commits
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client · 523e1345
      Linus Torvalds authored
      Pull Ceph fix from Sage Weil:
       "This sets the stable pages flag on the RBD block device when we have
        CRCs enabled.  (This is necessary since the default assumption for
        block devices changed in 3.9)"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
        rbd: require stable pages if message data CRCs are enabled
      523e1345
    • Linus Torvalds's avatar
      Merge branch 'overlayfs-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs · 4bb0fb57
      Linus Torvalds authored
      Pull overlayfs bug fixes from Miklos Szeredi:
       "This contains fixes for bugs that appeared in earlier kernels (all are
        marked for -stable)"
      
      * 'overlayfs-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs:
        ovl: free lower_mnt array in ovl_put_super
        ovl: free stack of paths in ovl_fill_super
        ovl: fix open in stacked overlay
        ovl: fix dentry reference leak
        ovl: use O_LARGEFILE in ovl_copy_up()
      4bb0fb57
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · c94eee8a
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Fix two regressions in ipv6 route lookups, particularly wrt output
          interface specifications in the lookup key.  From David Ahern.
      
       2) Fix checks in ipv6 IPSEC tunnel pre-encap fragmentation, from
          Herbert Xu.
      
       3) Fix mis-advertisement of 1000BASE-T on bcm63xx_enet, from Simon
          Arlott.
      
       4) Some smsc phys misbehave with energy detect mode enabled, so add a
          DT property and disable it on such switches.  From Heiko Schocher.
      
       5) Fix TSO corruption on TX in mv643xx_eth, from Philipp Kirchhofer.
      
       6) Fix regression added by removal of openvswitch vport stats, from
          James Morse.
      
       7) Vendor Kconfig options should be bool, not tristate, from Andreas
          Schwab.
      
       8) Use non-_BH() net stats bump in tcp_xmit_probe_skb(), otherwise we
          barf during TCP REPAIR operations.
      
       9) Fix various bugs in openvswitch conntrack support, from Joe
          Stringer.
      
      10) Fix NETLINK_LIST_MEMBERSHIPS locking, from David Herrmann.
      
      11) Don't have VSOCK do sock_put() in interrupt context, from Jorgen
          Hansen.
      
      12) Fix skb_realloc_headroom() failures properly in ISDN, from Karsten
          Keil.
      
      13) Add some device IDs to qmi_wwan, from Bjorn Mork.
      
      14) Fix ovs egress tunnel information when using lwtunnel devices, from
          Pravin B Shelar.
      
      15) Add missing NETIF_F_FRAGLIST to macvtab feature list, from Jason
          Wang.
      
      16) Fix incorrect handling of throw routes when the result of the throw
          cannot find a match, from Xin Long.
      
      17) Protect ipv6 MTU calculations from wrap-around, from Hannes Frederic
          Sowa.
      
      18) Fix failed autonegotiation on KSZ9031 micrel PHYs, from Nathan
          Sullivan.
      
      19) Add missing memory barries in descriptor accesses or xgbe driver,
          from Thomas Lendacky.
      
      20) Fix release conditon test in pppoe_release(), from Guillaume Nault.
      
      21) Fix gianfar bugs wrt filter configuration, from Claudiu Manoil.
      
      22) Fix violations of RX buffer alignment in sh_eth driver, from Sergei
          Shtylyov.
      
      23) Fixing missing of_node_put() calls in various places around the
          networking, from Julia Lawall.
      
      24) Fix incorrect leaf now walking in ipv4 routing tree, from Alexander
          Duyck.
      
      25) RDS doesn't check pskb_pull()/pskb_trim() return values, from
          Sowmini Varadhan.
      
      26) Fix VLAN configuration in mlx4 driver, from Jack Morgenstein.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (79 commits)
        ipv6: protect mtu calculation of wrap-around and infinite loop by rounding issues
        Revert "Merge branch 'ipv6-overflow-arith'"
        net/mlx4: Copy/set only sizeof struct mlx4_eqe bytes
        net/mlx4_en: Explicitly set no vlan tags in WQE ctrl segment when no vlan is present
        vhost: fix performance on LE hosts
        bpf: sample: define aarch64 specific registers
        amd-xgbe: Fix race between access of desc and desc index
        RDS-TCP: Recover correctly from pskb_pull()/pksb_trim() failure in rds_tcp_data_recv
        forcedeth: fix unilateral interrupt disabling in netpoll path
        openvswitch: Fix skb leak using IPv6 defrag
        ipv6: Export nf_ct_frag6_consume_orig()
        openvswitch: Fix double-free on ip_defrag() errors
        fib_trie: leaf_walk_rcu should not compute key if key is less than pn->key
        net: mv643xx_eth: add missing of_node_put
        ath6kl: add missing of_node_put
        net: phy: mdio: add missing of_node_put
        netdev/phy: add missing of_node_put
        net: netcp: add missing of_node_put
        net: thunderx: add missing of_node_put
        ipv6: gre: support SIT encapsulation
        ...
      c94eee8a