octeontx2-pf: Add ip tos and ip proto icmp/icmpv6 flow offload support
authorNaveen Mamindlapalli <naveenm@marvell.com>
Thu, 18 Mar 2021 10:02:12 +0000 (15:32 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 Mar 2021 18:37:22 +0000 (11:37 -0700)
commit2b9cef6679020938666a81f3b6e743cdfcb8b32d
treed473e0d9479437bf8c77be41dd1f2015696b6fd6
parenta04be4b6b539cfce52181f6f8f15a823d99f520c
octeontx2-pf: Add ip tos and ip proto icmp/icmpv6 flow offload support

Add support for programming the HW MCAM match key with IP tos, IP(v6)
proto icmp/icmpv6, allowing flow offload rules to be installed using
those fields. The NPC HW extracts layer type, which will be used as a
matching criteria for different IP protocols.

The ethtool n-tuple filter logic has been updated to parse the IP tos
and l4proto for HW offloading. l4proto tcp/udp/sctp/ah/esp/icmp are
supported. See example usage below.

Ex: Redirect l4proto icmp to vf 0 queue 0
ethtool -U eth0 flow-type ip4 l4proto 1 action vf 0 queue 0

Ex: Redirect flow with ip tos 8 to vf 0 queue 0
ethtool -U eth0 flow-type ip4 tos 8 vf 0 queue 0

Signed-off-by: Naveen Mamindlapalli <naveenm@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/octeontx2/af/npc.h
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c