From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [patch net-next v3 05/10] net: sched: keep track of offloaded filters and check tc offload feature Date: Fri, 15 Dec 2017 10:09:44 +0100 Message-ID: <20171215090944.GB1913@nanopsycho> References: <20171213151038.29665-1-jiri@resnulli.us> <20171213151038.29665-6-jiri@resnulli.us> <20171213170555.2a1e3022@cakuba.netronome.com> <20171214094716.GA1926@nanopsycho> <20171214131045.GD1926@nanopsycho> <20171214104941.2f051af1@cakuba.netronome.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, davem@davemloft.net, jhs@mojatatu.com, xiyou.wangcong@gmail.com, mlxsw@mellanox.com, andrew@lunn.ch, vivien.didelot@savoirfairelinux.com, f.fainelli@gmail.com, michael.chan@broadcom.com, ganeshgr@chelsio.com, saeedm@mellanox.com, matanb@mellanox.com, leonro@mellanox.com, idosch@mellanox.com, simon.horman@netronome.com, pieter.jansenvanvuuren@netronome.com, john.hurley@netronome.com, alexander.h.duyck@intel.com, ogerlitz@mellanox.com, john.fastabend@gmail.com, daniel@iogearbox.net To: Jakub Kicinski Return-path: Received: from mail-wr0-f194.google.com ([209.85.128.194]:40196 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754515AbdLOJJq (ORCPT ); Fri, 15 Dec 2017 04:09:46 -0500 Received: by mail-wr0-f194.google.com with SMTP id q9so7439178wre.7 for ; Fri, 15 Dec 2017 01:09:46 -0800 (PST) Content-Disposition: inline In-Reply-To: <20171214104941.2f051af1@cakuba.netronome.com> Sender: netdev-owner@vger.kernel.org List-ID: Thu, Dec 14, 2017 at 07:49:41PM CET, jakub.kicinski@netronome.com wrote: >On Thu, 14 Dec 2017 14:10:45 +0100, Jiri Pirko wrote: >> >Why? Just a namechange? >> > >> > >> >>IIUC the problem is we don't know whether the driver/callee of the new >> >>port is aware of previous callbacks/filters and we can't replay them. >> >> Well, the problem is a bit different. >> There are 2 scenarios when we need to fail here: >> 1) tc offload feature is turned off, there are some filters offloaded in >> the block. That is what I commented above. >> 2) tc offload feature is turned on, there are some filters offloaded in >> the block but the block is not accounted by the driver. This is >> because of the lack or replay. This is taken care of in the beginning >> of __tcf_block_cb_register function - see below, there is a comment >> there. > >Restating in code terms, shouldn't this: > >+ tcf_block_offload_cmd(block, dev, ei, TC_BLOCK_BIND); >+ return 0; > >return the error like this: > > return tcf_block_offload_cmd(block, dev, ei, TC_BLOCK_BIND); > >We expect simple drivers to do this: > > case TC_BLOCK_BIND: > return tcf_block_cb_register(f->block, mycb, > priv, priv); > >Which will return an error for shared offloaded block, just need to >propagate it. Got it. Will do. Thanks!