Skip to content

Commit 7eea23a

Browse files
Raed SalemLeon Romanovsky
authored andcommitted
IB/core: Add support for flow counters
A counters object could be attached to flow on creation by providing the counter specification action. General counters description which count packets and bytes are introduced, downstream patches from this series will use them as part of flow counters binding. In addition, increase number of flow specifications supported layers to 10 upon adding count specification and for the previously added drop specification. Reviewed-by: Yishai Hadas <[email protected]> Signed-off-by: Raed Salem <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 59082a3 commit 7eea23a

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

include/rdma/ib_verbs.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1857,9 +1857,10 @@ enum ib_flow_spec_type {
18571857
IB_FLOW_SPEC_ACTION_TAG = 0x1000,
18581858
IB_FLOW_SPEC_ACTION_DROP = 0x1001,
18591859
IB_FLOW_SPEC_ACTION_HANDLE = 0x1002,
1860+
IB_FLOW_SPEC_ACTION_COUNT = 0x1003,
18601861
};
18611862
#define IB_FLOW_SPEC_LAYER_MASK 0xF0
1862-
#define IB_FLOW_SPEC_SUPPORT_LAYERS 8
1863+
#define IB_FLOW_SPEC_SUPPORT_LAYERS 10
18631864

18641865
/* Flow steering rule priority is set according to it's domain.
18651866
* Lower domain value means higher priority.
@@ -2011,6 +2012,17 @@ struct ib_flow_spec_action_handle {
20112012
struct ib_flow_action *act;
20122013
};
20132014

2015+
enum ib_counters_description {
2016+
IB_COUNTER_PACKETS,
2017+
IB_COUNTER_BYTES,
2018+
};
2019+
2020+
struct ib_flow_spec_action_count {
2021+
enum ib_flow_spec_type type;
2022+
u16 size;
2023+
struct ib_counters *counters;
2024+
};
2025+
20142026
union ib_flow_spec {
20152027
struct {
20162028
u32 type;
@@ -2026,6 +2038,7 @@ union ib_flow_spec {
20262038
struct ib_flow_spec_action_tag flow_tag;
20272039
struct ib_flow_spec_action_drop drop;
20282040
struct ib_flow_spec_action_handle action;
2041+
struct ib_flow_spec_action_count flow_count;
20292042
};
20302043

20312044
struct ib_flow_attr {

0 commit comments

Comments
 (0)