@@ -185,7 +185,7 @@ static size_t tcf_action_shared_attrs_size(const struct tc_action *act)
185185 return nla_total_size (0 ) /* action number nested */
186186 + nla_total_size (IFNAMSIZ ) /* TCA_ACT_KIND */
187187 + cookie_len /* TCA_ACT_COOKIE */
188- + nla_total_size (sizeof (struct nla_bitfield32 )) /* TCA_ACT_HW_STATS_TYPE */
188+ + nla_total_size (sizeof (struct nla_bitfield32 )) /* TCA_ACT_HW_STATS */
189189 + nla_total_size (0 ) /* TCA_ACT_STATS nested */
190190 + nla_total_size (sizeof (struct nla_bitfield32 )) /* TCA_ACT_FLAGS */
191191 /* TCA_STATS_BASIC */
@@ -789,14 +789,13 @@ tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
789789 }
790790 rcu_read_unlock ();
791791
792- if (a -> hw_stats_type != TCA_ACT_HW_STATS_TYPE_ANY ) {
793- struct nla_bitfield32 hw_stats_type = {
794- a -> hw_stats_type ,
795- TCA_ACT_HW_STATS_TYPE_ANY ,
792+ if (a -> hw_stats != TCA_ACT_HW_STATS_ANY ) {
793+ struct nla_bitfield32 hw_stats = {
794+ a -> hw_stats ,
795+ TCA_ACT_HW_STATS_ANY ,
796796 };
797797
798- if (nla_put (skb , TCA_ACT_HW_STATS_TYPE , sizeof (hw_stats_type ),
799- & hw_stats_type ))
798+ if (nla_put (skb , TCA_ACT_HW_STATS , sizeof (hw_stats ), & hw_stats ))
800799 goto nla_put_failure ;
801800 }
802801
@@ -866,22 +865,22 @@ static struct tc_cookie *nla_memdup_cookie(struct nlattr **tb)
866865 return c ;
867866}
868867
869- static u8 tcf_action_hw_stats_type_get (struct nlattr * hw_stats_type_attr )
868+ static u8 tcf_action_hw_stats_get (struct nlattr * hw_stats_attr )
870869{
871- struct nla_bitfield32 hw_stats_type_bf ;
870+ struct nla_bitfield32 hw_stats_bf ;
872871
873872 /* If the user did not pass the attr, that means he does
874873 * not care about the type. Return "any" in that case
875874 * which is setting on all supported types.
876875 */
877- if (!hw_stats_type_attr )
878- return TCA_ACT_HW_STATS_TYPE_ANY ;
879- hw_stats_type_bf = nla_get_bitfield32 (hw_stats_type_attr );
880- return hw_stats_type_bf .value ;
876+ if (!hw_stats_attr )
877+ return TCA_ACT_HW_STATS_ANY ;
878+ hw_stats_bf = nla_get_bitfield32 (hw_stats_attr );
879+ return hw_stats_bf .value ;
881880}
882881
883882static const u32 tca_act_flags_allowed = TCA_ACT_FLAGS_NO_PERCPU_STATS ;
884- static const u32 tca_act_hw_stats_type_allowed = TCA_ACT_HW_STATS_TYPE_ANY ;
883+ static const u32 tca_act_hw_stats_allowed = TCA_ACT_HW_STATS_ANY ;
885884
886885static const struct nla_policy tcf_action_policy [TCA_ACT_MAX + 1 ] = {
887886 [TCA_ACT_KIND ] = { .type = NLA_STRING },
@@ -891,8 +890,8 @@ static const struct nla_policy tcf_action_policy[TCA_ACT_MAX + 1] = {
891890 [TCA_ACT_OPTIONS ] = { .type = NLA_NESTED },
892891 [TCA_ACT_FLAGS ] = { .type = NLA_BITFIELD32 ,
893892 .validation_data = & tca_act_flags_allowed },
894- [TCA_ACT_HW_STATS_TYPE ] = { .type = NLA_BITFIELD32 ,
895- .validation_data = & tca_act_hw_stats_type_allowed },
893+ [TCA_ACT_HW_STATS ] = { .type = NLA_BITFIELD32 ,
894+ .validation_data = & tca_act_hw_stats_allowed },
896895};
897896
898897struct tc_action * tcf_action_init_1 (struct net * net , struct tcf_proto * tp ,
@@ -901,8 +900,8 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
901900 bool rtnl_held ,
902901 struct netlink_ext_ack * extack )
903902{
904- u8 hw_stats_type = TCA_ACT_HW_STATS_TYPE_ANY ;
905903 struct nla_bitfield32 flags = { 0 , 0 };
904+ u8 hw_stats = TCA_ACT_HW_STATS_ANY ;
906905 struct tc_action * a ;
907906 struct tc_action_ops * a_o ;
908907 struct tc_cookie * cookie = NULL ;
@@ -934,8 +933,7 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
934933 goto err_out ;
935934 }
936935 }
937- hw_stats_type =
938- tcf_action_hw_stats_type_get (tb [TCA_ACT_HW_STATS_TYPE ]);
936+ hw_stats = tcf_action_hw_stats_get (tb [TCA_ACT_HW_STATS ]);
939937 if (tb [TCA_ACT_FLAGS ])
940938 flags = nla_get_bitfield32 (tb [TCA_ACT_FLAGS ]);
941939 } else {
@@ -987,7 +985,7 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
987985 tcf_set_action_cookie (& a -> act_cookie , cookie );
988986
989987 if (!name )
990- a -> hw_stats_type = hw_stats_type ;
988+ a -> hw_stats = hw_stats ;
991989
992990 /* module count goes up only when brand new policy is created
993991 * if it exists and is only bound to in a_o->init() then
0 commit comments