* [PATCH net-next] net/sched: act_api: use the correct TCA_ACT attributes in dump
@ 2023-03-14 19:33 Pedro Tammela
2023-03-15 10:21 ` Michal Swiatkowski
2023-03-15 10:49 ` Simon Horman
0 siblings, 2 replies; 4+ messages in thread
From: Pedro Tammela @ 2023-03-14 19:33 UTC (permalink / raw)
To: netdev
Cc: jhs, xiyou.wangcong, jiri, davem, edumazet, kuba, pabeni,
Pedro Tammela, Hangbin Liu
3 places in the act api code are using 'TCA_' definitions where they should be using
'TCA_ACT_', which is confusing for the reader, although functionaly wise they are equivalent.
Cc: Hangbin Liu <haliu@redhat.com>
Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
---
net/sched/act_api.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 34c508675041..612b40bf6b0f 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -453,7 +453,7 @@ static size_t tcf_action_shared_attrs_size(const struct tc_action *act)
+ nla_total_size_64bit(sizeof(u64))
/* TCA_STATS_QUEUE */
+ nla_total_size_64bit(sizeof(struct gnet_stats_queue))
- + nla_total_size(0) /* TCA_OPTIONS nested */
+ + nla_total_size(0) /* TCA_ACT_OPTIONS nested */
+ nla_total_size(sizeof(struct tcf_t)); /* TCA_GACT_TM */
}
@@ -480,7 +480,7 @@ tcf_action_dump_terse(struct sk_buff *skb, struct tc_action *a, bool from_act)
unsigned char *b = skb_tail_pointer(skb);
struct tc_cookie *cookie;
- if (nla_put_string(skb, TCA_KIND, a->ops->kind))
+ if (nla_put_string(skb, TCA_ACT_KIND, a->ops->kind))
goto nla_put_failure;
if (tcf_action_copy_stats(skb, a, 0))
goto nla_put_failure;
@@ -1189,7 +1189,7 @@ tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
if (nla_put_u32(skb, TCA_ACT_IN_HW_COUNT, a->in_hw_count))
goto nla_put_failure;
- nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
+ nest = nla_nest_start_noflag(skb, TCA_ACT_OPTIONS);
if (nest == NULL)
goto nla_put_failure;
err = tcf_action_dump_old(skb, a, bind, ref);
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net/sched: act_api: use the correct TCA_ACT attributes in dump
2023-03-14 19:33 [PATCH net-next] net/sched: act_api: use the correct TCA_ACT attributes in dump Pedro Tammela
@ 2023-03-15 10:21 ` Michal Swiatkowski
2023-03-15 10:49 ` Simon Horman
1 sibling, 0 replies; 4+ messages in thread
From: Michal Swiatkowski @ 2023-03-15 10:21 UTC (permalink / raw)
To: Pedro Tammela
Cc: netdev, jhs, xiyou.wangcong, jiri, davem, edumazet, kuba, pabeni,
Hangbin Liu
On Tue, Mar 14, 2023 at 04:33:21PM -0300, Pedro Tammela wrote:
> 3 places in the act api code are using 'TCA_' definitions where they should be using
> 'TCA_ACT_', which is confusing for the reader, although functionaly wise they are equivalent.
>
> Cc: Hangbin Liu <haliu@redhat.com>
> Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com>
> Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
> ---
> net/sched/act_api.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/net/sched/act_api.c b/net/sched/act_api.c
> index 34c508675041..612b40bf6b0f 100644
> --- a/net/sched/act_api.c
> +++ b/net/sched/act_api.c
> @@ -453,7 +453,7 @@ static size_t tcf_action_shared_attrs_size(const struct tc_action *act)
> + nla_total_size_64bit(sizeof(u64))
> /* TCA_STATS_QUEUE */
> + nla_total_size_64bit(sizeof(struct gnet_stats_queue))
> - + nla_total_size(0) /* TCA_OPTIONS nested */
> + + nla_total_size(0) /* TCA_ACT_OPTIONS nested */
> + nla_total_size(sizeof(struct tcf_t)); /* TCA_GACT_TM */
> }
>
> @@ -480,7 +480,7 @@ tcf_action_dump_terse(struct sk_buff *skb, struct tc_action *a, bool from_act)
> unsigned char *b = skb_tail_pointer(skb);
> struct tc_cookie *cookie;
>
> - if (nla_put_string(skb, TCA_KIND, a->ops->kind))
> + if (nla_put_string(skb, TCA_ACT_KIND, a->ops->kind))
> goto nla_put_failure;
> if (tcf_action_copy_stats(skb, a, 0))
> goto nla_put_failure;
> @@ -1189,7 +1189,7 @@ tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
> if (nla_put_u32(skb, TCA_ACT_IN_HW_COUNT, a->in_hw_count))
> goto nla_put_failure;
>
> - nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
> + nest = nla_nest_start_noflag(skb, TCA_ACT_OPTIONS);
> if (nest == NULL)
> goto nla_put_failure;
> err = tcf_action_dump_old(skb, a, bind, ref);
Right, looks fine for me.
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net/sched: act_api: use the correct TCA_ACT attributes in dump
2023-03-14 19:33 [PATCH net-next] net/sched: act_api: use the correct TCA_ACT attributes in dump Pedro Tammela
2023-03-15 10:21 ` Michal Swiatkowski
@ 2023-03-15 10:49 ` Simon Horman
2023-03-16 1:29 ` Pedro Tammela
1 sibling, 1 reply; 4+ messages in thread
From: Simon Horman @ 2023-03-15 10:49 UTC (permalink / raw)
To: Pedro Tammela
Cc: netdev, jhs, xiyou.wangcong, jiri, davem, edumazet, kuba, pabeni,
Hangbin Liu
On Tue, Mar 14, 2023 at 04:33:21PM -0300, Pedro Tammela wrote:
> 3 places in the act api code are using 'TCA_' definitions where they should be using
> 'TCA_ACT_', which is confusing for the reader, although functionaly wise they are equivalent.
>
> Cc: Hangbin Liu <haliu@redhat.com>
> Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com>
> Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
Hi Pedro,
this looks good, but should the instance of TCA_KIND in tcf_del_walker()
also be updated?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net/sched: act_api: use the correct TCA_ACT attributes in dump
2023-03-15 10:49 ` Simon Horman
@ 2023-03-16 1:29 ` Pedro Tammela
0 siblings, 0 replies; 4+ messages in thread
From: Pedro Tammela @ 2023-03-16 1:29 UTC (permalink / raw)
To: Simon Horman
Cc: netdev, jhs, xiyou.wangcong, jiri, davem, edumazet, kuba, pabeni,
Hangbin Liu
On 15/03/2023 07:49, Simon Horman wrote:
> On Tue, Mar 14, 2023 at 04:33:21PM -0300, Pedro Tammela wrote:
>> 3 places in the act api code are using 'TCA_' definitions where they should be using
>> 'TCA_ACT_', which is confusing for the reader, although functionaly wise they are equivalent.
>>
>> Cc: Hangbin Liu <haliu@redhat.com>
>> Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com>
>> Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
>
> Hi Pedro,
>
> this looks good, but should the instance of TCA_KIND in tcf_del_walker()
> also be updated?
Correct, I will add it in v2.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-03-16 1:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-14 19:33 [PATCH net-next] net/sched: act_api: use the correct TCA_ACT attributes in dump Pedro Tammela
2023-03-15 10:21 ` Michal Swiatkowski
2023-03-15 10:49 ` Simon Horman
2023-03-16 1:29 ` Pedro Tammela
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.