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=-3.0 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_GIT autolearn=ham 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 F13C5C43381 for ; Tue, 26 Feb 2019 03:34:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C193C21848 for ; Tue, 26 Feb 2019 03:34:17 +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="oocPFnBY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726397AbfBZDeQ (ORCPT ); Mon, 25 Feb 2019 22:34:16 -0500 Received: from mail-qt1-f193.google.com ([209.85.160.193]:39883 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726185AbfBZDeQ (ORCPT ); Mon, 25 Feb 2019 22:34:16 -0500 Received: by mail-qt1-f193.google.com with SMTP id o6so13334778qtk.6 for ; Mon, 25 Feb 2019 19:34:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=s9COztPMk83HeTKyGGOpJsgUou+zZvRGfHBpLpAEkPo=; b=oocPFnBYsSd90gaJiwr6QQat8vpwwZOHGcnfmqGWWiBKumf6G84SAd7vrTBT2F4HJy fGt4UhMOROucalOFOMGllbGCAdXCKu7BaxV8oYHjSl0tEnIA8BH3pMYi3f9hNi946N8B ++ppz659X/r+Y7p0DL0jVzvfvSklS42CypDF3YuL/GK0ixo66RXbETiUfdSymdwh7p0e wDrGwSdt5IyGj0xuPVynQWfflkkf5efe1L33OXHevDEfogcka2WDnFeek4cOKSA7qSFs nquCpPAuBa+X/heuqacIH1StJauKkoHg3BJwPSI+OrbaaRH/t8GYXq2DveovnQiEFZK/ o4tA== 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:mime-version :content-transfer-encoding; bh=s9COztPMk83HeTKyGGOpJsgUou+zZvRGfHBpLpAEkPo=; b=U5e7QNVBf8nMf29Dw0cyE0XuX8+c8CnS+ZdVzNNe/E08+4aG9haYpmSKpS4Z8d4Gyt T6eoTzE/i3gd1sITYSGs7SJVfyhKX6pZMAJvMTK62yj6k4335jZ3nz46XNXuDOVPltDp 3TNDN7i8SEX5QFGI++kj9QUCL2fQ6EXkrgXdXTXRRciYBCc+tdYX7PkaA82MX0oO2qcc cBRFVVvJIi/57rkiJzunOQm+k6DvTho0iA4dlr7Sw+yybfgSlhB6dSpDaJ+6J7m+Se2P HUGvZ3f9Ckda+lHUg+64XbmDqA6d0tEO5QoUAEiJgTBlHhao9a+U7vJZBYvWl5pmmU+q ILWw== X-Gm-Message-State: AHQUAuaeY6iIGX09X8nw2m9H+gBC9HWgNjIWeNtjZbnrWqR/zuVM1aQT AX2g8pjyb/xqjJNj7tu4YCPzgTbnzyw= X-Google-Smtp-Source: AHgI3IZALfU34UELcVMs5IhxRzsA4OTix/Li/dY9pAGBhTWKWpXipynNhelys+rnqfvPhO4Syk2gGg== X-Received: by 2002:ac8:2f3b:: with SMTP id j56mr15380879qta.293.1551152054721; Mon, 25 Feb 2019 19:34:14 -0800 (PST) Received: from jkicinski-Precision-T1700.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id i20sm8120317qta.19.2019.02.25.19.34.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Feb 2019 19:34:13 -0800 (PST) From: Jakub Kicinski To: davem@davemloft.net, jiri@resnulli.us Cc: mkubecek@suse.cz, andrew@lunn.ch, f.fainelli@gmail.com, netdev@vger.kernel.org, oss-drivers@netronome.com, Jakub Kicinski Subject: [PATCH net-next v4 0/6] devlink: make ethtool compat reliable Date: Mon, 25 Feb 2019 19:34:01 -0800 Message-Id: <20190226033407.32625-1-jakub.kicinski@netronome.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi! This is a follow up to the series which added device flash updates via devlink. I went with the approach of adding a new NDO in the end. It seems to end up looking cleaner. First patch removes the option to build devlink as a module. Users can still decide to not build it, but the module option ends up not being worth the maintenance cost. Next two patches add a NDO which can be used to ask the driver to return a devlink instance associated with a given netdev, instead of iterating over devlink ports. Drivers which implement this NDO must take into account the potential impact on the visibility of the devlink instance. With the new NDO in place we can remove NFP ethtool flash update code. Fifth patch makes sure we hold a reference to dev while callbacks are active. Last but not least the NULL-check of devlink->ops is moved to instance allocation time. Last but not least missing checks for devlink->ops are added. There is currently no driver registering devlink without ops, so can just fix this in -next. v2 (Michal): add netdev_to_devlink() in patch 3. v3 (Florian): - add missing checks for devlink->ops; - move locking/holding into devlink_compat_ functions. v4 (Jiri): - hold devlink_mutex around callbacks (patch 2); - require non-NULL ops (patch 6). Jakub Kicinski (6): net: devlink: turn devlink into a built-in devlink: create a special NDO for getting the devlink instance nfp: add .ndo_get_devlink nfp: remove ethtool flashing fallback devlink: hold a reference to the netdevice around ethtool compat devlink: require non-NULL ops for devlink instances drivers/infiniband/hw/bnxt_re/Kconfig | 1 - drivers/infiniband/hw/mlx4/Kconfig | 1 - drivers/net/Kconfig | 1 - drivers/net/ethernet/broadcom/Kconfig | 1 - drivers/net/ethernet/cavium/Kconfig | 1 - drivers/net/ethernet/mellanox/mlx4/Kconfig | 1 - .../net/ethernet/mellanox/mlx5/core/Kconfig | 1 - drivers/net/ethernet/mellanox/mlxsw/Kconfig | 1 - drivers/net/ethernet/netronome/Kconfig | 1 - drivers/net/ethernet/netronome/nfp/nfp_app.h | 2 + .../net/ethernet/netronome/nfp/nfp_devlink.c | 11 ++ .../ethernet/netronome/nfp/nfp_net_common.c | 1 + .../ethernet/netronome/nfp/nfp_net_ethtool.c | 24 ---- .../net/ethernet/netronome/nfp/nfp_net_repr.c | 1 + include/linux/netdevice.h | 7 + include/net/devlink.h | 19 ++- net/Kconfig | 11 +- net/core/devlink.c | 126 +++++++----------- net/core/ethtool.c | 13 +- net/dsa/Kconfig | 2 +- 20 files changed, 90 insertions(+), 136 deletions(-) -- 2.19.2