Skip to content

Commit

Permalink
net: prestera: add counter HW API
Browse files Browse the repository at this point in the history
Add counter API for getting HW statistics.

- HW statistics gathered by this API are deleyed.
- Batch of conters is supported.
- acl stat is supported.

Co-developed-by: Serhiy Boiko <serhiy.boiko@marvell.com>
Signed-off-by: Serhiy Boiko <serhiy.boiko@marvell.com>
Signed-off-by: Volodymyr Mytnyk <vmytnyk@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Volodymyr Mytnyk authored and David S. Miller committed Nov 30, 2021
1 parent 47327e1 commit 6e36c7b
Show file tree
Hide file tree
Showing 8 changed files with 682 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/marvell/prestera/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ 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_acl.o prestera_flow.o \
prestera_flower.o prestera_span.o
prestera_flower.o prestera_span.o prestera_counter.o

obj-$(CONFIG_PRESTERA_PCI) += prestera_pci.o
1 change: 1 addition & 0 deletions drivers/net/ethernet/marvell/prestera/prestera.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ struct prestera_switch {
u32 mtu_max;
u8 id;
struct prestera_lag *lags;
struct prestera_counter *counter;
u8 lag_member_max;
u8 lag_max;
};
Expand Down
7 changes: 7 additions & 0 deletions drivers/net/ethernet/marvell/prestera/prestera_acl.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,20 @@ struct prestera_acl_match {
__be32 mask[__PRESTERA_ACL_RULE_MATCH_TYPE_MAX];
};

struct prestera_acl_action_count {
u32 id;
};

struct prestera_acl_rule_entry_key {
u32 prio;
struct prestera_acl_match match;
};

struct prestera_acl_hw_action_info {
enum prestera_acl_rule_action id;
union {
struct prestera_acl_action_count count;
};
};

/* This struct (arg) used only to be passed as parameter for
Expand Down
Loading

0 comments on commit 6e36c7b

Please sign in to comment.