Skip to content

Commit

Permalink
Merge branch 'marvell-prestera-flower-match-all'
Browse files Browse the repository at this point in the history
Vadym Kochan says:

====================
Marvell Prestera add flower and match all support

Add ACL infrastructure for Prestera Switch ASICs family devices to
offload cls_flower rules to be processed in the HW.

ACL implementation is based on tc filter api. The flower classifier
is supported to configure ACL rules/matches/action.

Supported actions:

    - drop
    - trap
    - pass

Supported dissector keys:

    - indev
    - src_mac
    - dst_mac
    - src_ip
    - dst_ip
    - ip_proto
    - src_port
    - dst_port
    - vlan_id
    - vlan_ethtype
    - icmp type/code

- Introduce matchall filter support
- Add SPAN API to configure port mirroring.
- Add tc mirror action.

At this moment, only mirror (egress) action is supported.

Example:
    tc filter ... action mirred egress mirror dev DEV

v2:
    Fixed "newline at EOF warnings" from "git am" by
        re-applying with --whitespace=fix

    patch #1:
        1) Set TC HW Offload always enabled without disable it     [suggested by Vladimir Oltean]
           by user. It reduced the logic by removing feature
           handling and acl block disable counting.

    patch #2:
        1) Removed extra not needed diff with prestera_port and    [suggested by Vladimir Oltean]
           prestera_switch  lines exchanging in prestera_acl.h

        2) Fix local variables ordering to reverse chrostmas tree  [suggested by Vladimir Oltean]

        3) Use tc_cls_can_offload_and_chain0() in                  [suggested by Vladimir Oltean]
           prestera_span_replace()

        4) Removed TODO about prio check                           [suggested by Vladimir Oltean]

        5) Rephrase error message if prestera_netdev_check()       [suggested by Vladimir Oltean]
           fails in prestera_span_replace()
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jun 16, 2021
2 parents 220e898 + 13defa2 commit 8ac9900
Show file tree
Hide file tree
Showing 13 changed files with 1,770 additions and 2 deletions.
3 changes: 2 additions & 1 deletion drivers/net/ethernet/marvell/prestera/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
obj-$(CONFIG_PRESTERA) += prestera.o
prestera-objs := prestera_main.o prestera_hw.o prestera_dsa.o \
prestera_rxtx.o prestera_devlink.o prestera_ethtool.o \
prestera_switchdev.o
prestera_switchdev.o prestera_acl.o prestera_flow.o \
prestera_flower.o prestera_span.o

obj-$(CONFIG_PRESTERA_PCI) += prestera_pci.o
7 changes: 7 additions & 0 deletions drivers/net/ethernet/marvell/prestera/prestera.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,12 @@ struct prestera_lag {
u16 lag_id;
};

struct prestera_flow_block;

struct prestera_port {
struct net_device *dev;
struct prestera_switch *sw;
struct prestera_flow_block *flow_block;
struct devlink_port dl_port;
struct list_head lag_member;
struct prestera_lag *lag;
Expand Down Expand Up @@ -169,13 +172,17 @@ struct prestera_event {
};

struct prestera_switchdev;
struct prestera_span;
struct prestera_rxtx;
struct prestera_trap_data;
struct prestera_acl;

struct prestera_switch {
struct prestera_device *dev;
struct prestera_switchdev *swdev;
struct prestera_rxtx *rxtx;
struct prestera_acl *acl;
struct prestera_span *span;
struct list_head event_handlers;
struct notifier_block netdev_nb;
struct prestera_trap_data *trap_data;
Expand Down
Loading

0 comments on commit 8ac9900

Please sign in to comment.