Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4451258img; Tue, 26 Mar 2019 09:37:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqyA64xgs9uMgha0ONJ6ICemT0sR5rRWVrzQTw38RbX/9kGiLhobOd4vFadVIT2n2MWLAB3Q X-Received: by 2002:a63:614c:: with SMTP id v73mr30232931pgb.395.1553618273351; Tue, 26 Mar 2019 09:37:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553618273; cv=none; d=google.com; s=arc-20160816; b=ISewRRs+TS0cS4Ty8JV38OnA4GiWtbJoS46Tda82ibIqXKOErnk5eu80uJ27FoCKzS DexFCUXMuG5ifG1Yic2upj6iZJSx6F67O4hjDHL4AsYYNpDO4OrCoPK6IXLmOT7itmHH cn8QjA4e4TbrOx6D7+5GdxPrPJGFV8deYq7nWqnVUCRoCC1P/7k72UVoWo3KT3oG1ifS YZqc9K64xvxOpg8aHawU9lPP5mrU3H19pr0eF5umPD6IyIQ4pcn4EuIZYJNAsd0xJnGf K5R2UcCQJkx1uMV/RQ2+LUbiqX3yAZ0Q+n2bZLs28KNdsX8YrIPWUJED/JYCiqLsNcG7 YjXQ== 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=GLaniIsP9Pgj38i/cF6fQVJt/oSPNpbEsEWUOxjxDnY=; b=nMjku/UgDrTBR498vMl0X1eUSEMy7zg370o6XenS1BfQXeal2pxKwCs5W5+OXoKq71 Bb1ngZGHGWXUgHylJDcJjdjTy/9HI5yMxB0PneUXqMbSaMQEHD5Ygv+FOdZvrfGqH38G H7p2CXc56NKNpVYZ6rB8NjXPuBDmWKw7mXhDdY6jEjOaDYwFzLqpcWXdlX/nxFzZX2FI G5yD9lSILqITanuMrgzf/f/sU6KjScUZAHIElk4m+TCj1kxuJtpoWqeGJO0Kv+yy2aX9 7EiP+g1aDpbcr6e9P+KaO7q/2D935S8iSomUgMD53VzEo0EirWHePfWBHmtQONvTdjMC E77Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=XnoONczA; 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 gn6si6092128plb.167.2019.03.26.09.37.38; Tue, 26 Mar 2019 09:37:53 -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=XnoONczA; 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 S1731570AbfCZQgn (ORCPT + 99 others); Tue, 26 Mar 2019 12:36:43 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:54247 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729800AbfCZQgn (ORCPT ); Tue, 26 Mar 2019 12:36:43 -0400 Received: by mail-wm1-f67.google.com with SMTP id q16so13353531wmj.3 for ; Tue, 26 Mar 2019 09:36:42 -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=GLaniIsP9Pgj38i/cF6fQVJt/oSPNpbEsEWUOxjxDnY=; b=XnoONczAWvY0wIgCCptP6qnspanv/tQCI1Tl4k7lrM89EwlwCXQH77TeZoX8x8zr1r TOqs7VerEmPfukxOU92hqzIESXbsHPFEhlcZ+FWhw1lWA5zc6TLEtjEChSFQw0mOZxRW OwueOM/axyFYpzoR1bJXqd0j/eIOldVj2NWVcezjYm25taDDvONCZ+IX23NHzHhIXyZm aoBoggR482YHrYPlZp9S4H71JuP+gqaALptdvGbSLKLlewKAaFPOV5JnMObAWf+WGHut wmtSo3cN0jYcFNBE9078dj7LkbeySiZKtq6FSi/SLUPCQn1t7h/nvJSz4LbwGFXtoR1T +mpQ== 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=GLaniIsP9Pgj38i/cF6fQVJt/oSPNpbEsEWUOxjxDnY=; b=dnQrKLYFpCv451zTfn3vcYQCDR9ge+7bLD7+Qdyl1X/t4XyocgMiNe4I79gOul96el lkHm8MTpFSs5NnHD6tiVSAPZrJ17AtTSR02BwPByoHXE8dNb3R4U8u20TjxmKz5NC1ae drbGU2A7WEox56QPCPfMEUysWvGDhZHseOC9ykOri3Fl6HyRiVRm6/++s7nqmZeamWgb DA8tars+2I+pbDziY0G2H7IC0N7Fhe22WpWGpmBTSvoFYLZVl6PPEnJbYaNkeu3Qkf4Y 1gga7cFvfcQrRTlL2Ed9nLvDtZZo0BWSh39Mcv+qwjwQf3JMpPYeWIGnOWeMPjwr4PbD 2Jzw== X-Gm-Message-State: APjAAAXLylX4KCM85ER2mzQr05Mz/+aIyUdj5fFFcXqzVkEgTSeXYEWe 9M4s5TCtWNYg4RhnMuC9d4srPg== X-Received: by 2002:a7b:c34e:: with SMTP id l14mr10286385wmj.68.1553618201592; Tue, 26 Mar 2019 09:36:41 -0700 (PDT) Received: from localhost (jirka.pirko.cz. [84.16.102.26]) by smtp.gmail.com with ESMTPSA id a17sm34884489wmg.40.2019.03.26.09.36.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Mar 2019 09:36:41 -0700 (PDT) Date: Tue, 26 Mar 2019 17:36:40 +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 05/22] ethtool: introduce ethtool netlink interface Message-ID: <20190326163640.GD4958@nanopsycho.orion> References: <8795d07d3315b232b4e7ebc7d109c9aa3185e555.1553532199.git.mkubecek@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8795d07d3315b232b4e7ebc7d109c9aa3185e555.1553532199.git.mkubecek@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 Mon, Mar 25, 2019 at 06:08:09PM CET, mkubecek@suse.cz wrote: >Basic genetlink and init infrastructure for the netlink interface, register >genetlink family "ethtool". Introduce CONFIG_ETHTOOL_NETLINK Kconfig >option. Add interface description into Documentation/networking. > >Signed-off-by: Michal Kubecek >--- [...] >diff --git a/net/ethtool/netlink.c b/net/ethtool/netlink.c >new file mode 100644 >index 000000000000..85dd6dac71a2 >--- /dev/null >+++ b/net/ethtool/netlink.c >@@ -0,0 +1,34 @@ >+// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note >+ >+#include >+#include "netlink.h" >+ >+/* genetlink setup */ >+ >+static const struct genl_ops ethtool_genl_ops[] = { Please be consistent with prefixes. Either use "ethtool_" or "ethnl_" for all functions and variables in this code. >+}; >+ >+struct genl_family ethtool_genl_family = { >+ .hdrsize = 0, >+ .name = ETHTOOL_GENL_NAME, >+ .version = ETHTOOL_GENL_VERSION, >+ .netnsok = true, >+ .parallel_ops = true, >+ .ops = ethtool_genl_ops, >+ .n_ops = ARRAY_SIZE(ethtool_genl_ops), >+}; >+ >+/* module setup */ >+ >+static int __init ethnl_init(void) >+{ >+ int ret; >+ >+ ret = genl_register_family(ðtool_genl_family); >+ if (WARN(ret < 0, "ethtool: genetlink family registration failed")) Why do you need this warning? Please avoid it. >+ return ret; >+ >+ return 0; >+} >+ >+subsys_initcall(ethnl_init); >diff --git a/net/ethtool/netlink.h b/net/ethtool/netlink.h >new file mode 100644 >index 000000000000..63063b582ca2 >--- /dev/null >+++ b/net/ethtool/netlink.h >@@ -0,0 +1,12 @@ >+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ >+ >+#ifndef _NET_ETHTOOL_NETLINK_H >+#define _NET_ETHTOOL_NETLINK_H >+ >+#include >+#include >+#include >+ >+extern struct genl_family ethtool_genl_family; >+ >+#endif /* _NET_ETHTOOL_NETLINK_H */ >-- >2.21.0 >