mbox series

[net-next,0/4] Add tc hardware offloads

Message ID 20210318100215.15795-1-naveenm@marvell.com
Headers show
Series Add tc hardware offloads | expand

Message

Naveen Mamindlapalli March 18, 2021, 10:02 a.m. UTC
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.

Naveen Mamindlapalli (3):
  octeontx2-pf: Add ip tos and ip proto icmp/icmpv6 flow offload support
  octeontx2-pf: Add tc flower hardware offload on ingress traffic
  octeontx2-pf: add tc flower stats handler for hw offloads

Sunil Goutham (1):
  octeontx2-pf: TC_MATCHALL egress ratelimiting offload

 drivers/net/ethernet/marvell/octeontx2/af/mbox.h   |  14 +
 drivers/net/ethernet/marvell/octeontx2/af/npc.h    |   2 +
 .../ethernet/marvell/octeontx2/af/rvu_debugfs.c    |   2 +-
 .../net/ethernet/marvell/octeontx2/af/rvu_npc.c    |  39 +
 .../net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c |  17 +-
 .../net/ethernet/marvell/octeontx2/nic/Makefile    |   2 +-
 .../ethernet/marvell/octeontx2/nic/otx2_common.h   |  20 +
 .../ethernet/marvell/octeontx2/nic/otx2_flows.c    |  47 +-
 .../net/ethernet/marvell/octeontx2/nic/otx2_pf.c   |  37 +
 .../net/ethernet/marvell/octeontx2/nic/otx2_reg.h  |   1 +
 .../net/ethernet/marvell/octeontx2/nic/otx2_tc.c   | 786 +++++++++++++++++++++
 11 files changed, 961 insertions(+), 6 deletions(-)
 create mode 100644 drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c