1. 16 Apr, 2024 3 commits
  2. 02 Jan, 2024 1 commit
  3. 13 Nov, 2023 1 commit
  4. 07 Nov, 2023 2 commits
  5. 07 Aug, 2023 1 commit
    • Marcin Szycik's avatar
      ice: Add direction metadata · 0960a27b
      Marcin Szycik authored
      
      Currently it is possible to create a filter which breaks TX traffic, e.g.:
      
      tc filter add dev $PF1 ingress protocol ip prio 1 flower ip_proto udp
      dst_port $PORT action mirred egress redirect dev $VF1_PR
      
      This adds a rule which might match both TX and RX traffic, and in TX path
      the PF will actually receive the traffic, which breaks communication.
      
      To fix this, add a match on direction metadata flag when adding a tc rule.
      
      Because of the way metadata is currently handled, a duplicate lookup word
      would appear if VLAN metadata is also added. The lookup would still work
      correctly, but one word would be wasted. To prevent it, lookup 0 now always
      contains all metadata. When any metadata needs to be added, it is added to
      lookup 0 and lookup count is not incremented. This way, two flags residing
      in the same word will take up one word, instead of two.
      
      Note: the drop action is also affected, i.e. it will now only work in one
      direction.
      Signed-off-by: default avatarMarcin Szycik <marcin.szycik@linux.intel.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Tested-by: default avatarSujai Buvaneswaran <sujai.buvaneswaran@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      0960a27b
  6. 31 Jul, 2023 1 commit
  7. 05 Jul, 2023 1 commit
  8. 19 May, 2023 2 commits
  9. 05 May, 2023 1 commit
  10. 07 Mar, 2023 1 commit
    • Arnd Bergmann's avatar
      ethernet: ice: avoid gcc-9 integer overflow warning · 8f5c5a79
      Arnd Bergmann authored
      With older compilers like gcc-9, the calculation of the vlan
      priority field causes a false-positive warning from the byteswap:
      
      In file included from drivers/net/ethernet/intel/ice/ice_tc_lib.c:4:
      drivers/net/ethernet/intel/ice/ice_tc_lib.c: In function 'ice_parse_cls_flower':
      include/uapi/linux/swab.h:15:15: error: integer overflow in expression '(int)(short unsigned int)((int)match.key-><U67c8>.<U6698>.vlan_priority << 13) & 57344 & 255' of type 'int' results in '0' [-Werror=overflow]
         15 |  (((__u16)(x) & (__u16)0x00ffU) << 8) |   \
            |   ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
      include/uapi/linux/swab.h:106:2: note: in expansion of macro '___constant_swab16'
        106 |  ___constant_swab16(x) :   \
            |  ^~~~~~~~~~~~~~~~~~
      include/uapi/linux/byteorder/little_endian.h:42:43: note: in expansion of macro '__swab16'
         42 | #define __cpu_to_be16(x) ((__force __be16)__swab16((x)))
            |                                           ^~~~~~~~
      include/linux/byteorder/generic.h:96:21: note: in expansion of macro '__cpu_to_be16'
         96 | #define cpu_to_be16 __cpu_to_be16
            |                     ^~~~~~~~~~~~~
      drivers/net/ethernet/intel/ice/ice_tc_lib.c:1458:5: note: in expansion of macro 'cpu_to_be16'
       1458 |     cpu_to_be16((match.key->vlan_priority <<
            |     ^~~~~~~~~~~
      
      After a change to be16_encode_bits(), the code becomes more
      readable to both people and compilers, which avoids the warning.
      
      Fixes: 34800178
      
       ("ice: Add support for VLAN priority filters in switchdev")
      Suggested-by: default avatarAlexander Lobakin <alexandr.lobakin@intel.com>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed-by: default avatarAlexander Lobakin <alexandr.lobakin@intel.com>
      Tested-by: default avatarSujai Buvaneswaran <sujai.buvaneswaran@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      8f5c5a79
  11. 06 Feb, 2023 1 commit
  12. 19 Jan, 2023 1 commit
  13. 25 Oct, 2022 1 commit
  14. 28 Sep, 2022 1 commit
  15. 20 Sep, 2022 1 commit
  16. 24 Aug, 2022 1 commit
  17. 26 Jul, 2022 1 commit
    • Marcin Szycik's avatar
      ice: Add support for PPPoE hardware offload · cd8efeee
      Marcin Szycik authored
      
      Add support for creating PPPoE filters in switchdev mode. Add support
      for parsing PPPoE and PPP-specific tc options: pppoe_sid and ppp_proto.
      
      Example filter:
      tc filter add dev $PF1 ingress protocol ppp_ses prio 1 flower pppoe_sid \
          1234 ppp_proto ip skip_sw action mirred egress redirect dev $VF1_PR
      
      Changes in iproute2 are required to use the new fields.
      
      ICE COMMS DDP package is required to create a filter as it contains PPPoE
      profiles. Added a warning message when loaded DDP package does not contain
      required profiles.
      Signed-off-by: default avatarMarcin Szycik <marcin.szycik@linux.intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      cd8efeee
  18. 30 Jun, 2022 3 commits
  19. 21 Jun, 2022 2 commits
  20. 05 May, 2022 1 commit
  21. 11 Mar, 2022 1 commit
  22. 09 Mar, 2022 2 commits
  23. 18 Feb, 2022 1 commit
  24. 14 Dec, 2021 5 commits
  25. 07 Dec, 2021 2 commits
  26. 28 Oct, 2021 2 commits
    • Michal Swiatkowski's avatar
      ice: support for GRE in eswitch · f0a35040
      Michal Swiatkowski authored
      
      Mostly reuse code from Geneve and VXLAN in TC parsing code. Add new GRE
      header to match on correct fields. Create new dummy packets with GRE
      fields.
      
      Instead of checking if any encap values are presented in TC flower,
      check if device is tunnel type or redirect is to tunnel device. This
      will allow adding all combination of rules. For example filters only
      with inner fields.
      
      Return error in case device isn't tunnel but encap values are presented.
      
      gre example:
      - create tunnel device
      ip l add $NVGRE_DEV type gretap remote $NVGRE_REM_IP local $VF1_IP \
      dev $PF
      - add tc filter (in switchdev mode)
      tc filter add dev $NVGRE_DEV protocol ip parent ffff: flower dst_ip \
      $NVGRE1_IP action mirred egress redirect dev $VF1_PR
      Signed-off-by: default avatarMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
      Tested-by: default avatarSandeep Penigalapati <sandeep.penigalapati@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      f0a35040
    • Michal Swiatkowski's avatar
      ice: VXLAN and Geneve TC support · 9e300987
      Michal Swiatkowski authored
      
      Add definition for VXLAN and Geneve dummy packet. Define VXLAN and
      Geneve type of fields to match on correct UDP tunnel header.
      
      Parse tunnel specific fields from TC tool like outer MACs, outer IPs,
      outer destination port and VNI. Save values and masks in outer header
      struct and move header pointer to inner to simplify parsing inner
      values.
      
      There are two cases for redirect action:
      - from uplink to VF - TC filter is added on tunnel device
      - from VF to uplink - TC filter is added on PR, for this case check if
        redirect device is tunnel device
      
      VXLAN example:
      - create tunnel device
      ip l add $VXLAN_DEV type vxlan id $VXLAN_VNI dstport $VXLAN_PORT \
      dev $PF
      - add TC filter (in switchdev mode)
      tc filter add dev $VXLAN_DEV protocol ip parent ffff: flower \
      enc_dst_ip $VF1_IP enc_key_id $VXLAN_VNI action mirred egress \
      redirect dev $VF1_PR
      
      Geneve example:
      - create tunnel device
      ip l add $GENEVE_DEV type geneve id $GENEVE_VNI dstport $GENEVE_PORT \
      remote $GENEVE_IP
      - add TC filter (in switchdev mode)
      tc filter add dev $GENEVE_DEV protocol ip parent ffff: flower \
      enc_key_id $GENEVE_VNI dst_ip $GENEVE1_IP action mirred egress \
      redirect dev $VF1_PR
      Signed-off-by: default avatarMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
      Tested-by: default avatarSandeep Penigalapati <sandeep.penigalapati@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      9e300987