1. 12 Aug, 2019 1 commit
  2. 11 Aug, 2019 1 commit
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf · 9481382b
      David S. Miller authored
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf 2019-08-11
      
      The following pull-request contains BPF updates for your *net* tree.
      
      The main changes are:
      
      1) x64 JIT code generation fix for backward-jumps to 1st insn, from Alexei.
      
      2) Fix buggy multi-closing of BTF file descriptor in libbpf, from Andrii.
      
      3) Fix libbpf_num_possible_cpus() to make it thread safe, from Takshak.
      
      4) Fix bpftool to dump an error if pinning fails, from Jakub.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9481382b
  3. 10 Aug, 2019 1 commit
  4. 09 Aug, 2019 24 commits
  5. 08 Aug, 2019 13 commits
    • Guillaume Nault's avatar
      inet: frags: re-introduce skb coalescing for local delivery · 891584f4
      Guillaume Nault authored
      Before commit d4289fcc ("net: IP6 defrag: use rbtrees for IPv6
      defrag"), a netperf UDP_STREAM test[0] using big IPv6 datagrams (thus
      generating many fragments) and running over an IPsec tunnel, reported
      more than 6Gbps throughput. After that patch, the same test gets only
      9Mbps when receiving on a be2net nic (driver can make a big difference
      here, for example, ixgbe doesn't seem to be affected).
      
      By reusing the IPv4 defragmentation code, IPv6 lost fragment coalescing
      (IPv4 fragment coalescing was dropped by commit 14fe22e3 ("Revert
      "ipv4: use skb coalescing in defragmentation"")).
      
      Without fragment coalescing, be2net runs out of Rx ring entries and
      starts to drop frames (ethtool reports rx_drops_no_frags errors). Since
      the netperf traffic is only composed of UDP fragments, any lost packet
      prevents reassembly of the full datagram. Therefore, fragments which
      have no possibility to ever get reassembled pile up in the reassembly
      queue, until the memory accounting exeeds the threshold. At that point
      no fragment is accepted anymore, which effectively discards all
      netperf traffic.
      
      When reassembly timeout expires, some stale fragments are removed from
      the reassembly queue, so a few packets can be received, reassembled
      and delivered to the netperf receiver. But the nic still drops frames
      and soon the reassembly queue gets filled again with stale fragments.
      These long time frames where no datagram can be received explain why
      the performance drop is so significant.
      
      Re-introducing fragment coalescing is enough to get the initial
      performances again (6.6Gbps with be2net): driver doesn't drop frames
      anymore (no more rx_drops_no_frags errors) and the reassembly engine
      works at full speed.
      
      This patch is quite conservative and only coalesces skbs for local
      IPv4 and IPv6 delivery (in order to avoid changing skb geometry when
      forwarding). Coalescing could be extended in the future if need be, as
      more scenarios would probably benefit from it.
      
      [0]: Test configuration
      Sender:
      ip xfrm policy flush
      ip xfrm state flush
      ip xfrm state add src fc00:1::1 dst fc00:2::1 proto esp spi 0x1000 aead 'rfc4106(gcm(aes))' 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b 96 mode transport sel src fc00:1::1 dst fc00:2::1
      ip xfrm policy add src fc00:1::1 dst fc00:2::1 dir in tmpl src fc00:1::1 dst fc00:2::1 proto esp mode transport action allow
      ip xfrm state add src fc00:2::1 dst fc00:1::1 proto esp spi 0x1001 aead 'rfc4106(gcm(aes))' 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b 96 mode transport sel src fc00:2::1 dst fc00:1::1
      ip xfrm policy add src fc00:2::1 dst fc00:1::1 dir out tmpl src fc00:2::1 dst fc00:1::1 proto esp mode transport action allow
      netserver -D -L fc00:2::1
      
      Receiver:
      ip xfrm policy flush
      ip xfrm state flush
      ip xfrm state add src fc00:2::1 dst fc00:1::1 proto esp spi 0x1001 aead 'rfc4106(gcm(aes))' 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b 96 mode transport sel src fc00:2::1 dst fc00:1::1
      ip xfrm policy add src fc00:2::1 dst fc00:1::1 dir in tmpl src fc00:2::1 dst fc00:1::1 proto esp mode transport action allow
      ip xfrm state add src fc00:1::1 dst fc00:2::1 proto esp spi 0x1000 aead 'rfc4106(gcm(aes))' 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b 96 mode transport sel src fc00:1::1 dst fc00:2::1
      ip xfrm policy add src fc00:1::1 dst fc00:2::1 dir out tmpl src fc00:1::1 dst fc00:2::1 proto esp mode transport action allow
      netperf -H fc00:2::1 -f k -P 0 -L fc00:1::1 -l 60 -t UDP_STREAM -I 99,5 -i 5,5 -T5,5 -6
      Signed-off-by: default avatarGuillaume Nault <gnault@redhat.com>
      Acked-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      891584f4
    • Aya Levin's avatar
      net/mlx5e: Remove redundant check in CQE recovery flow of tx reporter · a4e508ca
      Aya Levin authored
      Remove check of recovery bit, in the beginning of the CQE recovery
      function. This test is already performed right before the reporter
      is invoked, when CQE error is detected.
      
      Fixes: de8650a8 ("net/mlx5e: Add tx reporter support")
      Signed-off-by: default avatarAya Levin <ayal@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      a4e508ca
    • Aya Levin's avatar
      net/mlx5e: Fix error flow of CQE recovery on tx reporter · 276d197e
      Aya Levin authored
      CQE recovery function begins with test and set of recovery bit. Add an
      error flow which ensures clearing of this bit when leaving the recovery
      function, to allow further recoveries to take place. This allows removal
      of clearing recovery bit on sq activate.
      
      Fixes: de8650a8 ("net/mlx5e: Add tx reporter support")
      Signed-off-by: default avatarAya Levin <ayal@mellanox.com>
      Reviewed-by: default avatarTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      276d197e
    • Aya Levin's avatar
      net/mlx5e: Fix false negative indication on tx reporter CQE recovery · d9a2fcf5
      Aya Levin authored
      Remove wrong error return value when SQ is not in error state.
      CQE recovery on TX reporter queries the sq state. If the sq is not in
      error state, the sq is either in ready or reset state. Ready state is
      good state which doesn't require recovery and reset state is a temporal
      state which ends in ready state. With this patch, CQE recovery in this
      scenario is successful.
      
      Fixes: de8650a8 ("net/mlx5e: Add tx reporter support")
      Signed-off-by: default avatarAya Levin <ayal@mellanox.com>
      Reviewed-by: default avatarTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      d9a2fcf5
    • Tariq Toukan's avatar
      net/mlx5e: kTLS, Fix tisn field placement · b86f1abe
      Tariq Toukan authored
      Shift the tisn field in the WQE control segment, per the
      HW specification.
      
      Fixes: d2ead1f3 ("net/mlx5e: Add kTLS TX HW offload support")
      Signed-off-by: default avatarTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      b86f1abe
    • Tariq Toukan's avatar
      net/mlx5e: kTLS, Fix tisn field name · f1897b3c
      Tariq Toukan authored
      Use the proper tisn field name from the union in struct mlx5_wqe_ctrl_seg.
      
      Fixes: d2ead1f3 ("net/mlx5e: Add kTLS TX HW offload support")
      Signed-off-by: default avatarTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      f1897b3c
    • Tariq Toukan's avatar
      net/mlx5e: kTLS, Fix progress params context WQE layout · a9bc3390
      Tariq Toukan authored
      The TLS progress params context WQE should not include an
      Eth segment, drop it.
      In addition, align the tls_progress_params layout with the
      HW specification document:
      - fix the tisn field name.
      - remove the valid bit.
      
      Fixes: a12ff35e ("net/mlx5: Introduce TLS TX offload hardware bits and structures")
      Fixes: d2ead1f3 ("net/mlx5e: Add kTLS TX HW offload support")
      Signed-off-by: default avatarTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      a9bc3390
    • Tariq Toukan's avatar
      net/mlx5: kTLS, Fix wrong TIS opmod constants · 26149e3e
      Tariq Toukan authored
      Fix the used constants for TLS TIS opmods, per the HW specification.
      
      Fixes: a12ff35e ("net/mlx5: Introduce TLS TX offload hardware bits and structures")
      Signed-off-by: default avatarTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      26149e3e
    • Tariq Toukan's avatar
      net/mlx5: crypto, Fix wrong offset in encryption key command · 55c9bd37
      Tariq Toukan authored
      Fix the 128b key offset in key encryption key creation command,
      per the HW specification.
      
      Fixes: 45d3b55d ("net/mlx5: Add crypto library to support create/destroy encryption key")
      Signed-off-by: default avatarTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      55c9bd37
    • Mohamad Heib's avatar
      net/mlx5e: ethtool, Avoid setting speed to 56GBASE when autoneg off · 5faf5b70
      Mohamad Heib authored
      Setting speed to 56GBASE is allowed only with auto-negotiation enabled.
      
      This patch prevent setting speed to 56GBASE when auto-negotiation disabled.
      
      Fixes: f62b8bb8 ("net/mlx5: Extend mlx5_core to support ConnectX-4 Ethernet functionality")
      Signed-off-by: default avatarMohamad Heib <mohamadh@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      5faf5b70
    • Huy Nguyen's avatar
      net/mlx5e: Only support tx/rx pause setting for port owner · 466df6eb
      Huy Nguyen authored
      Only support changing tx/rx pause frame setting if the net device
      is the vport group manager.
      
      Fixes: 3c2d18ef ("net/mlx5e: Support ethtool get/set_pauseparam")
      Signed-off-by: default avatarHuy Nguyen <huyn@mellanox.com>
      Reviewed-by: default avatarParav Pandit <parav@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      466df6eb
    • Huy Nguyen's avatar
      net/mlx5: Support inner header match criteria for non decap flow action · 93b3586e
      Huy Nguyen authored
      We have an issue that OVS application creates an offloaded drop rule
      that drops VXLAN traffic with both inner and outer header match
      criteria. mlx5_core driver detects correctly the inner and outer
      header match criteria but does not enable the inner header match criteria
      due to an incorrect assumption in mlx5_eswitch_add_offloaded_rule that
      only decap rule needs inner header criteria.
      
      Solution:
      Remove mlx5_esw_flow_attr's match_level and tunnel_match_level and add
      two new members: inner_match_level and outer_match_level.
      inner/outer_match_level is set to NONE if the inner/outer match criteria
      is not specified in the tc rule creation request. The decap assumption is
      removed and the code just needs to check for inner/outer_match_level to
      enable the corresponding bit in firmware's match_criteria_enable value.
      
      Fixes: 6363651d ("net/mlx5e: Properly set steering match levels for offloaded TC decap rules")
      Signed-off-by: default avatarHuy Nguyen <huyn@mellanox.com>
      Reviewed-by: default avatarRoi Dayan <roid@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      93b3586e
    • Maxim Mikityanskiy's avatar
      net/mlx5e: Use flow keys dissector to parse packets for ARFS · 405b93eb
      Maxim Mikityanskiy authored
      The current ARFS code relies on certain fields to be set in the SKB
      (e.g. transport_header) and extracts IP addresses and ports by custom
      code that parses the packet. The necessary SKB fields, however, are not
      always set at that point, which leads to an out-of-bounds access. Use
      skb_flow_dissect_flow_keys() to get the necessary information reliably,
      fix the out-of-bounds access and reuse the code.
      
      Fixes: 18c908e4 ("net/mlx5e: Add accelerated RFS support")
      Signed-off-by: default avatarMaxim Mikityanskiy <maximmi@mellanox.com>
      Reviewed-by: default avatarTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      405b93eb