From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [PATCH net-next v4 6/8] net: sched: create tc_can_offload_extack() wrapper Date: Sat, 20 Jan 2018 11:54:27 +0100 Message-ID: <20180120105427.GG2147@nanopsycho.orion> References: <20180120014450.29666-1-jakub.kicinski@netronome.com> <20180120014450.29666-7-jakub.kicinski@netronome.com> <20180120085929.GB2147@nanopsycho.orion> <20180120102236.GF2147@nanopsycho.orion> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: David Miller , David Ahern , aring@mojatatu.com, Daniel Borkmann , Alexei Starovoitov , Linux Netdev List , oss-drivers@netronome.com, Quentin Monnet To: Jakub Kicinski Return-path: Received: from mail-wr0-f196.google.com ([209.85.128.196]:42167 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751022AbeATKy3 (ORCPT ); Sat, 20 Jan 2018 05:54:29 -0500 Received: by mail-wr0-f196.google.com with SMTP id e41so3779357wre.9 for ; Sat, 20 Jan 2018 02:54:29 -0800 (PST) Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: Sat, Jan 20, 2018 at 11:33:31AM CET, jakub.kicinski@netronome.com wrote: >On Sat, Jan 20, 2018 at 2:22 AM, Jiri Pirko wrote: >> Sat, Jan 20, 2018 at 11:12:25AM CET, jakub.kicinski@netronome.com wrote: >>>net/sched/sch_prio.c: if (!tc_can_offload(dev) || >>>!dev->netdev_ops->ndo_setup_tc) >>>net/sched/sch_prio.c: if (!tc_can_offload(dev) || >>>!dev->netdev_ops->ndo_setup_tc) >>>net/sched/sch_red.c: if (!tc_can_offload(dev) || >>>!dev->netdev_ops->ndo_setup_tc) >>>net/sched/sch_red.c: if (!tc_can_offload(dev) || >>>!dev->netdev_ops->ndo_setup_tc) >>> >>>Do you mean the qdisc offloads too? The whole lot? >> >> Yes. > >Actually looking at the qdisc code and destroy callbacks, if we plumb >it through everywhere won't that mean user will see error messages on >destroy of qdiscs/filters which were never offloaded? > >Just looking at prio_offload() as a simple example. prio_destroy() >will always call tc_can_offload(). Hmmm. You are right. Either we pass null from there (NL_SET_ERR_MSG can cope), or we leave tc_can_offload helper as is and let the caller to set the extack. I see that tc_can_offload_extack is probably good idea then. But please use it in all drivers that are calling tc_can_offload so the user experience is consistent for all. Thanks!