1. 06 Mar, 2023 2 commits
  2. 27 Feb, 2023 14 commits
  3. 22 Feb, 2023 17 commits
  4. 21 Feb, 2023 7 commits
    • Leon Romanovsky's avatar
      net/mlx5e: Align IPsec ASO result memory to be as required by hardware · f2b6cfda
      Leon Romanovsky authored
      Hardware requires an alignment to 64 bytes to return ASO data. Missing
      this alignment caused to unpredictable results while ASO events were
      generated.
      
      Fixes: 8518d05b ("net/mlx5e: Create Advanced Steering Operation object for IPsec")
      Reported-by: default avatarEmeel Hakim <ehakim@nvidia.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@nvidia.com>
      Link: https://lore.kernel.org/r/de0302c572b90c9224a72868d4e0d657b6313c4b.1676797613.git.leon@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      f2b6cfda
    • Jakub Kicinski's avatar
      Merge tag 'mlx5-updates-2023-02-15' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux · 05b953a5
      Jakub Kicinski authored
      Saeed Mahameed says:
      
      ====================
      mlx5-updates-2023-02-15
      
      1) From Gal Tariq and Parav, Few cleanups for mlx5 driver.
      
      2) From Vlad: Allow offloading of ct 'new' match based on [1]
      
      [1] https://lore.kernel.org/netdev/20230201163100.1001180-1-vladbu@nvidia.com/
      
      * tag 'mlx5-updates-2023-02-15' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux:
        net/mlx5e: RX, Remove doubtful unlikely call
        net/mlx5e: Fix outdated TLS comment
        net/mlx5e: Remove unused function mlx5e_sq_xmit_simple
        net/mlx5e: Allow offloading of ct 'new' match
        net/mlx5e: Implement CT entry update
        net/mlx5: Simplify eq list traversal
        net/mlx5e: Remove redundant page argument in mlx5e_xdp_handle()
        net/mlx5e: Remove redundant page argument in mlx5e_xmit_xdp_buff()
        net/mlx5e: Switch to using napi_build_skb()
      ====================
      
      Link: https://lore.kernel.org/r/20230218090513.284718-1-saeed@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      05b953a5
    • Jakub Kicinski's avatar
      Merge branch 'net-sched-cls_api-support-hardware-miss-to-tc-action' · 981f4045
      Jakub Kicinski authored
      Paul Blakey says:
      
      ====================
      net/sched: cls_api: Support hardware miss to tc action
      
      This series adds support for hardware miss to instruct tc to continue execution
      in a specific tc action instance on a filter's action list. The mlx5 driver patch
      (besides the refactors) shows its usage instead of using just chain restore.
      
      Currently a filter's action list must be executed all together or
      not at all as driver are only able to tell tc to continue executing from a
      specific tc chain, and not a specific filter/action.
      
      This is troublesome with regards to action CT, where new connections should
      be sent to software (via tc chain restore), and established connections can
      be handled in hardware.
      
      Checking for new connections is done when executing the ct action in hardware
      (by checking the packet's tuple against known established tuples).
      But if there is a packet modification (pedit) action before action CT and the
      checked tuple is a new connection, hardware will need to revert the previous
      packet modifications before sending it back to software so it can
      re-match the same tc filter in software and re-execute its CT action.
      
      The following is an example configuration of stateless nat
      on mlx5 driver that isn't supported before this patchet:
      
       #Setup corrosponding mlx5 VFs in namespaces
       $ ip netns add ns0
       $ ip netns add ns1
       $ ip link set dev enp8s0f0v0 netns ns0
       $ ip netns exec ns0 ifconfig enp8s0f0v0 1.1.1.1/24 up
       $ ip link set dev enp8s0f0v1 netns ns1
       $ ip netns exec ns1 ifconfig enp8s0f0v1 1.1.1.2/24 up
      
       #Setup tc arp and ct rules on mxl5 VF representors
       $ tc qdisc add dev enp8s0f0_0 ingress
       $ tc qdisc add dev enp8s0f0_1 ingress
       $ ifconfig enp8s0f0_0 up
       $ ifconfig enp8s0f0_1 up
      
       #Original side
       $ tc filter add dev enp8s0f0_0 ingress chain 0 proto ip flower \
          ct_state -trk ip_proto tcp dst_port 8888 \
            action pedit ex munge tcp dport set 5001 pipe \
            action csum ip tcp pipe \
            action ct pipe \
            action goto chain 1
       $ tc filter add dev enp8s0f0_0 ingress chain 1 proto ip flower \
          ct_state +trk+est \
            action mirred egress redirect dev enp8s0f0_1
       $ tc filter add dev enp8s0f0_0 ingress chain 1 proto ip flower \
          ct_state +trk+new \
            action ct commit pipe \
            action mirred egress redirect dev enp8s0f0_1
       $ tc filter add dev enp8s0f0_0 ingress chain 0 proto arp flower \
            action mirred egress redirect dev enp8s0f0_1
      
       #Reply side
       $ tc filter add dev enp8s0f0_1 ingress chain 0 proto arp flower \
            action mirred egress redirect dev enp8s0f0_0
       $ tc filter add dev enp8s0f0_1 ingress chain 0 proto ip flower \
          ct_state -trk ip_proto tcp \
            action ct pipe \
            action pedit ex munge tcp sport set 8888 pipe \
            action csum ip tcp pipe \
            action mirred egress redirect dev enp8s0f0_0
      
       #Run traffic
       $ ip netns exec ns1 iperf -s -p 5001&
       $ sleep 2 #wait for iperf to fully open
       $ ip netns exec ns0 iperf -c 1.1.1.2 -p 8888
      
       #dump tc filter stats on enp8s0f0_0 chain 0 rule and see hardware packets:
       $ tc -s filter show dev enp8s0f0_0 ingress chain 0 proto ip | grep "hardware.*pkt"
              Sent hardware 9310116832 bytes 6149672 pkt
              Sent hardware 9310116832 bytes 6149672 pkt
              Sent hardware 9310116832 bytes 6149672 pkt
      
      A new connection executing the first filter in hardware will first rewrite
      the dst port to the new port, and then the ct action is executed,
      because this is a new connection, hardware will need to be send this back
      to software, on chain 0, to execute the first filter again in software.
      The dst port needs to be reverted otherwise it won't re-match the old
      dst port in the first filter. Because of that, currently mlx5 driver will
      reject offloading the above action ct rule.
      
      This series adds support for hardware partially executing a filter's action list,
      and letting tc software continue processing in the specific action instance
      where hardware left off (in the above case after the "action pedit ex munge tcp
      dport... of the first rule") allowing support for scenarios such as the above.
      ====================
      
      Link: https://lore.kernel.org/r/20230217223620.28508-1-paulb@nvidia.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      981f4045
    • Paul Blakey's avatar
      net/mlx5e: TC, Set CT miss to the specific ct action instance · 67027828
      Paul Blakey authored
      Currently, CT misses restore the missed chain on the tc skb extension so
      tc will continue from the relevant chain. Instead, restore the CT action's
      miss cookie on the extension, which will instruct tc to continue from the
      this specific CT action instance on the relevant filter's action list.
      
      Map the CT action's miss_cookie to a new miss object (ACT_MISS), and use
      this miss mapping instead of the current chain miss object (CHAIN_MISS)
      for CT action misses.
      
      To restore this new miss mapping value, add a RX restore rule for each
      such mapping value.
      Signed-off-by: default avatarPaul Blakey <paulb@nvidia.com>
      Reviewed-by: default avatarRoi Dayan <roid@nvidia.com>
      Reviewed-by: default avatarOz Sholmo <ozsh@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      67027828
    • Paul Blakey's avatar
      net/mlx5e: Rename CHAIN_TO_REG to MAPPED_OBJ_TO_REG · 235ff07d
      Paul Blakey authored
      This reg usage is always a mapped object, not necessarily
      containing chain info.
      
      Rename to properly convey what it stores.
      This patch doesn't change any functionality.
      Signed-off-by: default avatarPaul Blakey <paulb@nvidia.com>
      Reviewed-by: default avatarRoi Dayan <roid@nvidia.com>
      Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      235ff07d
    • Paul Blakey's avatar
      net/mlx5: Refactor tc miss handling to a single function · 93a1ab2c
      Paul Blakey authored
      Move tc miss handling code to en_tc.c, and remove
      duplicate code.
      Signed-off-by: default avatarPaul Blakey <paulb@nvidia.com>
      Reviewed-by: default avatarRoi Dayan <roid@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      93a1ab2c
    • Paul Blakey's avatar
      net/mlx5: Kconfig: Make tc offload depend on tc skb extension · 03a283cd
      Paul Blakey authored
      Tc skb extension is a basic requirement for using tc
      offload to support correct restoration on action miss.
      
      Depend on it.
      Signed-off-by: default avatarPaul Blakey <paulb@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      03a283cd