]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
net: rename flow_action_hw_stats_types* -> flow_action_hw_stats*
authorJakub Kicinski <kuba@kernel.org>
Tue, 17 Mar 2020 01:42:11 +0000 (18:42 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Mar 2020 04:12:39 +0000 (21:12 -0700)
flow_action_hw_stats_types_check() helper takes one of the
FLOW_ACTION_HW_STATS_*_BIT values as input. If we align
the arguments to the opening bracket of the helper there
is no way to call this helper and stay under 80 characters.

Remove the "types" part from the new flow_action helpers
and enum values.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 files changed:
drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c
drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c
drivers/net/ethernet/mscc/ocelot_flower.c
drivers/net/ethernet/netronome/nfp/flower/action.c
drivers/net/ethernet/qlogic/qede/qede_filter.c
drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
include/net/flow_offload.h
net/dsa/slave.c
net/sched/cls_api.c

index 523bf4be43cc8f38eaa0c091430458494d17ddad..b19be7549aad2e1da9b475c2e42703466a130a2f 100644 (file)
@@ -300,7 +300,7 @@ static int bnxt_tc_parse_actions(struct bnxt *bp,
                return -EINVAL;
        }
 
-       if (!flow_action_basic_hw_stats_types_check(flow_action, extack))
+       if (!flow_action_basic_hw_stats_check(flow_action, extack))
                return -EOPNOTSUPP;
 
        flow_action_for_each(i, act, flow_action) {
index cc46277e98de259f09287c79d8b546b28c05adc8..b457f2505f97f6e8e6a8fa6bfad7ff432c746d9b 100644 (file)
@@ -553,7 +553,7 @@ int cxgb4_validate_flow_actions(struct net_device *dev,
        bool act_vlan = false;
        int i;
 
-       if (!flow_action_basic_hw_stats_types_check(actions, extack))
+       if (!flow_action_basic_hw_stats_check(actions, extack))
                return -EOPNOTSUPP;
 
        flow_action_for_each(i, act, actions) {
index 0a0c6ec2336c9b94bb18279199379b7f66b32d65..8972cdd559e85c1989389ad7c008f17c43a829fb 100644 (file)
@@ -1082,7 +1082,7 @@ static int mvpp2_port_c2_tcam_rule_add(struct mvpp2_port *port,
        u8 qh, ql, pmap;
        int index, ctx;
 
-       if (!flow_action_basic_hw_stats_types_check(&rule->flow->action, NULL))
+       if (!flow_action_basic_hw_stats_check(&rule->flow->action, NULL))
                return -EOPNOTSUPP;
 
        memset(&c2, 0, sizeof(c2));
@@ -1308,7 +1308,7 @@ static int mvpp2_cls_rfs_parse_rule(struct mvpp2_rfs_rule *rule)
        struct flow_rule *flow = rule->flow;
        struct flow_action_entry *act;
 
-       if (!flow_action_basic_hw_stats_types_check(&rule->flow->action, NULL))
+       if (!flow_action_basic_hw_stats_check(&rule->flow->action, NULL))
                return -EOPNOTSUPP;
 
        act = &flow->action.entries[0];
index 044891a03be34e49debd5b0598c7a68f5da4e8e2..4a48bcb0a8f6f21c7de9935bf372a3681fdc5643 100644 (file)
@@ -3180,8 +3180,8 @@ static int parse_tc_nic_actions(struct mlx5e_priv *priv,
        if (!flow_action_has_entries(flow_action))
                return -EINVAL;
 
-       if (!flow_action_hw_stats_types_check(flow_action, extack,
-                                             FLOW_ACTION_HW_STATS_TYPE_DELAYED_BIT))
+       if (!flow_action_hw_stats_check(flow_action, extack,
+                                       FLOW_ACTION_HW_STATS_DELAYED_BIT))
                return -EOPNOTSUPP;
 
        attr->flow_tag = MLX5_FS_DEFAULT_FLOW_TAG;
@@ -3675,8 +3675,8 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv,
        if (!flow_action_has_entries(flow_action))
                return -EINVAL;
 
-       if (!flow_action_hw_stats_types_check(flow_action, extack,
-                                             FLOW_ACTION_HW_STATS_TYPE_DELAYED_BIT))
+       if (!flow_action_hw_stats_check(flow_action, extack,
+                                       FLOW_ACTION_HW_STATS_DELAYED_BIT))
                return -EOPNOTSUPP;
 
        flow_action_for_each(i, act, flow_action) {
@@ -4510,7 +4510,7 @@ static int scan_tc_matchall_fdb_actions(struct mlx5e_priv *priv,
                return -EOPNOTSUPP;
        }
 
-       if (!flow_action_basic_hw_stats_types_check(flow_action, extack))
+       if (!flow_action_basic_hw_stats_check(flow_action, extack))
                return -EOPNOTSUPP;
 
        flow_action_for_each(i, act, flow_action) {
index 88aa554415df55257435e275061c22e5e2444808..21c4b10d106c19cdbca99090257f424ac49b6ae0 100644 (file)
@@ -26,17 +26,17 @@ static int mlxsw_sp_flower_parse_actions(struct mlxsw_sp *mlxsw_sp,
 
        if (!flow_action_has_entries(flow_action))
                return 0;
-       if (!flow_action_mixed_hw_stats_types_check(flow_action, extack))
+       if (!flow_action_mixed_hw_stats_check(flow_action, extack))
                return -EOPNOTSUPP;
 
        act = flow_action_first_entry_get(flow_action);
-       if (act->hw_stats_type == FLOW_ACTION_HW_STATS_TYPE_ANY ||
-           act->hw_stats_type == FLOW_ACTION_HW_STATS_TYPE_IMMEDIATE) {
+       if (act->hw_stats_type == FLOW_ACTION_HW_STATS_ANY ||
+           act->hw_stats_type == FLOW_ACTION_HW_STATS_IMMEDIATE) {
                /* Count action is inserted first */
                err = mlxsw_sp_acl_rulei_act_count(mlxsw_sp, rulei, extack);
                if (err)
                        return err;
-       } else if (act->hw_stats_type != FLOW_ACTION_HW_STATS_TYPE_DISABLED) {
+       } else if (act->hw_stats_type != FLOW_ACTION_HW_STATS_DISABLED) {
                NL_SET_ERR_MSG_MOD(extack, "Unsupported action HW stats type");
                return -EOPNOTSUPP;
        }
index 6d84173373c7e0f9b36d9bc49feac3e6c4d04591..873a9944fbfbec6b4354387fe1b068a377ddab2d 100644 (file)
@@ -17,8 +17,8 @@ static int ocelot_flower_parse_action(struct flow_cls_offload *f,
        if (!flow_offload_has_one_action(&f->rule->action))
                return -EOPNOTSUPP;
 
-       if (!flow_action_basic_hw_stats_types_check(&f->rule->action,
-                                                   f->common.extack))
+       if (!flow_action_basic_hw_stats_check(&f->rule->action,
+                                             f->common.extack))
                return -EOPNOTSUPP;
 
        flow_action_for_each(i, a, &f->rule->action) {
index 4aa7346cb040cb47f47d3099fc9c1873f189ecba..5fb9869f85d7b7ff8b55042576d30781e0557684 100644 (file)
@@ -1207,8 +1207,7 @@ int nfp_flower_compile_action(struct nfp_app *app,
        bool pkt_host = false;
        u32 csum_updated = 0;
 
-       if (!flow_action_basic_hw_stats_types_check(&flow->rule->action,
-                                                   extack))
+       if (!flow_action_basic_hw_stats_check(&flow->rule->action, extack))
                return -EOPNOTSUPP;
 
        memset(nfp_flow->action_data, 0, NFP_FL_MAX_A_SIZ);
index 6505f7e2d1dbaa06c4050d93e8179639841cc462..fe72bb6c9455eb1d6f8c62f4eadce0e3c9b6b299 100644 (file)
@@ -1757,7 +1757,7 @@ static int qede_parse_actions(struct qede_dev *edev,
                return -EINVAL;
        }
 
-       if (!flow_action_basic_hw_stats_types_check(flow_action, extack))
+       if (!flow_action_basic_hw_stats_check(flow_action, extack))
                return -EOPNOTSUPP;
 
        flow_action_for_each(i, act, flow_action) {
index 07dbe4f5456e1ef27c9b0d8e16be020475f03f52..63d6c85a59e3ab5c862c836857e1041ac6cbb992 100644 (file)
@@ -1387,7 +1387,7 @@ static int __stmmac_test_l3filt(struct stmmac_priv *priv, u32 dst, u32 src,
        cls->rule = rule;
 
        rule->action.entries[0].id = FLOW_ACTION_DROP;
-       rule->action.entries[0].hw_stats_type = FLOW_ACTION_HW_STATS_TYPE_ANY;
+       rule->action.entries[0].hw_stats_type = FLOW_ACTION_HW_STATS_ANY;
        rule->action.num_entries = 1;
 
        attr.dst = priv->dev->dev_addr;
@@ -1516,7 +1516,7 @@ static int __stmmac_test_l4filt(struct stmmac_priv *priv, u32 dst, u32 src,
        cls->rule = rule;
 
        rule->action.entries[0].id = FLOW_ACTION_DROP;
-       rule->action.entries[0].hw_stats_type = FLOW_ACTION_HW_STATS_TYPE_ANY;
+       rule->action.entries[0].hw_stats_type = FLOW_ACTION_HW_STATS_ANY;
        rule->action.num_entries = 1;
 
        attr.dst = priv->dev->dev_addr;
index a0e6118444b00d9c842c0fd64999713e7d0ddefc..3d747846f4829be0373ed6a211f15607e213e1e2 100644 (file)
@@ -376,7 +376,7 @@ static int tc_parse_flow_actions(struct stmmac_priv *priv,
        if (!flow_action_has_entries(action))
                return -EINVAL;
 
-       if (!flow_action_basic_hw_stats_types_check(action, extack))
+       if (!flow_action_basic_hw_stats_check(action, extack))
                return -EOPNOTSUPP;
 
        flow_action_for_each(i, act, action) {
index efd8d47f699712a9dde1c4625a1026574737937e..1e30b0d44b61f5e1e1a9efbe21a72ed2bf860a1c 100644 (file)
@@ -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 {
index c5beb3031a72b3c2a54e38e8ce7f12bd83eb28a2..5f782fa3029f081525cd5aabed73a47deaae0f4f 100644 (file)
@@ -861,8 +861,8 @@ static int dsa_slave_add_cls_matchall(struct net_device *dev,
        if (!flow_offload_has_one_action(&cls->rule->action))
                return err;
 
-       if (!flow_action_basic_hw_stats_types_check(&cls->rule->action,
-                                                   cls->common.extack))
+       if (!flow_action_basic_hw_stats_check(&cls->rule->action,
+                                             cls->common.extack))
                return err;
 
        act = &cls->rule->action.entries[0];
index 363264ca2e09626cec44cc79b0f981f9cdc17648..2dc6e23a88c8f961f696bc47a65fa8322ee382eb 100644 (file)
@@ -3528,9 +3528,9 @@ int tc_setup_flow_action(struct flow_action *flow_action,
        struct tc_action *act;
        int i, j, k, err = 0;
 
-       BUILD_BUG_ON(TCA_ACT_HW_STATS_TYPE_ANY != FLOW_ACTION_HW_STATS_TYPE_ANY);
-       BUILD_BUG_ON(TCA_ACT_HW_STATS_TYPE_IMMEDIATE != FLOW_ACTION_HW_STATS_TYPE_IMMEDIATE);
-       BUILD_BUG_ON(TCA_ACT_HW_STATS_TYPE_DELAYED != FLOW_ACTION_HW_STATS_TYPE_DELAYED);
+       BUILD_BUG_ON(TCA_ACT_HW_STATS_TYPE_ANY != FLOW_ACTION_HW_STATS_ANY);
+       BUILD_BUG_ON(TCA_ACT_HW_STATS_TYPE_IMMEDIATE != FLOW_ACTION_HW_STATS_IMMEDIATE);
+       BUILD_BUG_ON(TCA_ACT_HW_STATS_TYPE_DELAYED != FLOW_ACTION_HW_STATS_DELAYED);
 
        if (!exts)
                return 0;