Skip to content

Commit 42d5fe5

Browse files
jpirkodavem330
authored andcommitted
flow_offload: turn hw_stats_type into dedicated enum
Put the values into enum and add an enum to define the bits. Suggested-by: Edward Cree <[email protected]> Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a393daa commit 42d5fe5

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

include/net/flow_offload.h

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,21 @@ enum flow_action_mangle_base {
155155
FLOW_ACT_MANGLE_HDR_TYPE_UDP,
156156
};
157157

158-
#define FLOW_ACTION_HW_STATS_TYPE_IMMEDIATE BIT(0)
159-
#define FLOW_ACTION_HW_STATS_TYPE_DELAYED BIT(1)
160-
#define FLOW_ACTION_HW_STATS_TYPE_ANY (FLOW_ACTION_HW_STATS_TYPE_IMMEDIATE | \
161-
FLOW_ACTION_HW_STATS_TYPE_DELAYED)
162-
#define FLOW_ACTION_HW_STATS_TYPE_DISABLED 0
158+
enum flow_action_hw_stats_type_bit {
159+
FLOW_ACTION_HW_STATS_TYPE_IMMEDIATE_BIT,
160+
FLOW_ACTION_HW_STATS_TYPE_DELAYED_BIT,
161+
};
162+
163+
enum flow_action_hw_stats_type {
164+
FLOW_ACTION_HW_STATS_TYPE_DISABLED = 0,
165+
FLOW_ACTION_HW_STATS_TYPE_IMMEDIATE =
166+
BIT(FLOW_ACTION_HW_STATS_TYPE_IMMEDIATE_BIT),
167+
FLOW_ACTION_HW_STATS_TYPE_DELAYED =
168+
BIT(FLOW_ACTION_HW_STATS_TYPE_DELAYED_BIT),
169+
FLOW_ACTION_HW_STATS_TYPE_ANY =
170+
FLOW_ACTION_HW_STATS_TYPE_IMMEDIATE |
171+
FLOW_ACTION_HW_STATS_TYPE_DELAYED,
172+
};
163173

164174
typedef void (*action_destr)(void *priv);
165175

@@ -175,7 +185,7 @@ void flow_action_cookie_destroy(struct flow_action_cookie *cookie);
175185

176186
struct flow_action_entry {
177187
enum flow_action_id id;
178-
u8 hw_stats_type;
188+
enum flow_action_hw_stats_type hw_stats_type;
179189
action_destr destructor;
180190
void *destructor_priv;
181191
union {

0 commit comments

Comments
 (0)