Skip to content
  1. Jan 07, 2016
  2. Jan 06, 2016
  3. Jan 05, 2016
    • David S. Miller's avatar
      Merge branch 'faster-soreuseport' · 6a5ef90c
      David S. Miller authored
      
      
      Craig Gallek says:
      
      ====================
      Faster SO_REUSEPORT
      
      This series contains two optimizations for the SO_REUSEPORT feature:
      Faster lookup when selecting a socket for an incoming packet and
      the ability to select the socket from the group using a BPF program.
      
      This series only includes the UDP path.  I plan to submit a follow-up
      including the TCP path if the implementation in this series is
      acceptable.
      
      Changes in v4:
      - pskb_may_pull is unnecessary with pskb_pull (per Alexei Starovoitov)
      
      Changes in v3:
      - skb_pull_inline -> pskb_pull (per Alexei Starovoitov)
      - reuseport_attach* -> sk_reuseport_attach* and simple return statement
        syntax change (per Daniel Borkmann)
      
      Changes in v2:
      - Fix ARM build; remove unnecessary include.
      - Handle case where protocol header is not in linear section (per
        Alexei Starovoitov).
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6a5ef90c
    • Craig Gallek's avatar
      soreuseport: BPF selection functional test · 3ca8e402
      Craig Gallek authored
      
      
      This program will build classic and extended BPF programs and
      validate the socket selection logic when used with
      SO_ATTACH_REUSEPORT_CBPF and SO_ATTACH_REUSEPORT_EBPF.
      
      It also validates the re-programing flow and several edge cases.
      
      Signed-off-by: default avatarCraig Gallek <kraig@google.com>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3ca8e402
    • Craig Gallek's avatar
      soreuseport: setsockopt SO_ATTACH_REUSEPORT_[CE]BPF · 538950a1
      Craig Gallek authored
      
      
      Expose socket options for setting a classic or extended BPF program
      for use when selecting sockets in an SO_REUSEPORT group.  These options
      can be used on the first socket to belong to a group before bind or
      on any socket in the group after bind.
      
      This change includes refactoring of the existing sk_filter code to
      allow reuse of the existing BPF filter validation checks.
      
      Signed-off-by: default avatarCraig Gallek <kraig@google.com>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      538950a1
    • Craig Gallek's avatar
      soreuseport: fast reuseport UDP socket selection · e32ea7e7
      Craig Gallek authored
      
      
      Include a struct sock_reuseport instance when a UDP socket binds to
      a specific address for the first time with the reuseport flag set.
      When selecting a socket for an incoming UDP packet, use the information
      available in sock_reuseport if present.
      
      This required adding an additional field to the UDP source address
      equality function to differentiate between exact and wildcard matches.
      The original use case allowed wildcard matches when checking for
      existing port uses during bind.  The new use case of adding a socket
      to a reuseport group requires exact address matching.
      
      Performance test (using a machine with 2 CPU sockets and a total of
      48 cores):  Create reuseport groups of varying size.  Use one socket
      from this group per user thread (pinning each thread to a different
      core) calling recvmmsg in a tight loop.  Record number of messages
      received per second while saturating a 10G link.
        10 sockets: 18% increase (~2.8M -> 3.3M pkts/s)
        20 sockets: 14% increase (~2.9M -> 3.3M pkts/s)
        40 sockets: 13% increase (~3.0M -> 3.4M pkts/s)
      
      This work is based off a similar implementation written by
      Ying Cai <ycai@google.com> for implementing policy-based reuseport
      selection.
      
      Signed-off-by: default avatarCraig Gallek <kraig@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e32ea7e7
    • Craig Gallek's avatar
      soreuseport: define reuseport groups · ef456144
      Craig Gallek authored
      
      
      struct sock_reuseport is an optional shared structure referenced by each
      socket belonging to a reuseport group.  When a socket is bound to an
      address/port not yet in use and the reuseport flag has been set, the
      structure will be allocated and attached to the newly bound socket.
      When subsequent calls to bind are made for the same address/port, the
      shared structure will be updated to include the new socket and the
      newly bound socket will reference the group structure.
      
      Usually, when an incoming packet was destined for a reuseport group,
      all sockets in the same group needed to be considered before a
      dispatching decision was made.  With this structure, an appropriate
      socket can be found after looking up just one socket in the group.
      
      This shared structure will also allow for more complicated decisions to
      be made when selecting a socket (eg a BPF filter).
      
      This work is based off a similar implementation written by
      Ying Cai <ycai@google.com> for implementing policy-based reuseport
      selection.
      
      Signed-off-by: default avatarCraig Gallek <kraig@google.com>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ef456144
    • David S. Miller's avatar
      Merge branch 'mlxsw-fixes' · ebb3cf41
      David S. Miller authored
      
      
      Jiri Pirko says:
      
      ====================
      mlxsw: couple of fixes
      
      Couple of fixes from Ido.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ebb3cf41
    • Ido Schimmel's avatar
      mlxsw: spectrum: Change bridge port attributes only when bridged · 6c72a3d0
      Ido Schimmel authored
      
      
      Bridge port attributes are offloaded to hardware when invoked with SELF
      flag set, but it really makes no sense to reflect them when port is not
      bridged.
      
      Allow a user to change these attribute only when port is bridged and
      initialize them correctly when joining or leaving a bridge.
      
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6c72a3d0