Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp5652160ima; Tue, 5 Feb 2019 15:59:05 -0800 (PST) X-Google-Smtp-Source: AHgI3IY1CS9JKrFEZJOqNpqXqe9WpO4lh/mkjGBmVP+uA/q/iAvC9qoo3v7vqGArzO/LazcOEJdu X-Received: by 2002:a63:be0a:: with SMTP id l10mr2186184pgf.292.1549411145906; Tue, 05 Feb 2019 15:59:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549411145; cv=none; d=google.com; s=arc-20160816; b=LCpoyaMfZGVPdWjpZwR4G+BzVsyHBNJnkb7/tf3sPqd9YRDaXqxCkdJhuRi3siB7St hthhrZj9V64SP9UFp0z0RQYPFRhKj9p+zXARgF7kSrG8sHrOEwhpTEW8U884kBDpgxku VeD3HRHrcUbvE5QNA8qPHDE//31r5v2+4bcdCCkr8jBPKe8p736XWcbMn4ioQmd1Xrdk GhpuyFmOnqC0qrAZ28tsLia6sI06lBiCAsRTDuY44tp3QENdLCdVYoJxPDZ6hGNvf/hq Ilnf3WZ22AgWLxKag22uEs8e+biIgwuc8j2IN0aSaNj3EX1zCHyql1WE4om9QQQk1FGm ZosA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=aI1v+H23/ZvIO3gX4umuhDThsa6Tzq1oIj/V7Nd0TRA=; b=Ra83O3Phrl53JrEMnyA+RJLuJqPxveeCYqqQQ/K3mHrBQ0lGlygfFXK56OC4tP2kZB aJcOKDY8jfqYlPv21wmXINX72N+G4mMF3MucjCwkQ/KzRzUH+36t4nhmUqGibb/HZ7tL Lse4S/nQr395KXJ8QcFPa6hAwKtqPoP5Pm5WvgNAkgojSYqtD4iDza2o53PBqieflZZx hBZsbfXZt0vCvw+c2b7+CcjNXEcaIJ/FIhgl3Pz7O1G7wU3oS105Ea58+6oM6AyNrZUZ PMbkQ0vo4jJ+f6BukJvwbMTPBiqAiYQIyENgspkQF1VNP81i6Qzf7ox1mQnZpqB2qaJm Hmdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KF9BGUIU; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w24si4187338pgj.582.2019.02.05.15.58.50; Tue, 05 Feb 2019 15:59:05 -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=@gmail.com header.s=20161025 header.b=KF9BGUIU; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727397AbfBEXzm (ORCPT + 99 others); Tue, 5 Feb 2019 18:55:42 -0500 Received: from mail-pg1-f176.google.com ([209.85.215.176]:40171 "EHLO mail-pg1-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725967AbfBEXzl (ORCPT ); Tue, 5 Feb 2019 18:55:41 -0500 Received: by mail-pg1-f176.google.com with SMTP id z10so2115528pgp.7; Tue, 05 Feb 2019 15:55:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=aI1v+H23/ZvIO3gX4umuhDThsa6Tzq1oIj/V7Nd0TRA=; b=KF9BGUIUvBhG4+MCAUAkUcjGX5AI1auHdzoMuhuy6vBH4Jwid48D62T6lrz7rmuTsg uInQxUimrCTwn5svY9xjCGUj1ECEzd/lZZ/izR/WT+XKVn2DZ2siJb4R2CTVUvyMLMg9 RmkfOJRHNKI9XPlKEdg+/5qdP1R5Bz5B5puvL607Bs66FepWf3h1tY2/0RGRr9AkoMJS 5Ed4sC/cmIsUeQoHg18+2S+rogIJgDKzn7q1PHcT0QsgV9VEuIYlFuvA8R72bkwL7o4L vNEFep+k2lrqmkqtKqrMP7tyXD3DurpKUWqJzVgxgVwfnPxgtCoN51u5Dzb2nTGuJ5/a s42A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=aI1v+H23/ZvIO3gX4umuhDThsa6Tzq1oIj/V7Nd0TRA=; b=S0L9hgus1Lm6kfZKPjwrF6G3GEzsGUVYhCtQ3NjtGvycF+6B6SBoUpGfoXG5YVO1iV /TewLD1aFyl4qVHng3THyNeHEkxu0u9glTrI/p9yt191rdrjzLd14cUpm2zy+pAVMp1e w1Nbzc+l/rEhSjZ2x66hri/3tVi8D/W4smw6BT2ymnVUfbcVw8kUEj7sSgowEMDeFDFq V/YDOnk4xvmsQeOYVUtDu69oyWBdRteJasICJnNflwUQFX4woOVCc7xonmD6XO9FLnd2 6msAOk8xdqStLi2vIuM0Bw6iOBpIVocEHN28Rb/av2ZzInLO/YA8PVpgOYuj5YxOhZe+ 4w1g== X-Gm-Message-State: AHQUAuaBzw9ATE5Se720e2hQIijexT6YyQQvzLzCgm0hJWZH1HtJXObR 9+q9ZYxWrEPaj/lrxDcyUbKNrIN+ X-Received: by 2002:a62:4618:: with SMTP id t24mr7570719pfa.139.1549410940282; Tue, 05 Feb 2019 15:55:40 -0800 (PST) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id v184sm6770197pfb.182.2019.02.05.15.55.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Feb 2019 15:55:39 -0800 (PST) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , "David S. Miller" , Ido Schimmel , 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), bridge@lists.linux-foundation.org (moderated list:ETHERNET BRIDGE) Subject: [PATCH net-next v3 00/12] net: Introduce ndo_get_port_parent_id() Date: Tue, 5 Feb 2019 15:53:14 -0800 Message-Id: <20190205235326.14600-1-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, Based on discussion with Ido and feedback from Jakub there are clearly two classes of users that implement SWITCHDEV_ATTR_ID_PORT_PARENT_ID: - PF/VF drivers which typically only implement return the port's parent ID, yet have to implement switchdev_port_attr_get() just for that - Ethernet switch drivers: mlxsw, ocelot, DSA, etc. which implement more attributes which we want to be able to eventually veto in the context of the caller, thus making them candidates for using a blocking notifier chain Changes in v3: - keep ethsw's switchdev_ops assignment - remove inclusion of net/switchdev.h in netdevsim which is no longer necesary Changes in v2: - resolved build failures spotted by kbuild test robot - added helpers functions into the core network device layer: dev_get_port_parent_id() and netdev_port_same_parent_id(); - added support for recursion to lower devices Changes from RFC: - introduce a ndo_get_port_parent_id() and convert all relevant drivers to use it - get rid of SWITCHDEV_ATTR_ID_PORT_PARENT_ID A subsequent set of patches will convert switchdev_port_attr_set() to use a blocking notifier call, and still get rid of switchdev_port_attr_get() altogether. Florian Fainelli (12): net: Introduce ndo_get_port_parent_id() bnxt: Implement ndo_get_port_parent_id() liquidio: Implement ndo_get_port_parent_id() net/mlx5e: Implement ndo_get_port_parent_id() mlxsw: Implement ndo_get_port_parent_id() mscc: ocelot: Implement ndo_get_port_parent_id() nfp: Implement ndo_get_port_parent_id() rocker: Implement ndo_get_port_parent_id() netdevsim: Implement ndo_get_port_parent_id() staging: fsl-dpaa2: ethsw: Implement ndo_get_port_parent_id() net: dsa: Implement ndo_get_port_parent_id() net: Get rid of SWITCHDEV_ATTR_ID_PORT_PARENT_ID drivers/net/ethernet/broadcom/bnxt/bnxt.c | 28 +++------ drivers/net/ethernet/broadcom/bnxt/bnxt.h | 4 +- drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 3 +- drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c | 12 ++-- .../net/ethernet/cavium/liquidio/lio_main.c | 22 ++----- .../net/ethernet/cavium/liquidio/lio_vf_rep.c | 25 +++----- .../ethernet/mellanox/mlx5/core/en/tc_tun.c | 2 +- .../net/ethernet/mellanox/mlx5/core/en_rep.c | 31 ++++------ .../net/ethernet/mellanox/mlx5/core/en_tc.c | 5 +- .../net/ethernet/mellanox/mlxsw/spectrum.c | 13 +++++ .../mellanox/mlxsw/spectrum_switchdev.c | 5 -- .../net/ethernet/mellanox/mlxsw/switchx2.c | 36 +++++------- drivers/net/ethernet/mscc/ocelot.c | 33 +++++------ .../ethernet/netronome/nfp/flower/action.c | 3 +- .../ethernet/netronome/nfp/nfp_net_common.c | 4 +- .../net/ethernet/netronome/nfp/nfp_net_repr.c | 4 +- drivers/net/ethernet/netronome/nfp/nfp_port.c | 23 ++------ drivers/net/ethernet/netronome/nfp/nfp_port.h | 4 +- drivers/net/ethernet/rocker/rocker_main.c | 17 ++++-- drivers/net/netdevsim/netdev.c | 23 ++------ drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 16 ++++-- include/linux/netdevice.h | 9 +++ include/net/switchdev.h | 11 ---- net/bridge/br_switchdev.c | 11 ++-- net/core/dev.c | 57 +++++++++++++++++++ net/core/net-sysfs.c | 12 +--- net/core/rtnetlink.c | 14 ++--- net/dsa/slave.c | 18 ++++-- net/ipv4/ipmr.c | 14 ++--- net/switchdev/switchdev.c | 20 ------- 30 files changed, 219 insertions(+), 260 deletions(-) -- 2.17.1