Commit 42d5fe5f authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

flow_offload: turn hw_stats_type into dedicated enum

Put the values into enum and add an enum to define the bits.
Suggested-by: default avatarEdward Cree <ecree@solarflare.com>
Signed-off-by: default avatarJiri Pirko <jiri@resnulli.us>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a393daa8
...@@ -155,11 +155,21 @@ enum flow_action_mangle_base { ...@@ -155,11 +155,21 @@ enum flow_action_mangle_base {
FLOW_ACT_MANGLE_HDR_TYPE_UDP, FLOW_ACT_MANGLE_HDR_TYPE_UDP,
}; };
#define FLOW_ACTION_HW_STATS_TYPE_IMMEDIATE BIT(0) enum flow_action_hw_stats_type_bit {
#define FLOW_ACTION_HW_STATS_TYPE_DELAYED BIT(1) FLOW_ACTION_HW_STATS_TYPE_IMMEDIATE_BIT,
#define FLOW_ACTION_HW_STATS_TYPE_ANY (FLOW_ACTION_HW_STATS_TYPE_IMMEDIATE | \ FLOW_ACTION_HW_STATS_TYPE_DELAYED_BIT,
FLOW_ACTION_HW_STATS_TYPE_DELAYED) };
#define FLOW_ACTION_HW_STATS_TYPE_DISABLED 0
enum flow_action_hw_stats_type {
FLOW_ACTION_HW_STATS_TYPE_DISABLED = 0,
FLOW_ACTION_HW_STATS_TYPE_IMMEDIATE =
BIT(FLOW_ACTION_HW_STATS_TYPE_IMMEDIATE_BIT),
FLOW_ACTION_HW_STATS_TYPE_DELAYED =
BIT(FLOW_ACTION_HW_STATS_TYPE_DELAYED_BIT),
FLOW_ACTION_HW_STATS_TYPE_ANY =
FLOW_ACTION_HW_STATS_TYPE_IMMEDIATE |
FLOW_ACTION_HW_STATS_TYPE_DELAYED,
};
typedef void (*action_destr)(void *priv); typedef void (*action_destr)(void *priv);
...@@ -175,7 +185,7 @@ void flow_action_cookie_destroy(struct flow_action_cookie *cookie); ...@@ -175,7 +185,7 @@ void flow_action_cookie_destroy(struct flow_action_cookie *cookie);
struct flow_action_entry { struct flow_action_entry {
enum flow_action_id id; enum flow_action_id id;
u8 hw_stats_type; enum flow_action_hw_stats_type hw_stats_type;
action_destr destructor; action_destr destructor;
void *destructor_priv; void *destructor_priv;
union { union {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment