Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp1245646ima; Fri, 1 Feb 2019 19:46:50 -0800 (PST) X-Google-Smtp-Source: ALg8bN5+E0Hgxrzbe/K/WoC0AwibLNAGqxIgFIJUvAcpcrG4AS0OLsqtSLDR5aZ+d0LTwXumK1vv X-Received: by 2002:a62:5b44:: with SMTP id p65mr41709780pfb.47.1549079210670; Fri, 01 Feb 2019 19:46:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549079210; cv=none; d=google.com; s=arc-20160816; b=yze/1hcFPSYGNSdWiIWHN6Yfcgj7hSh3nesbsweH7l4T98cxsD+kGb7yYLRrqFMlCS 9+oFo5klxDezm3p6GV2hII6QRS7wLYGHc/L+SXHoWqgSidB+32/FQSt0YIntjDleUDaY VLoHL14WjBh4VS9QLcLVMBDa4+judRowdkMr0IL21XG+MAPiGi9j3+9Q3LwArBk25f2p toV54Qdt/6RbNrO0aF7AorF0FWmS8proFeJ0QrpJJMKeNL9ZuTTCXeQo5Wkd5HcuWmnn IvqJUAOrCUHV0U/WnB/RA9yiC4d+ANY6M6NMT13m9Ksx7ihIGyfPXDJvAh9qaOo13K+l Yczw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=qGYGMdLI1E9U8tsRC/gCfqX8vID7DS6aiO77Nz4B9m8=; b=eBwshrbdxLSTKzskM7qDVZ97D/0SHltdSVV/bGGkm6J9z+laA86bhBBwDYdVmkiDm5 AxhhixBqDzOYyzio6ZYrL5IxJbe1pvZgi5Ph6VY87xLOmRh7jpX+Xwi9AFX6KQGQ2/iA n7KyJU4TKyHCNuydiAEmimAmSUMCpROlwjaCPPQAoI++vQiabZBXRZDptxf+GwiMpWLm yAu2fE0wfILL0+KEgc9SNuAYLvxHPYjkoHVb+re+JPKcLntX5s0K2YSQTfhIqHxGhfuP qKFIwc0eKYo4hESvde6IiUUlShm8w01QjoTNQFPdIisC+pW9AkmnUIjG0kiXapuM32wp WQLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=YR1NipHv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d4si4008778pls.348.2019.02.01.19.46.34; Fri, 01 Feb 2019 19:46:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=YR1NipHv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727290AbfBBDpu (ORCPT + 99 others); Fri, 1 Feb 2019 22:45:50 -0500 Received: from mail-pg1-f178.google.com ([209.85.215.178]:35110 "EHLO mail-pg1-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726872AbfBBDpt (ORCPT ); Fri, 1 Feb 2019 22:45:49 -0500 Received: by mail-pg1-f178.google.com with SMTP id s198so3861782pgs.2 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=IBKI1IWHdVP84gOSW5P9A6rYRTqS44RTCMw88y1oMcCJycCdz1CCe7QqyhnQc2VYJ/ SC1mTTvICxzfWFJSJJWpXSXIW6/F1SRUPQjv6+qUtO8ITykfHLwCkMlvxDzDck74+Pr9 jprZMI+2tJj2+nUfFn3H8OF8RFCCDgCyVSrEkQlbFwapKHRpMoustLzTswg6vX0spyG3 8uR8FgHdy9VFrpWWFTI3oUpfoW/N/uZHN0bNS2GyQ4wLYNheqM5pgWHznuWF1MfwXEWU cSSDKUwCbU2QMRm+TIHsuklnu9KNFQ8gxOjOrmaNi+hgcPq1BX7etOaCzUm30JFrpeS2 a2hg== X-Gm-Message-State: AHQUAubV8kZLX9qyTw0OfDLx3PXAwxixEkPX8/dMUiamoVnjOn0uvgoc ycAQm+Lzu+U2n8ov5uJhCHTZMg== 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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 :)