Skip to content
  1. May 03, 2017
    • Daniel Borkmann's avatar
      bpf, arm64: implement jiting of BPF_XADD · 85f68fe8
      Daniel Borkmann authored
      
      
      This work adds BPF_XADD for BPF_W/BPF_DW to the arm64 JIT and therefore
      completes JITing of all BPF instructions, meaning we can thus also remove
      the 'notyet' label and do not need to fall back to the interpreter when
      BPF_XADD is used in a program!
      
      This now also brings arm64 JIT in line with x86_64, s390x, ppc64, sparc64,
      where all current eBPF features are supported.
      
      BPF_W example from test_bpf:
      
        .u.insns_int = {
          BPF_ALU32_IMM(BPF_MOV, R0, 0x12),
          BPF_ST_MEM(BPF_W, R10, -40, 0x10),
          BPF_STX_XADD(BPF_W, R10, R0, -40),
          BPF_LDX_MEM(BPF_W, R0, R10, -40),
          BPF_EXIT_INSN(),
        },
      
        [...]
        00000020:  52800247  mov w7, #0x12 // #18
        00000024:  928004eb  mov x11, #0xffffffffffffffd8 // #-40
        00000028:  d280020a  mov x10, #0x10 // #16
        0000002c:  b82b6b2a  str w10, [x25,x11]
        // start of xadd mapping:
        00000030:  928004ea  mov x10, #0xffffffffffffffd8 // #-40
        00000034:  8b19014a  add x10, x10, x25
        00000038:  f9800151  prfm pstl1strm, [x10]
        0000003c:  885f7d4b  ldxr w11, [x10]
        00000040:  0b07016b  add w11, w11, w7
        00000044:  880b7d4b  stxr w11, w11, [x10]
        00000048:  35ffffab  cbnz w11, 0x0000003c
        // end of xadd mapping:
        [...]
      
      BPF_DW example from test_bpf:
      
        .u.insns_int = {
          BPF_ALU32_IMM(BPF_MOV, R0, 0x12),
          BPF_ST_MEM(BPF_DW, R10, -40, 0x10),
          BPF_STX_XADD(BPF_DW, R10, R0, -40),
          BPF_LDX_MEM(BPF_DW, R0, R10, -40),
          BPF_EXIT_INSN(),
        },
      
        [...]
        00000020:  52800247  mov w7,  #0x12 // #18
        00000024:  928004eb  mov x11, #0xffffffffffffffd8 // #-40
        00000028:  d280020a  mov x10, #0x10 // #16
        0000002c:  f82b6b2a  str x10, [x25,x11]
        // start of xadd mapping:
        00000030:  928004ea  mov x10, #0xffffffffffffffd8 // #-40
        00000034:  8b19014a  add x10, x10, x25
        00000038:  f9800151  prfm pstl1strm, [x10]
        0000003c:  c85f7d4b  ldxr x11, [x10]
        00000040:  8b07016b  add x11, x11, x7
        00000044:  c80b7d4b  stxr w11, x11, [x10]
        00000048:  35ffffab  cbnz w11, 0x0000003c
        // end of xadd mapping:
        [...]
      
      Tested on Cavium ThunderX ARMv8, test suite results after the patch:
      
        No JIT:   [ 3751.855362] test_bpf: Summary: 311 PASSED, 0 FAILED, [0/303 JIT'ed]
        With JIT: [ 3573.759527] test_bpf: Summary: 311 PASSED, 0 FAILED, [303/303 JIT'ed]
      
      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>
      85f68fe8
  2. May 02, 2017
  3. May 01, 2017
    • Ido Schimmel's avatar
      mlxsw: spectrum_router: Simplify VRF enslavement · b1e45526
      Ido Schimmel authored
      When a netdev is enslaved to a VRF master, its router interface (RIF)
      needs to be destroyed (if exists) and a new one created using the
      corresponding virtual router (VR).
      
      >From the driver's perspective, the above is equivalent to an inetaddr
      event sent for this netdev. Therefore, when a port netdev (or its
      uppers) are enslaved to a VRF master, call the same function that
      would've been called had a NETDEV_UP was sent for this netdev in the
      inetaddr notification chain.
      
      This patch also fixes a bug when a LAG netdev with an existing RIF is
      enslaved to a VRF. Before this patch, each LAG port would drop the
      reference on the RIF, but would re-join the same one (in the wrong VR)
      soon after. With this patch, the corresponding RIF is first destroyed
      and a new one is created using the correct VR.
      
      Fixes: 7179eb5a
      
       ("mlxsw: spectrum_router: Add support for VRFs")
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b1e45526
    • David S. Miller's avatar
      Merge tag 'mlx5-updates-2017-04-30' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux · cedf90c0
      David S. Miller authored
      
      
      mlx5-updates-2017-04-30
      
      Or says:
      ================
      mlx5 neigh update
      
      This series (whose code name is 'neigh update') from Hadar, enhances the
      mlx5 TC IP tunnel offloads to deal with changes to tunnel destination
      neighbours used in offloaded flows which involved encapsulation.
      
      In order to keep track on the validity state of such neighbours, we register
      a netevent notifier callback and act on NEIGH_UPDATE events: if a neighbour
      becomes valid, offload the related flows to HW (the other way around when
      neigh becomes invalid) and similarly when a neigh mac addresses changes.
      
      Since this traffic is offloaded from the host OS, the neighbour for the IP
      tunnel destination can mistakenly become STALE and deleted by the kernel
      since its 'used' value wasn't changed. To address that, we proactively
      update the neighbour 'used' value every DELAY_PROBE_TIME seconds, using
      time stamps generated by the existing driver code for HW flow counters.
      We use the DELAY_PROBE_TIME_UPDATE event to adjust the frequency of the updates.
      
      Prior to the core of the series, there's a patch from Saeed that introduces an
      extendable vport representor implementation scheme. It provides a separation
      between the eswitch to the netdev related aspects of the representors.
      
      We would like to thank Ido Schimmel and Ilya Lesokhin for their coaching && advice
      through the long design and review cycles while we struggled to understand and
      (hopefully correctly) implement the locking around the different driver flows(..) .
      
      - Or.
      =================
      
      Misc Updates:
      
      From Tariq:
      Some small performance and trivial code optimization for mlx5 netdev driver
      - Optimize poll ICOSQ completion queue
      - Use prefetchw when a write is to follow
      - Use u8 as ownership type in mlx5e_get_cqe()
      
      From Eran:
      - Disable LRO by default on specific setups
      
      From Eli:
      - Small cleanup for E-Switch to avoid redundant allocation
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cedf90c0
    • Mintz, Yuval's avatar
      qed: Prevent warning without CONFIG_RFS_ACCEL · 07ff2ed0
      Mintz, Yuval authored
      After removing the PTP related initialization from slowpath start,
      the remaining PTT entry is required only in case CONFIG_RFS_ACCEL is set.
      Otherwise, it leads to a warning due to it being unused.
      
      Fixes: d179bd16
      
       ("qed: Acquire/release ptt_ptp lock when enabling/disabling PTP")
      Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      07ff2ed0
    • David S. Miller's avatar
      Merge branch 'qed-RoCE-fixes' · a6e8ab8e
      David S. Miller authored
      
      
      Yuval Mintz says:
      
      ====================
      qed: RoCE related pseudo-fixes
      
      This series contains multiple small corrections to the RoCE logic
      in qed plus some debug information and inter-module parameter
      meant to prevent issues further along.
      
       - #1, #6 Share information with protocol driver
         [either new or filling missing bits in existing API].
       - #2, #3 correct error flows in qed.
       - #4 add debug related information.
       - #5 fixes a minor issue in the HW configuration.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a6e8ab8e