Skip to content

Commit 6e36c7b

Browse files
Volodymyr Mytnykdavem330
authored andcommitted
net: prestera: add counter HW API
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 <[email protected]> Signed-off-by: Serhiy Boiko <[email protected]> Signed-off-by: Volodymyr Mytnyk <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 47327e1 commit 6e36c7b

File tree

8 files changed

+682
-2
lines changed

8 files changed

+682
-2
lines changed

drivers/net/ethernet/marvell/prestera/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ obj-$(CONFIG_PRESTERA) += prestera.o
33
prestera-objs := prestera_main.o prestera_hw.o prestera_dsa.o \
44
prestera_rxtx.o prestera_devlink.o prestera_ethtool.o \
55
prestera_switchdev.o prestera_acl.o prestera_flow.o \
6-
prestera_flower.o prestera_span.o
6+
prestera_flower.o prestera_span.o prestera_counter.o
77

88
obj-$(CONFIG_PRESTERA_PCI) += prestera_pci.o

drivers/net/ethernet/marvell/prestera/prestera.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ struct prestera_switch {
248248
u32 mtu_max;
249249
u8 id;
250250
struct prestera_lag *lags;
251+
struct prestera_counter *counter;
251252
u8 lag_member_max;
252253
u8 lag_max;
253254
};

drivers/net/ethernet/marvell/prestera/prestera_acl.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,20 @@ struct prestera_acl_match {
6060
__be32 mask[__PRESTERA_ACL_RULE_MATCH_TYPE_MAX];
6161
};
6262

63+
struct prestera_acl_action_count {
64+
u32 id;
65+
};
66+
6367
struct prestera_acl_rule_entry_key {
6468
u32 prio;
6569
struct prestera_acl_match match;
6670
};
6771

6872
struct prestera_acl_hw_action_info {
6973
enum prestera_acl_rule_action id;
74+
union {
75+
struct prestera_acl_action_count count;
76+
};
7077
};
7178

7279
/* This struct (arg) used only to be passed as parameter for

0 commit comments

Comments
 (0)