From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jakub Kicinski Subject: Re: [PATCH net] net: sched: cls: Fix offloading when ingress dev is vxlan Date: Tue, 5 Jun 2018 11:59:46 -0700 Message-ID: <20180605115946.28f24f7c@cakuba.netronome.com> References: <1528185843-18645-1-git-send-email-paulb@mellanox.com> <20180605115747.0e939ac4@cakuba.netronome.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Jiri Pirko , Cong Wang , Jamal Hadi Salim , David Miller , netdev@vger.kernel.org, Yevgeny Kliteynik , Roi Dayan , Shahar Klein , Mark Bloch , Or Gerlitz To: Paul Blakey Return-path: Received: from mx4.wp.pl ([212.77.101.11]:14203 "EHLO mx4.wp.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751987AbeFES7z (ORCPT ); Tue, 5 Jun 2018 14:59:55 -0400 In-Reply-To: <20180605115747.0e939ac4@cakuba.netronome.com> Sender: netdev-owner@vger.kernel.org List-ID: On Tue, 5 Jun 2018 11:57:47 -0700, Jakub Kicinski wrote: > On Tue, 5 Jun 2018 11:04:03 +0300, Paul Blakey wrote: > > When using a vxlan device as the ingress dev, we count it as a > > "no offload dev", so when such a rule comes and err stop is true, > > we fail early and don't try the egdev route which can offload it > > through the egress device. > > > > Fix that by not calling the block offload if one of the devices > > attached to it is not offload capable, but make sure egress on such case > > is capable instead. > > > > Fixes: caa7260156eb ("net: sched: keep track of offloaded filters [..]") > > Reviewed-by: Roi Dayan > > Acked-by: Jiri Pirko > > Signed-off-by: Paul Blakey > > Very poor commit message. What you're doing is re-enabling skip_sw > filters on tunnel devices which semantically make no sense and > shouldn't have been allowed in the first place. > > This will breaks block sharing between tunnels and HW netdevs (because > you skip the tcf_block_cb_call() completely). The entire egdev idea > remains badly broken accepting filters like this: > > # tc filter add dev vxlan0 ingress \ > matchall action skip_sw \ > mirred egress redirect dev lo \ > mirred egress redirect dev sw1np0 For above we probably need something like this (untested): diff --git a/net/sched/act_api.c b/net/sched/act_api.c index 3f4cf930f809..71e5eebec31a 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c @@ -1511,7 +1511,7 @@ int tc_setup_cb_egdev_call(const struct net_device *dev, struct tcf_action_egdev *egdev = tcf_action_egdev_lookup(dev); if (!egdev) - return 0; + return err_stop ? -EOPNOTSUPP : 0; return tcf_action_egdev_cb_call(egdev, type, type_data, err_stop); } EXPORT_SYMBOL_GPL(tc_setup_cb_egdev_call); But the correct fix is to remove egdev crutch completely IMO.