aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2020-03-17 21:12:40 -0700
committerDavid S. Miller <davem@davemloft.net>2020-03-17 21:12:40 -0700
commit24ee86511b01f73a1ef1dd8a8a2e685e5ec03bfe (patch)
tree8cd8468fe50c31c373b70d7468a6922022937b2a /include
parentMerge branch 'net-phy-improve-phy_driver-callback-handle_interrupt' (diff)
parentnfp: allow explicitly selected delayed stats (diff)
downloadwireguard-linux-24ee86511b01f73a1ef1dd8a8a2e685e5ec03bfe.tar.xz
wireguard-linux-24ee86511b01f73a1ef1dd8a8a2e685e5ec03bfe.zip
Merge branch 'nfp-type'
Jakub Kicinski says: ==================== net: rename flow_action stats and set NFP type Jiri, I hope this is okay with you, I just dropped the "type" from the helper and value names, and now things should be able to fit on a line, within 80 characters. Second patch makes the NFP able to offload DELAYED stats, which is the type it supports. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/flow_offload.h49
1 files changed, 23 insertions, 26 deletions
diff --git a/include/net/flow_offload.h b/include/net/flow_offload.h
index efd8d47f6997..1e30b0d44b61 100644
--- a/include/net/flow_offload.h
+++ b/include/net/flow_offload.h
@@ -163,19 +163,17 @@ enum flow_action_mangle_base {
};
enum flow_action_hw_stats_type_bit {
- FLOW_ACTION_HW_STATS_TYPE_IMMEDIATE_BIT,
- FLOW_ACTION_HW_STATS_TYPE_DELAYED_BIT,
+ FLOW_ACTION_HW_STATS_IMMEDIATE_BIT,
+ FLOW_ACTION_HW_STATS_DELAYED_BIT,
};
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,
+ FLOW_ACTION_HW_STATS_DISABLED = 0,
+ FLOW_ACTION_HW_STATS_IMMEDIATE =
+ BIT(FLOW_ACTION_HW_STATS_IMMEDIATE_BIT),
+ FLOW_ACTION_HW_STATS_DELAYED = BIT(FLOW_ACTION_HW_STATS_DELAYED_BIT),
+ FLOW_ACTION_HW_STATS_ANY = FLOW_ACTION_HW_STATS_IMMEDIATE |
+ FLOW_ACTION_HW_STATS_DELAYED,
};
typedef void (*action_destr)(void *priv);
@@ -285,8 +283,8 @@ static inline bool flow_offload_has_one_action(const struct flow_action *action)
__act = &(__actions)->entries[++__i])
static inline bool
-flow_action_mixed_hw_stats_types_check(const struct flow_action *action,
- struct netlink_ext_ack *extack)
+flow_action_mixed_hw_stats_check(const struct flow_action *action,
+ struct netlink_ext_ack *extack)
{
const struct flow_action_entry *action_entry;
u8 uninitialized_var(last_hw_stats_type);
@@ -313,20 +311,20 @@ flow_action_first_entry_get(const struct flow_action *action)
}
static inline bool
-__flow_action_hw_stats_types_check(const struct flow_action *action,
- struct netlink_ext_ack *extack,
- bool check_allow_bit,
- enum flow_action_hw_stats_type_bit allow_bit)
+__flow_action_hw_stats_check(const struct flow_action *action,
+ struct netlink_ext_ack *extack,
+ bool check_allow_bit,
+ enum flow_action_hw_stats_type_bit allow_bit)
{
const struct flow_action_entry *action_entry;
if (!flow_action_has_entries(action))
return true;
- if (!flow_action_mixed_hw_stats_types_check(action, extack))
+ if (!flow_action_mixed_hw_stats_check(action, extack))
return false;
action_entry = flow_action_first_entry_get(action);
if (!check_allow_bit &&
- action_entry->hw_stats_type != FLOW_ACTION_HW_STATS_TYPE_ANY) {
+ action_entry->hw_stats_type != FLOW_ACTION_HW_STATS_ANY) {
NL_SET_ERR_MSG_MOD(extack, "Driver supports only default HW stats type \"any\"");
return false;
} else if (check_allow_bit &&
@@ -338,19 +336,18 @@ __flow_action_hw_stats_types_check(const struct flow_action *action,
}
static inline bool
-flow_action_hw_stats_types_check(const struct flow_action *action,
- struct netlink_ext_ack *extack,
- enum flow_action_hw_stats_type_bit allow_bit)
+flow_action_hw_stats_check(const struct flow_action *action,
+ struct netlink_ext_ack *extack,
+ enum flow_action_hw_stats_type_bit allow_bit)
{
- return __flow_action_hw_stats_types_check(action, extack,
- true, allow_bit);
+ return __flow_action_hw_stats_check(action, extack, true, allow_bit);
}
static inline bool
-flow_action_basic_hw_stats_types_check(const struct flow_action *action,
- struct netlink_ext_ack *extack)
+flow_action_basic_hw_stats_check(const struct flow_action *action,
+ struct netlink_ext_ack *extack)
{
- return __flow_action_hw_stats_types_check(action, extack, false, 0);
+ return __flow_action_hw_stats_check(action, extack, false, 0);
}
struct flow_rule {