* [PATCH net] net/sched: cls_flower: Set egress_dev mark when calling into the HW driver
@ 2017-10-16 9:19 Or Gerlitz
2017-10-16 12:41 ` Jiri Pirko
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Or Gerlitz @ 2017-10-16 9:19 UTC (permalink / raw)
To: David S. Miller; +Cc: Jiri Pirko, netdev, mlxsw, Or Gerlitz, Roi Dayan
Commit 7091d8c '(net/sched: cls_flower: Add offload support using egress
Hardware device') made sure (when fl_hw_replace_filter is called) to put
the egress_dev mark on persisent structure instance. Hence, following calls
into the HW driver for stats and deletion will note it and act accordingly.
With commit de4784ca030f this property is lost and hence when called,
the HW driver failes to operate (stats, delete) on the offloaded flow.
Fix it by setting the egress_dev flag whenever the ingress device is
different from the hw device since this is exactly the condition under
which we're calling into the HW driver through the egress port net-device.
Fixes: de4784ca030f ('net: sched: get rid of struct tc_to_netdev')
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roi Dayan <roid@mellanox.com>
---
Hi Dave, the bug was introduced in 4.14-rc1 but later the related
code was changed in net-next, hence the fix must not go to net-next, Or.
net/sched/cls_flower.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c
index d230cb4..b480d7c 100644
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@ -234,6 +234,7 @@ static void fl_hw_destroy_filter(struct tcf_proto *tp, struct cls_fl_filter *f)
tc_cls_common_offload_init(&cls_flower.common, tp);
cls_flower.command = TC_CLSFLOWER_DESTROY;
cls_flower.cookie = (unsigned long) f;
+ cls_flower.egress_dev = f->hw_dev != tp->q->dev_queue->dev;
dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSFLOWER, &cls_flower);
}
@@ -289,6 +290,7 @@ static void fl_hw_update_stats(struct tcf_proto *tp, struct cls_fl_filter *f)
cls_flower.command = TC_CLSFLOWER_STATS;
cls_flower.cookie = (unsigned long) f;
cls_flower.exts = &f->exts;
+ cls_flower.egress_dev = f->hw_dev != tp->q->dev_queue->dev;
dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSFLOWER,
&cls_flower);
--
2.3.7
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net] net/sched: cls_flower: Set egress_dev mark when calling into the HW driver
2017-10-16 9:19 [PATCH net] net/sched: cls_flower: Set egress_dev mark when calling into the HW driver Or Gerlitz
@ 2017-10-16 12:41 ` Jiri Pirko
2017-10-16 20:20 ` David Miller
2017-10-17 11:29 ` Sergei Shtylyov
2 siblings, 0 replies; 6+ messages in thread
From: Jiri Pirko @ 2017-10-16 12:41 UTC (permalink / raw)
To: Or Gerlitz; +Cc: David S. Miller, Jiri Pirko, netdev, mlxsw, Roi Dayan
Mon, Oct 16, 2017 at 11:19:48AM CEST, ogerlitz@mellanox.com wrote:
>Commit 7091d8c '(net/sched: cls_flower: Add offload support using egress
>Hardware device') made sure (when fl_hw_replace_filter is called) to put
>the egress_dev mark on persisent structure instance. Hence, following calls
>into the HW driver for stats and deletion will note it and act accordingly.
>
>With commit de4784ca030f this property is lost and hence when called,
>the HW driver failes to operate (stats, delete) on the offloaded flow.
>
>Fix it by setting the egress_dev flag whenever the ingress device is
>different from the hw device since this is exactly the condition under
>which we're calling into the HW driver through the egress port net-device.
>
>Fixes: de4784ca030f ('net: sched: get rid of struct tc_to_netdev')
>Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
>Signed-off-by: Roi Dayan <roid@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net] net/sched: cls_flower: Set egress_dev mark when calling into the HW driver
2017-10-16 9:19 [PATCH net] net/sched: cls_flower: Set egress_dev mark when calling into the HW driver Or Gerlitz
2017-10-16 12:41 ` Jiri Pirko
@ 2017-10-16 20:20 ` David Miller
2017-10-17 11:29 ` Sergei Shtylyov
2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2017-10-16 20:20 UTC (permalink / raw)
To: ogerlitz; +Cc: jiri, netdev, mlxsw, roid
From: Or Gerlitz <ogerlitz@mellanox.com>
Date: Mon, 16 Oct 2017 12:19:48 +0300
> Commit 7091d8c '(net/sched: cls_flower: Add offload support using egress
> Hardware device') made sure (when fl_hw_replace_filter is called) to put
> the egress_dev mark on persisent structure instance. Hence, following calls
> into the HW driver for stats and deletion will note it and act accordingly.
>
> With commit de4784ca030f this property is lost and hence when called,
> the HW driver failes to operate (stats, delete) on the offloaded flow.
>
> Fix it by setting the egress_dev flag whenever the ingress device is
> different from the hw device since this is exactly the condition under
> which we're calling into the HW driver through the egress port net-device.
>
> Fixes: de4784ca030f ('net: sched: get rid of struct tc_to_netdev')
> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
> Signed-off-by: Roi Dayan <roid@mellanox.com>
> ---
>
> Hi Dave, the bug was introduced in 4.14-rc1 but later the related
> code was changed in net-next, hence the fix must not go to net-next, Or.
Ok, applied to 'net' and I'll watch out for this next time I merge into
net-next.
Thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net] net/sched: cls_flower: Set egress_dev mark when calling into the HW driver
2017-10-16 9:19 [PATCH net] net/sched: cls_flower: Set egress_dev mark when calling into the HW driver Or Gerlitz
2017-10-16 12:41 ` Jiri Pirko
2017-10-16 20:20 ` David Miller
@ 2017-10-17 11:29 ` Sergei Shtylyov
2017-10-18 7:14 ` Or Gerlitz
2 siblings, 1 reply; 6+ messages in thread
From: Sergei Shtylyov @ 2017-10-17 11:29 UTC (permalink / raw)
To: Or Gerlitz, David S. Miller; +Cc: Jiri Pirko, netdev, mlxsw, Roi Dayan
Hello!
On 10/16/2017 12:19 PM, Or Gerlitz wrote:
> Commit 7091d8c '(net/sched: cls_flower: Add offload support using egress
At least 12 digits are needed.
> Hardware device') made sure (when fl_hw_replace_filter is called) to put
> the egress_dev mark on persisent structure instance. Hence, following calls
Persistent.
> into the HW driver for stats and deletion will note it and act accordingly.
>
> With commit de4784ca030f this property is lost and hence when called,
> the HW driver failes to operate (stats, delete) on the offloaded flow.
Fails.
> Fix it by setting the egress_dev flag whenever the ingress device is
> different from the hw device since this is exactly the condition under
> which we're calling into the HW driver through the egress port net-device.
>
> Fixes: de4784ca030f ('net: sched: get rid of struct tc_to_netdev')
> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
> Signed-off-by: Roi Dayan <roid@mellanox.com>
[...]
MBR, Sergei
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net] net/sched: cls_flower: Set egress_dev mark when calling into the HW driver
2017-10-17 11:29 ` Sergei Shtylyov
@ 2017-10-18 7:14 ` Or Gerlitz
2017-10-18 8:09 ` Sergei Shtylyov
0 siblings, 1 reply; 6+ messages in thread
From: Or Gerlitz @ 2017-10-18 7:14 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: Linux Netdev List
On Tue, Oct 17, 2017 at 2:29 PM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> Hello!
>
> On 10/16/2017 12:19 PM, Or Gerlitz wrote:
>
>> Commit 7091d8c '(net/sched: cls_flower: Add offload support using egress
>
>
> At least 12 digits are needed.
Also on such a spot (e.g not on the Fixes line)?
>
>> Hardware device') made sure (when fl_hw_replace_filter is called) to put
>> the egress_dev mark on persisent structure instance. Hence, following
>> calls
> Persistent.
right
>> into the HW driver for stats and deletion will note it and act
>> accordingly.
>> With commit de4784ca030f this property is lost and hence when called,
>> the HW driver failes to operate (stats, delete) on the offloaded flow.
> Fails.
correct
This is applied, will take more care next time
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net] net/sched: cls_flower: Set egress_dev mark when calling into the HW driver
2017-10-18 7:14 ` Or Gerlitz
@ 2017-10-18 8:09 ` Sergei Shtylyov
0 siblings, 0 replies; 6+ messages in thread
From: Sergei Shtylyov @ 2017-10-18 8:09 UTC (permalink / raw)
To: Or Gerlitz; +Cc: Linux Netdev List
Hello!
On 10/18/2017 10:14 AM, Or Gerlitz wrote:
>>> Commit 7091d8c '(net/sched: cls_flower: Add offload support using egress
>>
>> At least 12 digits are needed.
>
> Also on such a spot (e.g not on the Fixes line)?
Yes.
[...]
MBR, Sergei
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-10-18 8:09 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-16 9:19 [PATCH net] net/sched: cls_flower: Set egress_dev mark when calling into the HW driver Or Gerlitz
2017-10-16 12:41 ` Jiri Pirko
2017-10-16 20:20 ` David Miller
2017-10-17 11:29 ` Sergei Shtylyov
2017-10-18 7:14 ` Or Gerlitz
2017-10-18 8:09 ` Sergei Shtylyov
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.