From patchwork Fri Feb 22 22:07:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 1047145 Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=netronome.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.b="yaajOXL9"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 445lyB3jBSz9sBF for ; Sat, 23 Feb 2019 09:14:58 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726152AbfBVWO4 (ORCPT ); Fri, 22 Feb 2019 17:14:56 -0500 Received: from mail-qt1-f194.google.com ([209.85.160.194]:37125 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725774AbfBVWO4 (ORCPT ); Fri, 22 Feb 2019 17:14:56 -0500 Received: by mail-qt1-f194.google.com with SMTP id a48so4350656qtb.4 for ; Fri, 22 Feb 2019 14:14:55 -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=0PnlsSsx5t3SpepF9imicNeAAldsQ6KH9DqruXHAEIs=; b=yaajOXL9OO3Dn3EADci0beafn05MGM9ZPMPUeoMv+/UrdEbuQqfvlhh778aYNNNf88 KUwsMRIcSWwjy+1lc8BWoeXjXhx6vR4sL5+73dEqK9p8dmj2iuTWyLM0FZO3wX5TSLm2 9Gcd9nEnSL50qJmGKBwXTlb9FMeroo9h9j8AZwDZEs0Tp3yPSOUwfaMo8dS2Uvav2JGF L47/iMO12o3gf0q/bSPDYvaeOSwkY763RId6ICamnDT5lHSpr892Pxx365dOnJzM6QMa 9m6B3VWhe7qQRQZWBlgDvTDcJxygPUZtKebES1m6N0h84Nvwnb0WS+n6axu2CEKCCvrL 4J4w== 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=0PnlsSsx5t3SpepF9imicNeAAldsQ6KH9DqruXHAEIs=; b=gJnBGfScNQfyw7Gmo+tvqsW+DotU+eXqndMF2VDhG7AbbIY7cYwEW+B8H+JzqoW+ZS rXEaeI/7ke941FOD3Cg96xYRKieGiWMfA/63oSXbpCASer1BjsF8j+kIPZAcz8fmNgXn U6spc6rlJ63L+OsO4veb4bhLqThu2jrtVci7FKfQ4DgFrbSolqcZcUj7wHfCJpj6xZbQ wry/aA0OCxJhLjeUUeNbhFQ/r97m407RiM2g7kdunfCPhkQJoSgJtHt2iHsfS9Uyl8k1 /WrXu5ujZGiQyRZt1kKfnW/yGBMSdD7NvaICRSJgapukFgc0nAYwsKJzQCyKCC3dFICa 5gXQ== X-Gm-Message-State: AHQUAua/cmZoZhRontLiVs48sTFYcvMbQb0MTv0N+K4RTd+xrE+Ksvuq UVoWczk8pyJJuJ5tHv/+iPIeBg== X-Google-Smtp-Source: AHgI3IaXMHIgjHewImGk9OWtz2SvjPOpSGXv3tMSResa5jrRlj30AWhOrZcs2+3SN6qnJSCwJEEJOg== X-Received: by 2002:ac8:1e15:: with SMTP id n21mr5089429qtl.342.1550873695256; Fri, 22 Feb 2019 14:14:55 -0800 (PST) Received: from jkicinski-Precision-T1700.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id j66sm2707211qkj.27.2019.02.22.14.14.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Feb 2019 14:14:54 -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 v3 0/6] devlink: make ethtool compat reliable Date: Fri, 22 Feb 2019 14:07:51 -0800 Message-Id: <20190222220758.7117-1-jakub.kicinski@netronome.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 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 (the port favour patches are coming regardless ;)). 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. Second patch fixes a potential issue with ethtool code, which will become even more problematic as the NDO introduced by the third patch does not hold RTNL. The new NDO allows the core to get the devlink instance based on a netdev pointer. Next the NDO is implemented in the NFP, and ethtool flashing ops removed. 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. v3 (Florian): - add missing checks for devlink->ops; - move locking/holding into devlink_compat_ functions. v2 (Michal): add netdev_to_devlink() in patch 3. 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: add missing NULL checks for devlink ops 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 | 6 ++ include/net/devlink.h | 19 ++-- net/Kconfig | 11 +-- net/core/devlink.c | 87 +++++++------------ net/core/ethtool.c | 13 +-- net/dsa/Kconfig | 2 +- 20 files changed, 69 insertions(+), 117 deletions(-)