From patchwork Fri Sep 7 11:19:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Dongsheng" X-Patchwork-Id: 967448 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=osuosl.org (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=hxt-semitech.com Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 426QBF25GQz9s55 for ; Sat, 8 Sep 2018 03:57:09 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 1BF9B21550; Fri, 7 Sep 2018 17:57:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EJTynmdrJPFt; Fri, 7 Sep 2018 17:57:03 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 3F04A2154D; Fri, 7 Sep 2018 17:57:03 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 04EE11BFB70 for ; Fri, 7 Sep 2018 11:19:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 94165882A8 for ; Fri, 7 Sep 2018 11:19:52 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ohBkheznq4rb for ; Fri, 7 Sep 2018 11:19:51 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from barracuda.hxt-semitech.com (mx01.hxt-semitech.com [223.203.96.7]) by fraxinus.osuosl.org (Postfix) with ESMTPS id CD72286B91 for ; Fri, 7 Sep 2018 11:19:50 +0000 (UTC) X-ASG-Debug-ID: 1536319181-093b7e54e60b370002-vu1QkQ Received: from HXTBJIDCEMVIW02.hxtcorp.net ([10.128.0.15]) by barracuda.hxt-semitech.com with ESMTP id X8AS2Yr9EyYdXZ4z (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NO); Fri, 07 Sep 2018 19:19:43 +0800 (CST) X-Barracuda-Envelope-From: dongsheng.wang@hxt-semitech.com Received: from localhost.localdomain.localdomain (10.5.21.103) by HXTBJIDCEMVIW02.hxtcorp.net (10.128.0.15) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 7 Sep 2018 19:19:45 +0800 From: Wang Dongsheng To: , Date: Fri, 7 Sep 2018 19:19:34 +0800 X-ASG-Orig-Subj: [PATCH v3 1/2] net: ethernet: i40e: fix build error Message-ID: <1536319175-3660-2-git-send-email-dongsheng.wang@hxt-semitech.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1536319175-3660-1-git-send-email-dongsheng.wang@hxt-semitech.com> References: <1536319175-3660-1-git-send-email-dongsheng.wang@hxt-semitech.com> MIME-Version: 1.0 X-Originating-IP: [10.5.21.103] X-ClientProxiedBy: HXTBJIDCEMVIW01.hxtcorp.net (10.128.0.14) To HXTBJIDCEMVIW02.hxtcorp.net (10.128.0.15) X-Barracuda-Connect: UNKNOWN[10.128.0.15] X-Barracuda-Start-Time: 1536319181 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA384 X-Barracuda-URL: https://192.168.50.101:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at hxt-semitech.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Bayes: INNOCENT GLOBAL 0.8718 1.0000 2.9301 X-Barracuda-Spam-Score: 3.43 X-Barracuda-Spam-Status: No, SCORE=3.43 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.57058 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M X-Mailman-Approved-At: Fri, 07 Sep 2018 17:57:02 +0000 Subject: [Intel-wired-lan] [PATCH v3 1/2] net: ethernet: i40e: fix build error X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wang Dongsheng , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, intel-wired-lan@lists.osuosl.org, davem@davemloft.net Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Remove "inline" from __i40e_add_stat_strings and move the function. In file included from drivers/net/ethernet/intel/i40e/i40e_ethtool.c:9:0: drivers/net/ethernet/intel/i40e/i40e_ethtool.c: In function __i40e_add_stat_string: drivers/net/ethernet/intel/i40e/i40e_ethtool_stats.h:193:20: error: function __i40e_add_stat_strings can never be inlined because it uses variable argument lists static inline void __i40e_add_stat_strings(u8 **p, const struct i40e_stats stats[], Tested on: x86_64, make ARCH=i386 Modules section .text: i40e: 00019380 <__i40e_add_stat_strings>: i40evf: 00006b00 <__i40e_add_stat_strings>: Buildin section .text: i40e: c351ca60 <__i40e_add_stat_strings>: i40evf: c354f2c0 <__i40e_add_stat_strings>: Signed-off-by: Wang Dongsheng --- V3: add static V2: Move function --- .../net/ethernet/intel/i40e/i40e_ethtool.c | 24 ++++++++++++++++++ .../ethernet/intel/i40e/i40e_ethtool_stats.h | 25 ++----------------- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c index d7d3974beca2..34121a72f2e7 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c @@ -1821,6 +1821,30 @@ static void i40e_get_ethtool_stats(struct net_device *netdev, "ethtool stats count mismatch!"); } +/** + * __i40e_add_stat_strings - copy stat strings into ethtool buffer + * @p: ethtool supplied buffer + * @stats: stat definitions array + * @size: size of the stats array + * + * Format and copy the strings described by stats into the buffer pointed at + * by p. + **/ +static void __i40e_add_stat_strings(u8 **p, const struct i40e_stats stats[], + const unsigned int size, ...) +{ + unsigned int i; + + for (i = 0; i < size; i++) { + va_list args; + + va_start(args, size); + vsnprintf(*p, ETH_GSTRING_LEN, stats[i].stat_string, args); + *p += ETH_GSTRING_LEN; + va_end(args); + } +} + /** * i40e_get_stat_strings - copy stat strings into supplied buffer * @netdev: the netdev to collect strings for diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool_stats.h b/drivers/net/ethernet/intel/i40e/i40e_ethtool_stats.h index bba1cb0b658f..553b0d720839 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool_stats.h +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool_stats.h @@ -181,29 +181,8 @@ i40e_add_queue_stats(u64 **data, struct i40e_ring *ring) *data += size; } -/** - * __i40e_add_stat_strings - copy stat strings into ethtool buffer - * @p: ethtool supplied buffer - * @stats: stat definitions array - * @size: size of the stats array - * - * Format and copy the strings described by stats into the buffer pointed at - * by p. - **/ -static inline void __i40e_add_stat_strings(u8 **p, const struct i40e_stats stats[], - const unsigned int size, ...) -{ - unsigned int i; - - for (i = 0; i < size; i++) { - va_list args; - - va_start(args, size); - vsnprintf(*p, ETH_GSTRING_LEN, stats[i].stat_string, args); - *p += ETH_GSTRING_LEN; - va_end(args); - } -} +static void __i40e_add_stat_strings(u8 **p, const struct i40e_stats stats[], + const unsigned int size, ...); /** * 40e_add_stat_strings - copy stat strings into ethtool buffer From patchwork Fri Sep 7 11:19:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Dongsheng" X-Patchwork-Id: 967446 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=osuosl.org (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=hxt-semitech.com Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 426QBD5GVpz9s4V for ; Sat, 8 Sep 2018 03:57:07 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D132085AD6; Fri, 7 Sep 2018 17:57:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9DFsC0hLSMdR; Fri, 7 Sep 2018 17:57:04 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 856E785AEB; Fri, 7 Sep 2018 17:57:03 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 3A9FA1BFB70 for ; Fri, 7 Sep 2018 11:19:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2D3D0882A9 for ; Fri, 7 Sep 2018 11:19:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id w9rTtPDN2XM0 for ; Fri, 7 Sep 2018 11:19:51 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from barracuda.hxt-semitech.com (mx01.hxt-semitech.com [223.203.96.7]) by fraxinus.osuosl.org (Postfix) with ESMTPS id CEC10881F7 for ; Fri, 7 Sep 2018 11:19:50 +0000 (UTC) X-ASG-Debug-ID: 1536319181-093b7e54e60b370003-vu1QkQ Received: from HXTBJIDCEMVIW02.hxtcorp.net ([10.128.0.15]) by barracuda.hxt-semitech.com with ESMTP id ARGbx1YfwZn4Na5M (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NO); Fri, 07 Sep 2018 19:19:45 +0800 (CST) X-Barracuda-Envelope-From: dongsheng.wang@hxt-semitech.com Received: from localhost.localdomain.localdomain (10.5.21.103) by HXTBJIDCEMVIW02.hxtcorp.net (10.128.0.15) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 7 Sep 2018 19:19:45 +0800 From: Wang Dongsheng To: , Date: Fri, 7 Sep 2018 19:19:35 +0800 X-ASG-Orig-Subj: [PATCH v3 2/2] net: ethernet: i40evf: fix underlying build error Message-ID: <1536319175-3660-3-git-send-email-dongsheng.wang@hxt-semitech.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1536319175-3660-1-git-send-email-dongsheng.wang@hxt-semitech.com> References: <1536319175-3660-1-git-send-email-dongsheng.wang@hxt-semitech.com> MIME-Version: 1.0 X-Originating-IP: [10.5.21.103] X-ClientProxiedBy: HXTBJIDCEMVIW01.hxtcorp.net (10.128.0.14) To HXTBJIDCEMVIW02.hxtcorp.net (10.128.0.15) X-Barracuda-Connect: UNKNOWN[10.128.0.15] X-Barracuda-Start-Time: 1536319183 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA384 X-Barracuda-URL: https://192.168.50.101:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at hxt-semitech.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Bayes: INNOCENT GLOBAL 0.8813 1.0000 3.0288 X-Barracuda-Spam-Score: 3.03 X-Barracuda-Spam-Status: No, SCORE=3.03 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.57058 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Mailman-Approved-At: Fri, 07 Sep 2018 17:57:02 +0000 Subject: [Intel-wired-lan] [PATCH v3 2/2] net: ethernet: i40evf: fix underlying build error X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wang Dongsheng , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, intel-wired-lan@lists.osuosl.org, davem@davemloft.net Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Can't have non-inline function in a header file. There is a risk of "Multiple definition" from cross-including. Tested on: x86_64, make ARCH=i386 Modules section .text: i40e: 00019380 <__i40e_add_stat_strings>: i40evf: 00006b00 <__i40e_add_stat_strings>: Buildin section .text: i40e: c351ca60 <__i40e_add_stat_strings>: i40evf: c354f2c0 <__i40e_add_stat_strings>: Signed-off-by: Wang Dongsheng --- V3: add static --- .../intel/i40evf/i40e_ethtool_stats.h | 23 +----------------- .../ethernet/intel/i40evf/i40evf_ethtool.c | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/drivers/net/ethernet/intel/i40evf/i40e_ethtool_stats.h b/drivers/net/ethernet/intel/i40evf/i40e_ethtool_stats.h index 60b595dd8c39..62ab67a77753 100644 --- a/drivers/net/ethernet/intel/i40evf/i40e_ethtool_stats.h +++ b/drivers/net/ethernet/intel/i40evf/i40e_ethtool_stats.h @@ -181,29 +181,8 @@ i40evf_add_queue_stats(u64 **data, struct i40e_ring *ring) *data += size; } -/** - * __i40e_add_stat_strings - copy stat strings into ethtool buffer - * @p: ethtool supplied buffer - * @stats: stat definitions array - * @size: size of the stats array - * - * Format and copy the strings described by stats into the buffer pointed at - * by p. - **/ static void __i40e_add_stat_strings(u8 **p, const struct i40e_stats stats[], - const unsigned int size, ...) -{ - unsigned int i; - - for (i = 0; i < size; i++) { - va_list args; - - va_start(args, size); - vsnprintf(*p, ETH_GSTRING_LEN, stats[i].stat_string, args); - *p += ETH_GSTRING_LEN; - va_end(args); - } -} + const unsigned int size, ...); /** * 40e_add_stat_strings - copy stat strings into ethtool buffer diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c index 9319971c5c92..eb2e910bc3a1 100644 --- a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c +++ b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c @@ -171,6 +171,30 @@ static void i40evf_get_priv_flag_strings(struct net_device *netdev, u8 *data) } } +/** + * __i40e_add_stat_strings - copy stat strings into ethtool buffer + * @p: ethtool supplied buffer + * @stats: stat definitions array + * @size: size of the stats array + * + * Format and copy the strings described by stats into the buffer pointed at + * by p. + **/ +static void __i40e_add_stat_strings(u8 **p, const struct i40e_stats stats[], + const unsigned int size, ...) +{ + unsigned int i; + + for (i = 0; i < size; i++) { + va_list args; + + va_start(args, size); + vsnprintf(*p, ETH_GSTRING_LEN, stats[i].stat_string, args); + *p += ETH_GSTRING_LEN; + va_end(args); + } +} + /** * i40evf_get_stat_strings - Get stat strings * @netdev: network interface device structure