From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75C05C282D8 for ; Sat, 2 Feb 2019 03:45:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4495F2086C for ; Sat, 2 Feb 2019 03:45:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.b="YR1NipHv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727608AbfBBDpz (ORCPT ); Fri, 1 Feb 2019 22:45:55 -0500 Received: from mail-pg1-f177.google.com ([209.85.215.177]:41693 "EHLO mail-pg1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726246AbfBBDpt (ORCPT ); Fri, 1 Feb 2019 22:45:49 -0500 Received: by mail-pg1-f177.google.com with SMTP id m1so3847534pgq.8 for ; Fri, 01 Feb 2019 19:45:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=qGYGMdLI1E9U8tsRC/gCfqX8vID7DS6aiO77Nz4B9m8=; b=YR1NipHv4vwAEtvfDfNLAEQUzl+JGObVgGyhxM6+Xxit4bYhzL9Zn+v2KuHlIPqtcq +8atmOsQZDkphNBhOwjl67ql9yP2TkmMN1IYLcfXJKEwkWD3UxnOao4yE7AO/WHzWRlv mSnBXfHQ/ZQVByabOE9CP8NdBcZ7MfT7cj4fqc010BGMzg2FgJ5RWXF/CxkPAfTSyogT T0aoBi0YUqOQrHsHJCUqG+8dCTyB/tV7Zn8XRKjr36E6f3tgJBK0k9ctlakFjvVcIIuI 51jxIanb0Z9nDfpJWw2LzPRDxcTSaUCY6HtYhDESXB8hFlArcxdYNxMgB1H3RoOF0/by wuew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=qGYGMdLI1E9U8tsRC/gCfqX8vID7DS6aiO77Nz4B9m8=; b=NzVOJpqNa/A+y8QAbyOoeKCn/FnZVWoOKE/8HyQhfPjeWWhOwWQBkPk7vNT6RTG0vd jswEgLZDRUxxY5SIlNvTgt+3JC+rxdlOBkNymLmZfHNU+16bw9C34+v9WLPKqj9JBWlm 17pWZucRImbFLZGCNgqs0cKCz0+8qfJP5BhwUJxI5GMwRr/GSyaDrkovxM0k3W3nMBii VzjJofR4tZhjqgGSe7Ca82zm0dygdRQu+bw62Vn+5ZhFQ+6tDsz92CtR7YBU3li4Ce4a /M/bZCDjbn183Yhb6vpaK1h8CjMPQGvjkEHWz7gnKN++JIRwMy7B+pjhG0EnpF5NCRR1 AxEw== X-Gm-Message-State: AHQUAuaEHGXEl7Gq8sMve8ddpo7tfwkMEf+KRLw3Tky39E3G+tOyB75Z HHDkaUjqCXgeVzpqnd6BRQqInQ== X-Google-Smtp-Source: AHgI3Ib9hiAixoW8iLR2I06rCFAy8WzFHqFPYuqC+ivKC+oglhsrHX0kcAo376IpTTPVTyc1D0FquQ== X-Received: by 2002:a63:e302:: with SMTP id f2mr4945675pgh.320.1549079148571; Fri, 01 Feb 2019 19:45:48 -0800 (PST) Received: from cakuba.hsd1.ca.comcast.net ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id m3sm15832716pgl.69.2019.02.01.19.45.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Feb 2019 19:45:48 -0800 (PST) Date: Fri, 1 Feb 2019 19:45:41 -0800 From: Jakub Kicinski To: Florian Fainelli Cc: netdev@vger.kernel.org, Michael Chan , "David S. Miller" , Derek Chickles , Satanand Burla , Felix Manlunas , Saeed Mahameed , Leon Romanovsky , Jiri Pirko , Ido Schimmel , Alexandre Belloni , Microchip Linux Driver Support , Ioana Radulescu , Ioana Ciornei , Greg Kroah-Hartman , Ivan Vecera , Andrew Lunn , Vivien Didelot , Dirk van der Merwe , "Francois H. Theron" , Simon Horman , Quentin Monnet , Daniel Borkmann , Eric Dumazet , John Hurley , Edwin Peer , linux-kernel@vger.kernel.org (open list), linux-rdma@vger.kernel.org (open list:MELLANOX MLX5 core VPI driver), oss-drivers@netronome.com (open list:NETRONOME ETHERNET DRIVERS), devel@driverdev.osuosl.org (open list:STAGING SUBSYSTEM) Subject: Re: [RFC net-next 11/13] nfp: Handle SWITCHDEV_PORT_ATTR_GET event Message-ID: <20190201194541.49754fbf@cakuba.hsd1.ca.comcast.net> In-Reply-To: <20190201220657.30170-12-f.fainelli@gmail.com> References: <20190201220657.30170-1-f.fainelli@gmail.com> <20190201220657.30170-12-f.fainelli@gmail.com> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, 1 Feb 2019 14:06:55 -0800, Florian Fainelli wrote: > Following patches will change the way we communicate getting or setting > a port's attribute and use a blocking notifier to perform those tasks. > > Prepare nfp to support receiving notifier events targeting > SWITCHDEV_PORT_ATTR_GET and simply translate that into the existing > switchdev_ops::switchdev_port_attr_get operation. > > We register a single blocking switchdev notifier for the entire driver > instance and we differentiate a "net" from a "repr" by comparing the > network device's netdev_ops with the ones that this driver manages. > > Signed-off-by: Florian Fainelli Thanks Florian, the code looks good, only nit I have is - could you move nfp_switchdev_blocking_event() to nfp_port.c and nfp_port.h? We shouldn't touch nfp_net_common.c here. In general calling a notifier to get the parent_id (which is the only thing all these SR-IOV NIC drivers implement) seems a tad heavy. It's an immutable, read-only attribute of a port, perhaps we can break it out? Could we make it an NDO, perhaps? That's just my knee jerk reaction, given that NIC drivers don't implement any of the bridging side of switchdev I may not have a full appreciation of the abstraction you are building here :)