Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp281724ybb; Thu, 28 Mar 2019 02:22:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqw8kccibN8+oVtTKyykJMu2JCuSSlQRR/1C10wkT3S1BIOBtWbX6HX9Hmi1SvCDP+oleQZE X-Received: by 2002:a63:594a:: with SMTP id j10mr39121023pgm.279.1553764942069; Thu, 28 Mar 2019 02:22:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553764942; cv=none; d=google.com; s=arc-20160816; b=oWoyly6AnkRLkyuwEOg1ffjJxxbOMqIDfxGNUWwWuulpwUInh1kF2z3acZuDlNmQT7 LpUjBJlKsNZP+Z9NbyIE36hyILQGyHExiSD2kUoDMQRHBaeae+TUuaPvcOsp1vh5CPAb 2NnF0CY2m/y1u1CI44IiJbYOkutc7Vv0UnTSI+PemO4/dsn+15Jtf+23Jged9ow8dKEV Iv9LgjkO9jkkBPUjvX9lsJFHtX+GIS7EEkr80aqP+1qRobE9tzuTWgTuUPnNsYnKSolx VV54LBQCOAFW3HzombDUqXKzPGZRevEvQXcOuf8C0hadT10yBQR8ZuWWsxVRCJE3g4hY FHSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=CVDuAFcbk05SpGpgeym11NZprLVHwvxD2Jm7bjwqObE=; b=AF6KoFvCtVYQ2nwXASMCG1+Nqoe1yuW4qJNnjedWzllQYtd7nQ3FJzWTVN0VQ8iUib s6ZVDfOVWnWWQH8CwEaTeKzhc8aIg3UWFRMgU8xXneItFpJBYWMqm7bBufr/dRSVVTCJ j5tilM9SzkFV5gkLZPCrnAIqhjRtJYGqaZfcbzSI8AhTrO4Qx5JqILp0eOR3/t+42FC/ eYAX/GHXh4PXMoGiEgEjdeAaizRSRUggMEbOKjO1jILGfPKdyUDhw+YPzkyrh987Luv9 twZsuluA/KBUhQPPCfZ3gvR5VJlXRvdfi4uLvohzRnH2rtfmmbwPZzWAvrHlP/9vbZOj 67cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=WyvvpFHa; 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 r23si20108067pgv.406.2019.03.28.02.22.06; Thu, 28 Mar 2019 02:22:22 -0700 (PDT) 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=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=WyvvpFHa; 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 S1726659AbfC1JVa (ORCPT + 99 others); Thu, 28 Mar 2019 05:21:30 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:42850 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726094AbfC1JV3 (ORCPT ); Thu, 28 Mar 2019 05:21:29 -0400 Received: by mail-wr1-f68.google.com with SMTP id g3so18413792wrx.9 for ; Thu, 28 Mar 2019 02:21:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=CVDuAFcbk05SpGpgeym11NZprLVHwvxD2Jm7bjwqObE=; b=WyvvpFHaAcI9JS94+RdreCHTk7KlZZGic+DSFx1ZWQKACMRwESb5GhfySnHxBm9REB +26cMfRX/IG35gvI2kW9Ooa1UiNqMQWpFvbXpg48WdqJ2GFBFtoUBVObu5UJAuUTSOko u4dXURQfsGkt9zB0tCoDABnvswwKWiSR/f+XtLoTfQrDCChRLnQSuigyW++AyIOALF8H LE36PjTtjhGlH8jWAnCxqvDM3Fdel0lxwUMZ17FZZhB1sdoIM5EeZv2wgiwn9MZwN7e2 ngqy70o9G6x0Fip1PuDhzN7IVcTTpzKup0jrrGn4fcmQ95PZ+1lMsZOr9/hM9cxsKKJt Y8Rw== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=CVDuAFcbk05SpGpgeym11NZprLVHwvxD2Jm7bjwqObE=; b=Cu68jTSH+oirw6MSmXX70yC7rqFXjDFw5aHVYG8+DfKeNolbLeLemcINUYqfhVxAoe UGsYVpzoWdK8x0pcotv8+bpKFP7uZTRtHKN11scN6GHxUT539CPECNJiBOUr6U7PM++c wPlPSXe5xv64Qfs7Z0HY+gu9LvBCiM/4b8z46EyCm9MUEvfLSI8Hi3cOiddbn/cXhuA7 ebugsP70PObI4vUApOMt8XVPK1nVx0HcI8TSm45SVxjIA26cxhMh7hferdqGZt8tIdmU HD8+kcRg0yJztpp05dKZIC5uHOc5lUfHlIPsZScREM4xQVQRwtoXzeJrIaq6yJyDQA3i XpbQ== X-Gm-Message-State: APjAAAUbVlIIKBN74z1PXAKmoIzSKgIANbArjlQjLxLkvRDknaji3LXM Rms6pmpHt0eUhx07alo2dS8Bqw== X-Received: by 2002:adf:dd0f:: with SMTP id a15mr26694397wrm.221.1553764888039; Thu, 28 Mar 2019 02:21:28 -0700 (PDT) Received: from localhost (ip-94-113-223-73.net.upcbroadband.cz. [94.113.223.73]) by smtp.gmail.com with ESMTPSA id t17sm8664885wrr.26.2019.03.28.02.21.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Mar 2019 02:21:27 -0700 (PDT) Date: Thu, 28 Mar 2019 10:21:26 +0100 From: Jiri Pirko To: Michal Kubecek Cc: David Miller , netdev@vger.kernel.org, Jakub Kicinski , Andrew Lunn , Florian Fainelli , John Linville , Stephen Hemminger , linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v5 13/22] ethtool: provide driver/device information in GET_INFO request Message-ID: <20190328092126.GL14297@nanopsycho> References: <20190327201411.GH14297@nanopsycho> <20190327222554.GV26076@unicorn.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190327222554.GV26076@unicorn.suse.cz> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Wed, Mar 27, 2019 at 11:25:54PM CET, mkubecek@suse.cz wrote: >On Wed, Mar 27, 2019 at 09:14:11PM +0100, Jiri Pirko wrote: >> Mon, Mar 25, 2019 at 06:08:33PM CET, mkubecek@suse.cz wrote: >> >+ >> >+Kernel response contents: >> >+ >> >+ ETHA_INFO_DEV (nested) device identification >> >+ ETHA_INFO_DRVINFO (nested) driver information >> >+ ETHA_DRVINFO_DRIVER (string) driver name >> >+ ETHA_DRVINFO_FWVERSION (string) firmware version >> >+ ETHA_DRVINFO_BUSINFO (string) device bus address >> >+ ETHA_DRVINFO_EROM_VER (string) expansion ROM version >> >> These are already very nicely supported in devlink. No need to duplicate >> here. > >They are supported by devlink as an interface. But devlink itself is >only supported by few NIC drivers at the moment: > >mike@unicorn:~/work/git/net-next> grep -r devlink_ops drivers/net/ >drivers/net/ethernet/mellanox/mlx4/main.c:static const struct devlink_ops mlx4_devlink_ops = { >drivers/net/ethernet/mellanox/mlx4/main.c: devlink = devlink_alloc(&mlx4_devlink_ops, sizeof(*priv)); >drivers/net/ethernet/mellanox/mlxsw/core.c:static const struct devlink_ops mlxsw_devlink_ops = { >drivers/net/ethernet/mellanox/mlxsw/core.c: devlink = devlink_alloc(&mlxsw_devlink_ops, alloc_size); >drivers/net/ethernet/mellanox/mlx5/core/main.c:static const struct devlink_ops mlx5_devlink_ops = { >drivers/net/ethernet/mellanox/mlx5/core/main.c: devlink = devlink_alloc(&mlx5_devlink_ops, sizeof(*dev)); >drivers/net/ethernet/cavium/liquidio/lio_main.c:static const struct devlink_ops liquidio_devlink_ops = { >drivers/net/ethernet/cavium/liquidio/lio_main.c: devlink = devlink_alloc(&liquidio_devlink_ops, >drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c:static const struct devlink_ops bnxt_dl_ops = { >drivers/net/ethernet/netronome/nfp/nfp_main.c: devlink = devlink_alloc(&nfp_devlink_ops, sizeof(*pf)); >drivers/net/ethernet/netronome/nfp/nfp_main.h:extern const struct devlink_ops nfp_devlink_ops; >drivers/net/ethernet/netronome/nfp/nfp_devlink.c:const struct devlink_ops nfp_devlink_ops = { >drivers/net/netdevsim/devlink.c:static const struct devlink_ops nsim_devlink_ops = { >drivers/net/netdevsim/devlink.c: devlink = devlink_alloc(&nsim_devlink_ops, 0); > >That's 6 drivers from 4 vendors (if I don't count netdevsim). And I did >not check if all of them do actually provide the information shown >above. On the other hand: > >mike@unicorn:~/work/git/net-next> egrep -r '\.get_drvinfo' drivers/net/ | wc -l >240 > >Some of these 240 lines assign the same handler but not enough to make >me optimistic about being able to implement "ethtool -i " using >devlink interface in near future (say few months or one year). > >I'm all for implementing new features which are are related to physical >device (ASIC) rather than network interface only in devlink (at the >level of kernel-userspace interface). But for features already provided >by ethtool (userspace utility) I can't help seeing the state of devlink >support in NIC drivers as a serious blocker. What I'm thinking about at for some time now would be en explicit default devlink and devlink_port registration for every netdev for drivers that does not support devlink themselves. I need to think about it more, but it seems doable. Then we can hang appropriate things there and make the ethtoolnl/devlink separation clear. I believe we need to do it. > >Michal