Hi,

OVS in default mode adds tc flower filters with "ip_flags nofrag". ice
rejects any match on control flags, so these flows can't be offloaded
and all IP traffic goes through the slow path.

HW has a metadata flag that says whether a packet is fragmented (IPv4
or IPv6). Use it to offload the "not fragmented" case. Matching on
fragments isn't supported, because it would need different training
packets and would break L4 matching. Tunneled filters are also
rejected, as the flag can come from either the outer or the inner IP
header.

The first patch is a preparation: all 32 bits of the tc flower flags
are already used, so the field is extended to u64 and the defines use
BIT_ULL(). The second patch adds the nofrag match.

Example:
$ tc filter add dev $VF_PR ingress protocol ip prio 1 flower \
    src_mac 0a:7a:c1:6b:8e:1c dst_mac be:9d:68:58:51:d8 \
    ip_flags nofrag skip_sw \
    action mirred egress redirect dev $VF2_PR

Tested with iperf traffic between OVS bridge ports in switchdev mode.
All packets are offloaded.

Michal Swiatkowski (2):
  ice: extend tc flags field to u64
  ice: allow matching on no_frag ip packets

 drivers/net/ethernet/intel/ice/ice_main.c     |  2 +-
 .../ethernet/intel/ice/ice_protocol_type.h    |  1 +
 drivers/net/ethernet/intel/ice/ice_switch.c   |  7 ++
 drivers/net/ethernet/intel/ice/ice_switch.h   |  1 +
 drivers/net/ethernet/intel/ice/ice_tc_lib.c   | 51 +++++++++++---
 drivers/net/ethernet/intel/ice/ice_tc_lib.h   | 67 ++++++++++---------
 6 files changed, 85 insertions(+), 44 deletions(-)

-- 
2.49.0

Reply via email to