* [PATCH] cls_flower: check if filter is in HW before calling fl_hw_destroy_filter()
@ 2018-01-24 11:42 Sathya Perla
2018-01-24 16:07 ` Jiri Pirko
2018-01-24 22:23 ` Jakub Kicinski
0 siblings, 2 replies; 5+ messages in thread
From: Sathya Perla @ 2018-01-24 11:42 UTC (permalink / raw)
To: netdev; +Cc: jiri
When a filter cannot be added in HW (i.e, fl_hw_replace_filter() returns
error), the TCA_CLS_FLAGS_IN_HW flag is not set in the filter flags.
This flag (via tc_in_hw()) must be checked before issuing the call
to delete a filter in HW (fl_hw_destroy_filter()) and before issuing the
call to query stats (fl_hw_update_stats()).
Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
---
net/sched/cls_flower.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c
index 6132a73..dbcfb52 100644
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@ -286,7 +286,7 @@ static void __fl_delete(struct tcf_proto *tp, struct cls_fl_filter *f)
idr_remove_ext(&head->handle_idr, f->handle);
list_del_rcu(&f->list);
- if (!tc_skip_hw(f->flags))
+ if (tc_in_hw(f->flags))
fl_hw_destroy_filter(tp, f);
tcf_unbind_filter(tp, &f->res);
if (tcf_exts_get_net(&f->exts))
@@ -951,7 +951,7 @@ static int fl_change(struct net *net, struct sk_buff *in_skb,
if (!tc_skip_sw(fold->flags))
rhashtable_remove_fast(&head->ht, &fold->ht_node,
head->ht_params);
- if (!tc_skip_hw(fold->flags))
+ if (tc_in_hw(fold->flags))
fl_hw_destroy_filter(tp, fold);
}
@@ -1170,7 +1170,7 @@ static int fl_dump(struct net *net, struct tcf_proto *tp, void *fh,
goto nla_put_failure;
}
- if (!tc_skip_hw(f->flags))
+ if (tc_in_hw(f->flags))
fl_hw_update_stats(tp, f);
if (fl_dump_key_val(skb, key->eth.dst, TCA_FLOWER_KEY_ETH_DST,
--
2.7.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] cls_flower: check if filter is in HW before calling fl_hw_destroy_filter()
2018-01-24 11:42 [PATCH] cls_flower: check if filter is in HW before calling fl_hw_destroy_filter() Sathya Perla
@ 2018-01-24 16:07 ` Jiri Pirko
2018-01-25 5:52 ` Sathya Perla
2018-01-24 22:23 ` Jakub Kicinski
1 sibling, 1 reply; 5+ messages in thread
From: Jiri Pirko @ 2018-01-24 16:07 UTC (permalink / raw)
To: Sathya Perla; +Cc: netdev
Wed, Jan 24, 2018 at 12:42:55PM CET, sathya.perla@broadcom.com wrote:
>When a filter cannot be added in HW (i.e, fl_hw_replace_filter() returns
>error), the TCA_CLS_FLAGS_IN_HW flag is not set in the filter flags.
>
>This flag (via tc_in_hw()) must be checked before issuing the call
>to delete a filter in HW (fl_hw_destroy_filter()) and before issuing the
>call to query stats (fl_hw_update_stats()).
>
>Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
1) You have to indicate what tree you aim this to be applied on:
[patch net] or [patch net-next]
2) Please provided a "Fixes" line
3) Please use scripts/get_maintainer.pl to get the people to cc
4) Please aim the fix not only to cls_flower, but to other cls as well.
otherwise the patch looks ok.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] cls_flower: check if filter is in HW before calling fl_hw_destroy_filter()
2018-01-24 11:42 [PATCH] cls_flower: check if filter is in HW before calling fl_hw_destroy_filter() Sathya Perla
2018-01-24 16:07 ` Jiri Pirko
@ 2018-01-24 22:23 ` Jakub Kicinski
2018-01-25 5:51 ` Sathya Perla
1 sibling, 1 reply; 5+ messages in thread
From: Jakub Kicinski @ 2018-01-24 22:23 UTC (permalink / raw)
To: Sathya Perla; +Cc: netdev, jiri
On Wed, 24 Jan 2018 17:12:55 +0530, Sathya Perla wrote:
> When a filter cannot be added in HW (i.e, fl_hw_replace_filter() returns
> error), the TCA_CLS_FLAGS_IN_HW flag is not set in the filter flags.
>
> This flag (via tc_in_hw()) must be checked before issuing the call
> to delete a filter in HW (fl_hw_destroy_filter()) and before issuing the
> call to query stats (fl_hw_update_stats()).
>
> Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
Could you explain why you want to make that change? Saying "tc_in_hw()
must be checked" is a bit strong, tc_in_hw() is useless from correctness
POV. Your patch may be a good optimization, but with shared blocks in
the picture now tc_in_hw() == true doesn't mean it's in *your* HW.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] cls_flower: check if filter is in HW before calling fl_hw_destroy_filter()
2018-01-24 22:23 ` Jakub Kicinski
@ 2018-01-25 5:51 ` Sathya Perla
0 siblings, 0 replies; 5+ messages in thread
From: Sathya Perla @ 2018-01-25 5:51 UTC (permalink / raw)
To: Jakub Kicinski; +Cc: Netdev, Jiri Pirko
On Thu, Jan 25, 2018 at 3:53 AM, Jakub Kicinski <kubakici@wp.pl> wrote:
>
> On Wed, 24 Jan 2018 17:12:55 +0530, Sathya Perla wrote:
> > When a filter cannot be added in HW (i.e, fl_hw_replace_filter() returns
> > error), the TCA_CLS_FLAGS_IN_HW flag is not set in the filter flags.
> >
> > This flag (via tc_in_hw()) must be checked before issuing the call
> > to delete a filter in HW (fl_hw_destroy_filter()) and before issuing the
> > call to query stats (fl_hw_update_stats()).
> >
> > Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
>
> Could you explain why you want to make that change? Saying "tc_in_hw()
> must be checked" is a bit strong, tc_in_hw() is useless from correctness
> POV. Your patch may be a good optimization, but with shared blocks in
> the picture now tc_in_hw() == true doesn't mean it's in *your* HW.
I agree that for shared filters when skip_sw is false
tcf_block_cb_call() can return a
positive status even if the filter add on one of the devices fails.
I'll change the commit-log wording to indicate that this new check is
an optimization.
Thanks!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] cls_flower: check if filter is in HW before calling fl_hw_destroy_filter()
2018-01-24 16:07 ` Jiri Pirko
@ 2018-01-25 5:52 ` Sathya Perla
0 siblings, 0 replies; 5+ messages in thread
From: Sathya Perla @ 2018-01-25 5:52 UTC (permalink / raw)
To: Jiri Pirko; +Cc: Netdev
On Wed, Jan 24, 2018 at 9:37 PM, Jiri Pirko <jiri@resnulli.us> wrote:
> Wed, Jan 24, 2018 at 12:42:55PM CET, sathya.perla@broadcom.com wrote:
>>When a filter cannot be added in HW (i.e, fl_hw_replace_filter() returns
>>error), the TCA_CLS_FLAGS_IN_HW flag is not set in the filter flags.
>>
>>This flag (via tc_in_hw()) must be checked before issuing the call
>>to delete a filter in HW (fl_hw_destroy_filter()) and before issuing the
>>call to query stats (fl_hw_update_stats()).
>>
>>Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
>
> 1) You have to indicate what tree you aim this to be applied on:
> [patch net] or [patch net-next]
> 2) Please provided a "Fixes" line
> 3) Please use scripts/get_maintainer.pl to get the people to cc
> 4) Please aim the fix not only to cls_flower, but to other cls as well.
Ok, will do. thanks!
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-01-25 5:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-24 11:42 [PATCH] cls_flower: check if filter is in HW before calling fl_hw_destroy_filter() Sathya Perla
2018-01-24 16:07 ` Jiri Pirko
2018-01-25 5:52 ` Sathya Perla
2018-01-24 22:23 ` Jakub Kicinski
2018-01-25 5:51 ` Sathya Perla
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.