From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [PATCH net-next 1/6] net: sched: register callbacks for indirect tc block binds Date: Mon, 12 Nov 2018 07:37:00 +0100 Message-ID: <20181112063700.GA2224@nanopsycho.orion> References: <20181110052131.3306-1-jakub.kicinski@netronome.com> <20181110052131.3306-2-jakub.kicinski@netronome.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: davem@davemloft.net, oss-drivers@netronome.com, netdev@vger.kernel.org, xiyou.wangcong@gmail.com, jhs@mojatatu.com, gerlitz.or@gmail.com, ozsh@mellanox.com, vladbu@mellanox.com, John Hurley To: Jakub Kicinski Return-path: Received: from mail-wm1-f67.google.com ([209.85.128.67]:55556 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731613AbeKLQfY (ORCPT ); Mon, 12 Nov 2018 11:35:24 -0500 Received: by mail-wm1-f67.google.com with SMTP id i73-v6so1933763wmd.5 for ; Sun, 11 Nov 2018 22:43:31 -0800 (PST) Content-Disposition: inline In-Reply-To: <20181110052131.3306-2-jakub.kicinski@netronome.com> Sender: netdev-owner@vger.kernel.org List-ID: Sat, Nov 10, 2018 at 06:21:26AM CET, jakub.kicinski@netronome.com wrote: >From: John Hurley > >Currently drivers can register to receive TC block bind/unbind callbacks >by implementing the setup_tc ndo in any of their given netdevs. However, >drivers may also be interested in binds to higher level devices (e.g. >tunnel drivers) to potentially offload filters applied to them. > >Introduce indirect block devs which allows drivers to register callbacks >for block binds on other devices. The callback is triggered when the >device is bound to a block, allowing the driver to register for rules >applied to that block using already available functions. > >Freeing an indirect block callback will trigger an unbind event (if >necessary) to direct the driver to remove any offloaded rules and unreg >any block rule callbacks. It is the responsibility of the implementing >driver to clean any registered indirect block callbacks before exiting, >if the block it still active at such a time. > >Allow registering an indirect block dev callback for a device that is >already bound to a block. In this case (if it is an ingress block), >register and also trigger the callback meaning that any already installed >rules can be replayed to the calling driver. > >Signed-off-by: John Hurley >Signed-off-by: Jakub Kicinski Acked-by: Jiri Pirko