Received: by 2002:ac0:8c8e:0:0:0:0:0 with SMTP id r14csp895682ima; Wed, 6 Feb 2019 10:04:24 -0800 (PST) X-Google-Smtp-Source: AHgI3IYC3JFhSG5Dv8kIiwxG7GBnjERWNrBAE+dMn4JNkHDrMrnft117v740qxuk3AscKorguNHQ X-Received: by 2002:a62:c101:: with SMTP id i1mr11769155pfg.80.1549476264109; Wed, 06 Feb 2019 10:04:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549476264; cv=none; d=google.com; s=arc-20160816; b=T3E+0Q6lBl83w1eYtXM8WnMG8HteU9+xLGaviEdg0t6qUdA0kBS85mFaGOv3tdhVAP qFNgm9CWvhlBXOwi87+okmSXh4yKXLLmjWIXE/Zvt9CM2BywmbLdMoO/n06ABOXa5Z7v j6yadq5GKp6JwSkFP2fvSGfsTQkF8u1L/A0RyIIzZNMPNLo5Lt4y2DzlwcSCNSNiV0bE 8Su+lBa1hlMT5u7P8n6jZ3JivbLuB02XNgx3tgC70ERgNB+Lm8/Q4KkElW04q0axW5iE J0ucHCTMPOeUUsAFaNFOCtRYIq5rYBnzQDOn4qiQGcZhvqwm/8nJFtsgGe2ISVc0DA6r yuzw== 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=soD9Dgs2FvVHhYFf8XnK6PEgV8iisdLfjJhmqRKiqfU=; b=AeguTS2KNkZ/B/PQsOi8kMSH6RvctHTxDl6++/O7v50pRA6U+ItA7saCeXkiYPa1Jv aoa8Wcl+QmEX2Ox2SiJd3gcafz//XndiEJs+8BrZuI/AdX6csva++SyK+y0MQaI2+tbS FuSzO9+dPk2CUuI/ZFSBQyMw8ceE67uT0WqHKNLRrlUMWgiicdMt9cAZI2er/OWBNGDO IAFwrmAGQSr6zie2IvLmidZ6RKixwRNI1QDm/OWgBJnrSINFxEc5pCkz1pYFDcmNhoIZ pQtDp2Hb40sgqftht6vnSYs12IZeGMoBMraK0xiHpIVsAEnky+fnluM7Dmg7ryGxo9gX dEhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MwRrIr1G; 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 n21si6106600pgm.456.2019.02.06.10.03.58; Wed, 06 Feb 2019 10:04:24 -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=MwRrIr1G; 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 S1730395AbfBFRqF (ORCPT + 99 others); Wed, 6 Feb 2019 12:46:05 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:42292 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725928AbfBFRqF (ORCPT ); Wed, 6 Feb 2019 12:46:05 -0500 Received: by mail-pf1-f193.google.com with SMTP id 64so3399366pfr.9; Wed, 06 Feb 2019 09:46:04 -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=soD9Dgs2FvVHhYFf8XnK6PEgV8iisdLfjJhmqRKiqfU=; b=MwRrIr1G0Aw8SyrU/MZ3zTlCZYRXtiHnu+1luyabcIz5dLLZ2F1ZtkHNdKplfyIzSM krNDRru3ErDQu7gNIl+l10nfP7iN2pp2AEAfLWCqI2lJlBzRBvXrnRMmi66lB4Rrl+Y5 yd/ZugGFrs+zxYQl1EO5G0Wm8SL1s1sfryfb9ppLXJO4Ce4ZnM9o1+/f3kh5RYvy9NBl yp5cepXURBgaqj6a8vFTTMprmTmtGozImxDGiDqtXY3K7hpj8NcDY1QyVhUTWOQAeJmm ZuCoVGng6MolfDKB9BXrNVUnr/QVx0U1I0YUxFUA1vjJPylDq0mFN+iUNV2i2LG8cUrO VLpg== 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=soD9Dgs2FvVHhYFf8XnK6PEgV8iisdLfjJhmqRKiqfU=; b=Q7TPcnie7lhD0z2vcp7TNRyvBHSXZFYy6n03MhkHp7yYkgPU3S5YEmgrdvIrEmZFRo 4hN8xagDM/J/MDw9TNG6uNIt9xOPovqhRWAAkT6TzeCczzap3cqtUMjeF2zEz929bhsW FgmQvxD5P16prcGWl7GV6Zf9oY72dIaXfwM7MZCRQamvNpvX0gfFamUk/WWyRcrIVgGJ TIDZ5f4QjXmKSygLi0T3sQecJH4pWhMah2ed01QLVDv++T+/Ev1lorq38IR8N5VcDI+C 7RK5tRHJO7Skf07qFj1tmr1//Xl+7szi0joLfU0ZFN8ivYX0m8nUccHVipluDDj0LNYt ykTg== X-Gm-Message-State: AHQUAuaJFpp/nFtUmrTUdLcOmvndnB6gvvtumn8dJZmxI1GcdTBekbxC C0EOmqkrBsSsy+ltle5S7FQVZeZo X-Received: by 2002:a63:7f46:: with SMTP id p6mr10703300pgn.54.1549475163780; Wed, 06 Feb 2019 09:46:03 -0800 (PST) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id 15sm10435313pfr.55.2019.02.06.09.46.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Feb 2019 09:46:02 -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 v4 00/12] net: Introduce ndo_get_port_parent_id() Date: Wed, 6 Feb 2019 09:45:34 -0800 Message-Id: <20190206174546.23597-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 v4: - remove superfluous net/switchdev.h inclusions in a few files - added Jiri's Acked-by where given - removed err = -EOPNOTSUPP initializations - changed according to Jiri's suggestion in net/ipv4/ipmr.c 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 | 2 +- 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 | 37 +++++------- 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 | 22 ++----- 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 | 9 +-- net/core/dev.c | 57 +++++++++++++++++++ net/core/net-sysfs.c | 12 +--- net/core/rtnetlink.c | 12 +--- net/dsa/slave.c | 18 ++++-- net/ipv4/ipmr.c | 13 ++--- net/switchdev/switchdev.c | 20 ------- 30 files changed, 214 insertions(+), 259 deletions(-) -- 2.17.1