From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [PATCH net 04/10] bpf: offload: move offload device validation out to the drivers Date: Mon, 20 Nov 2017 08:11:04 +0100 Message-ID: <20171120071104.GB2093@nanopsycho> References: <20171120045522.2188-1-jakub.kicinski@netronome.com> <20171120045522.2188-5-jakub.kicinski@netronome.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, alexei.starovoitov@gmail.com, daniel@iogearbox.net To: Jakub Kicinski Return-path: Received: from mail-wr0-f182.google.com ([209.85.128.182]:45568 "EHLO mail-wr0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750764AbdKTHLH (ORCPT ); Mon, 20 Nov 2017 02:11:07 -0500 Received: by mail-wr0-f182.google.com with SMTP id a63so7112156wrc.12 for ; Sun, 19 Nov 2017 23:11:06 -0800 (PST) Content-Disposition: inline In-Reply-To: <20171120045522.2188-5-jakub.kicinski@netronome.com> Sender: netdev-owner@vger.kernel.org List-ID: Mon, Nov 20, 2017 at 05:55:16AM CET, jakub.kicinski@netronome.com wrote: >With TC shared block changes we can't depend on correct netdev >pointer being available in cls_bpf. Move the device validation >to the driver. Core will only make sure that offloaded programs >are always attached in the driver (or in HW by the driver). We >trust that drivers which implement offload callbacks will perform >necessary checks. > >Moving the checks to the driver is generally a useful thing, >in practice the check should be against a switchdev instance, >not a netdev, given that most ASICs will probably allow using >the same program on many ports. > >Signed-off-by: Jakub Kicinski >Reviewed-by: Quentin Monnet >Acked-by: Alexei Starovoitov >Acked-by: Daniel Borkmann Acked-by: Jiri Pirko