Merge branch 'octeon-tc-offloads'
authorDavid S. Miller <davem@davemloft.net>
Thu, 18 Mar 2021 18:37:22 +0000 (11:37 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 Mar 2021 18:37:22 +0000 (11:37 -0700)
commit31222162557ca85808b9985de7e519041561f455
tree154e3f0da869bf5662dcb5acedd98445e7521605
parenta04be4b6b539cfce52181f6f8f15a823d99f520c
parente638a83f167ee9c4abd3faa3be460afe5a688490
Merge branch 'octeon-tc-offloads'

Naveen Mamindlapalli says:

====================
Add tc hardware offloads

This patch series adds support for tc hardware offloads.

Patch #1 adds support for offloading flows that matches IP tos and IP
         protocol which will be used by tc hw offload support. Also
         added ethtool n-tuple filter to code to offload the flows
         matching the above fields.
Patch #2 adds tc flower hardware offload support on ingress traffic.
Patch #3 adds TC flower offload stats.
Patch #4 adds tc TC_MATCHALL egress ratelimiting offload.

* tc flower hardware offload in PF driver

The driver parses the flow match fields and actions received from the tc
subsystem and adds/delete MCAM rules for the same. Each flow contains set
of match and action fields. If the action or fields are not supported,
the rule cannot be offloaded to hardware. The tc uses same set of MCAM
rules allocated for ethtool n-tuple filters. So, at a time only one entity
can offload the flows to hardware, they're made mutually exclusive in the
driver.

Following match and actions are supported.

Match: Eth dst_mac, EtherType, 802.1Q {vlan_id,vlan_prio}, vlan EtherType,
       IP proto {tcp,udp,sctp,icmp,icmp6}, IPv4 tos, IPv4{dst_ip,src_ip},
       L4 proto {dst_port|src_port number}.
Actions: drop, accept, vlan pop, redirect to another port on the device.

The Hardware stats are also supported. Currently only packet counter stats
are updated.

* tc egress rate limiting support
Added TC-MATCHALL classifier offload with police action applied for all
egress traffic on the specified interface.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>