linux/drivers/net/ethernet/marvell/octeontx2/af
Naveen Mamindlapalli 1d4d9e42c2 octeontx2-pf: Add tc flower hardware offload on ingress traffic
This patch adds support for tc flower hardware offload on ingress
traffic. Since the tc-flower filter rules use the same set of MCAM
rules as the n-tuple filters, the n-tuple filters and tc flower
rules are mutually exclusive. When one of the feature is enabled
using ethtool, the other feature is disabled in the driver. By default
the driver enables n-tuple filters during initialization.

The following flow keys are supported.
    -> Ethernet: dst_mac
    -> L2 proto: all protocols
    -> VLAN (802.1q): vlan_id/vlan_prio
    -> IPv4: dst_ip/src_ip/ip_proto{tcp|udp|sctp|icmp}/ip_tos
    -> IPv6: ip_proto{icmpv6}
    -> L4(tcp/udp/sctp): dst_port/src_port

The following flow actions are supported.
    -> drop
    -> accept
    -> redirect
    -> vlan pop

The flow action supports multiple actions when vlan pop is specified
as the first action. The redirect action supports redirecting to the
PF/VF of same PCI device. Redirecting to other PCI NIX devices is not
supported.

Example #1: Add a tc filter rule to drop UDP traffic with dest port 80
    # ethtool -K eth0 hw-tc-offload on
    # tc qdisc add dev eth0 ingress
    # tc filter add dev eth0 protocol ip parent ffff: flower ip_proto \
          udp dst_port 80 action drop

Example #2: Add a tc filter rule to redirect ingress traffic on eth0
with vlan id 3 to eth6 (ex: eth0 vf0) after stripping the vlan hdr.
    # ethtool -K eth0 hw-tc-offload on
    # tc qdisc add dev eth0 ingress
    # tc filter add dev eth0 parent ffff: protocol 802.1Q flower \
          vlan_id 3 vlan_ethtype ipv4 action vlan pop action mirred \
          ingress redirect dev eth6

Example #3: List the ingress filter rules
    # tc -s filter show dev eth4 ingress

Example #4: Delete tc flower filter rule with handle 0x1
    # tc filter del dev eth0 ingress protocol ip pref 49152 \
      handle 1 flower

Signed-off-by: Naveen Mamindlapalli <naveenm@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-18 11:37:22 -07:00
..
cgx_fw_if.h octeontx2-af: cn10k: MAC internal loopback support 2021-02-11 14:55:04 -08:00
cgx.c octeontx2-af: cn10k: fix an array overflow in is_lmac_valid() 2021-03-03 08:44:24 -08:00
cgx.h octeontx2-af: cn10k: Add RPM Rx/Tx stats support 2021-02-11 14:55:04 -08:00
common.h octeontx2-af: cn10K: Add MTU configuration 2021-02-11 14:55:03 -08:00
lmac_common.h octeontx2-af: cn10k: MAC internal loopback support 2021-02-11 14:55:04 -08:00
Makefile octeontx2-af: cn10K: Add MTU configuration 2021-02-11 14:55:03 -08:00
mbox.c octeontx2-af: cn10k: Add mbox support for CN10K platform 2021-02-11 14:55:03 -08:00
mbox.h octeontx2-af: Modify the return code for unsupported flow keys 2021-03-17 12:29:40 -07:00
npc_profile.h octeontx2-af: Modify default KEX profile to extract TX packet fields 2020-11-17 13:48:20 -08:00
npc.h octeontx2-pf: Add ip tos and ip proto icmp/icmpv6 flow offload support 2021-03-18 11:37:22 -07:00
ptp.c octeontx2-af: cn10k: Add mbox support for CN10K platform 2021-02-11 14:55:03 -08:00
ptp.h octeontx2-af: Add support for Marvell PTP coprocessor 2020-08-24 18:15:45 -07:00
rpm.c octeontx2-af: cn10k: MAC internal loopback support 2021-02-11 14:55:04 -08:00
rpm.h octeontx2-af: cn10k: MAC internal loopback support 2021-02-11 14:55:04 -08:00
rvu_cgx.c octeontx2-af: cn10k: Fixes CN10K RPM reference issue 2021-02-16 13:59:47 -08:00
rvu_cn10k.c octeontx2-af: cn10k: Add support for programmable channels 2021-02-11 14:55:03 -08:00
rvu_cpt.c octeontx2-af: Handle CPT function level reset 2021-02-03 17:31:34 -08:00
rvu_debugfs.c octeontx2-pf: Add tc flower hardware offload on ingress traffic 2021-03-18 11:37:22 -07:00
rvu_devlink.c octeontx2-af: Add devlink health reporters for NIX 2021-01-21 11:57:51 -08:00
rvu_devlink.h octeontx2-af: Add devlink health reporters for NIX 2021-01-21 11:57:51 -08:00
rvu_nix.c octeontx2-af: Avoid duplicate unicast rule in mcam_rules list 2021-03-17 12:29:40 -07:00
rvu_npa.c net: marvell: octeontx2: simplify the return expression of rvu_npa_init() 2020-12-09 17:05:36 -08:00
rvu_npc_fs.c octeontx2-pf: Add ip tos and ip proto icmp/icmpv6 flow offload support 2021-03-18 11:37:22 -07:00
rvu_npc.c octeontx2-af: Avoid duplicate unicast rule in mcam_rules list 2021-03-17 12:29:40 -07:00
rvu_reg.c octeontx2-af: Mbox changes for 98xx 2020-10-31 14:16:47 -07:00
rvu_reg.h octeontx2-af: cn10K: Add MTU configuration 2021-02-11 14:55:03 -08:00
rvu_struct.h octeontx2-af: cn10k: Update NIX/NPA context structure 2021-02-11 14:55:03 -08:00
rvu_trace.c octeontx2-af: Introduce tracepoints for mailbox 2020-09-23 17:35:26 -07:00
rvu_trace.h octeontx2-af: Introduce tracepoints for mailbox 2020-09-23 17:35:26 -07:00
rvu.c octeontx2-af: cn10K: Add MTU configuration 2021-02-11 14:55:03 -08:00
rvu.h octeontx2-af: Add support for multi channel in NIX promisc entry 2021-03-17 12:29:39 -07:00