netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net : sched: cls_api: deal with egdev path only if needed
@ 2018-05-23 16:24 Or Gerlitz
  2018-05-25  2:13 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Or Gerlitz @ 2018-05-23 16:24 UTC (permalink / raw)
  To: David S. Miller
  Cc: Jiri Pirko, Jakub Kicinski, Paul Blakey, netdev, ASAP_Direct_Dev,
	Or Gerlitz

When dealing with ingress rule on a netdev, if we did fine through the
conventional path, there's no need to continue into the egdev route,
and we can stop right there.

Not doing so may cause a 2nd rule to be added by the cls api layer
with the ingress being the egdev.

For example, under sriov switchdev scheme, a user rule of VFR A --> VFR B
will end up with two HW rules (1) VF A --> VF B and (2) uplink --> VF B

Fixes: 208c0f4b5237 ('net: sched: use tc_setup_cb_call to call per-block callbacks')
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
---

Hi Dave,

As I wrote in [1], we are asking this patch to go into net and 
stable >= 4.15 but not carried into net-next.

thanks, 

Or.

[1] https://marc.info/?l=linux-netdev&m=152660659631964&w=2 

 net/sched/cls_api.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 963e4bf..a57e112 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -1588,7 +1588,7 @@ int tc_setup_cb_call(struct tcf_block *block, struct tcf_exts *exts,
 		return ret;
 	ok_count = ret;
 
-	if (!exts)
+	if (!exts || ok_count)
 		return ok_count;
 	ret = tc_exts_setup_cb_egdev_call(exts, type, type_data, err_stop);
 	if (ret < 0)
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] net : sched: cls_api: deal with egdev path only if needed
  2018-05-23 16:24 [PATCH net] net : sched: cls_api: deal with egdev path only if needed Or Gerlitz
@ 2018-05-25  2:13 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-05-25  2:13 UTC (permalink / raw)
  To: ogerlitz; +Cc: jiri, jakub.kicinski, paulb, netdev, ASAP_Direct_Dev

From: Or Gerlitz <ogerlitz@mellanox.com>
Date: Wed, 23 May 2018 19:24:48 +0300

> When dealing with ingress rule on a netdev, if we did fine through the
> conventional path, there's no need to continue into the egdev route,
> and we can stop right there.
> 
> Not doing so may cause a 2nd rule to be added by the cls api layer
> with the ingress being the egdev.
> 
> For example, under sriov switchdev scheme, a user rule of VFR A --> VFR B
> will end up with two HW rules (1) VF A --> VF B and (2) uplink --> VF B
> 
> Fixes: 208c0f4b5237 ('net: sched: use tc_setup_cb_call to call per-block callbacks')
> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>

Applied and queued up for -stable.

> As I wrote in [1], we are asking this patch to go into net and 
> stable >= 4.15 but not carried into net-next.

Please send me a revert with a detailed commit message when this
gets merged into net-next.

Thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-25  2:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-23 16:24 [PATCH net] net : sched: cls_api: deal with egdev path only if needed Or Gerlitz
2018-05-25  2:13 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).