* [PATCH v3 0/2] net: ethernet: i40e/i40evf fix build error @ 2018-09-07 11:19 Wang Dongsheng 2018-09-07 11:19 ` [PATCH v3 1/2] net: ethernet: i40e: " Wang Dongsheng 2018-09-07 11:19 ` [PATCH v3 2/2] net: ethernet: i40evf: fix underlying " Wang Dongsheng 0 siblings, 2 replies; 11+ messages in thread From: Wang Dongsheng @ 2018-09-07 11:19 UTC (permalink / raw) To: jeffrey.t.kirsher, sergei.shtylyov Cc: jacob.e.keller, davem, intel-wired-lan, netdev, linux-kernel, Wang Dongsheng i40e: function __i40e_add_stat_strings can never be inlined because it uses variable argument lists. i40evf: A risk of "Multiple definition" from cross-including. I am working on aarch64 platform and unfortunately the config file is MODULE. So I missed the buildin test... Sorry for pushing this patch to v3 version... Now I tested this patch with buildin and modules. Tested on: x86_64, make ARCH=i386 Modules section .text: i40e: 00019380 <__i40e_add_stat_strings>: i40evf: 00006b00 <__i40e_add_stat_strings>: Buildin: i40e: c351ca60 <__i40e_add_stat_strings>: i40evf: c354f2c0 <__i40e_add_stat_strings>: Wang Dongsheng (2): net: ethernet: i40e: fix build error net: ethernet: i40evf: fix underlying build error .../net/ethernet/intel/i40e/i40e_ethtool.c | 24 ++++++++++++++++++ .../ethernet/intel/i40e/i40e_ethtool_stats.h | 25 ++----------------- .../intel/i40evf/i40e_ethtool_stats.h | 23 +---------------- .../ethernet/intel/i40evf/i40evf_ethtool.c | 24 ++++++++++++++++++ 4 files changed, 51 insertions(+), 45 deletions(-) -- 2.18.0 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v3 1/2] net: ethernet: i40e: fix build error 2018-09-07 11:19 [PATCH v3 0/2] net: ethernet: i40e/i40evf fix build error Wang Dongsheng @ 2018-09-07 11:19 ` Wang Dongsheng 2018-09-07 12:40 ` Wang, Dongsheng 2018-09-07 15:27 ` Keller, Jacob E 2018-09-07 11:19 ` [PATCH v3 2/2] net: ethernet: i40evf: fix underlying " Wang Dongsheng 1 sibling, 2 replies; 11+ messages in thread From: Wang Dongsheng @ 2018-09-07 11:19 UTC (permalink / raw) To: jeffrey.t.kirsher, sergei.shtylyov Cc: jacob.e.keller, davem, intel-wired-lan, netdev, linux-kernel, Wang Dongsheng 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 <dongsheng.wang@hxt-semitech.com> --- 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 -- 2.18.0 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v3 1/2] net: ethernet: i40e: fix build error 2018-09-07 11:19 ` [PATCH v3 1/2] net: ethernet: i40e: " Wang Dongsheng @ 2018-09-07 12:40 ` Wang, Dongsheng 2018-09-07 21:42 ` Keller, Jacob E 2018-09-07 15:27 ` Keller, Jacob E 1 sibling, 1 reply; 11+ messages in thread From: Wang, Dongsheng @ 2018-09-07 12:40 UTC (permalink / raw) To: jeffrey.t.kirsher@intel.com, sergei.shtylyov@cogentembedded.com Cc: jacob.e.keller@intel.com, davem@davemloft.net, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, carolyn.wyborny@intel.com Hello all, The i40e_ethtool_stats.h is just included by i40e/i40e_ethtool.c. So the static doesn't make any affect. And Carolyn's team is working rebuild i40e and i40evf. Cheers, Dongsheng On 9/7/2018 7:19 PM, Wang, Dongsheng wrote: > 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 <dongsheng.wang@hxt-semitech.com> > --- > 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 ^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: [PATCH v3 1/2] net: ethernet: i40e: fix build error 2018-09-07 12:40 ` Wang, Dongsheng @ 2018-09-07 21:42 ` Keller, Jacob E 0 siblings, 0 replies; 11+ messages in thread From: Keller, Jacob E @ 2018-09-07 21:42 UTC (permalink / raw) To: Wang, Dongsheng, Kirsher, Jeffrey T, sergei.shtylyov@cogentembedded.com Cc: davem@davemloft.net, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Wyborny, Carolyn > -----Original Message----- > From: Wang, Dongsheng [mailto:dongsheng.wang@hxt-semitech.com] > Sent: Friday, September 07, 2018 5:41 AM > To: Kirsher, Jeffrey T <jeffrey.t.kirsher@intel.com>; > sergei.shtylyov@cogentembedded.com > Cc: Keller, Jacob E <jacob.e.keller@intel.com>; davem@davemloft.net; intel- > wired-lan@lists.osuosl.org; netdev@vger.kernel.org; linux- > kernel@vger.kernel.org; Wyborny, Carolyn <carolyn.wyborny@intel.com> > Subject: Re: [PATCH v3 1/2] net: ethernet: i40e: fix build error > > Hello all, > > The i40e_ethtool_stats.h is just included by i40e/i40e_ethtool.c. So the > static doesn't make any affect. And Carolyn's team is working rebuild > i40e and i40evf. > > Cheers, > Dongsheng Dave wanted a fix sent to netdev by end of day today. I think the best immediate solution is to just migrate that code back into the i40e_ethtool.c and i40evf_ethtool.c files, rather than only the single function. I'm going to send that patch to netdev now, since Jeff Kirsher is on vacation. Thanks, Jake ^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: [PATCH v3 1/2] net: ethernet: i40e: fix build error 2018-09-07 11:19 ` [PATCH v3 1/2] net: ethernet: i40e: " Wang Dongsheng 2018-09-07 12:40 ` Wang, Dongsheng @ 2018-09-07 15:27 ` Keller, Jacob E 1 sibling, 0 replies; 11+ messages in thread From: Keller, Jacob E @ 2018-09-07 15:27 UTC (permalink / raw) To: Wang Dongsheng, Kirsher, Jeffrey T, sergei.shtylyov@cogentembedded.com Cc: davem@davemloft.net, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org > -----Original Message----- > From: Wang Dongsheng [mailto:dongsheng.wang@hxt-semitech.com] > Sent: Friday, September 07, 2018 4:20 AM > To: Kirsher, Jeffrey T <jeffrey.t.kirsher@intel.com>; > sergei.shtylyov@cogentembedded.com > Cc: Keller, Jacob E <jacob.e.keller@intel.com>; davem@davemloft.net; intel- > wired-lan@lists.osuosl.org; netdev@vger.kernel.org; linux- > kernel@vger.kernel.org; Wang Dongsheng <dongsheng.wang@hxt- > semitech.com> > Subject: [PATCH v3 1/2] net: ethernet: i40e: fix build error > > 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 <dongsheng.wang@hxt-semitech.com> > --- > V3: add static > V2: Move function Acked-by: Jacob Keller <jacob.e.keller@intel.com> This patch fixes the build issue, and is fine with me. Thanks, Jake > --- > .../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 > -- > 2.18.0 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v3 2/2] net: ethernet: i40evf: fix underlying build error 2018-09-07 11:19 [PATCH v3 0/2] net: ethernet: i40e/i40evf fix build error Wang Dongsheng 2018-09-07 11:19 ` [PATCH v3 1/2] net: ethernet: i40e: " Wang Dongsheng @ 2018-09-07 11:19 ` Wang Dongsheng 2018-09-07 12:34 ` Wang, Dongsheng 2018-09-07 15:33 ` Sergei Shtylyov 1 sibling, 2 replies; 11+ messages in thread From: Wang Dongsheng @ 2018-09-07 11:19 UTC (permalink / raw) To: jeffrey.t.kirsher, sergei.shtylyov Cc: jacob.e.keller, davem, intel-wired-lan, netdev, linux-kernel, Wang Dongsheng 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 <dongsheng.wang@hxt-semitech.com> --- 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 -- 2.18.0 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v3 2/2] net: ethernet: i40evf: fix underlying build error 2018-09-07 11:19 ` [PATCH v3 2/2] net: ethernet: i40evf: fix underlying " Wang Dongsheng @ 2018-09-07 12:34 ` Wang, Dongsheng 2018-09-07 15:26 ` Wyborny, Carolyn 2018-09-07 15:33 ` Sergei Shtylyov 1 sibling, 1 reply; 11+ messages in thread From: Wang, Dongsheng @ 2018-09-07 12:34 UTC (permalink / raw) To: jeffrey.t.kirsher@intel.com, sergei.shtylyov@cogentembedded.com Cc: jacob.e.keller@intel.com, davem@davemloft.net, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, carolyn.wyborny@intel.com Hello Jacob, Since Carolyn' team is working this, I think we don't need this patch anymore because this header file is only for ethtool.c. The cross-including scenario simply doesn't exist. If you agree, please ignore this patch and just only review the [1/2]. Cheers, Dongsheng On 9/7/2018 7:19 PM, Wang, Dongsheng wrote: > 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 <dongsheng.wang@hxt-semitech.com> > --- > 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 ^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: [PATCH v3 2/2] net: ethernet: i40evf: fix underlying build error 2018-09-07 12:34 ` Wang, Dongsheng @ 2018-09-07 15:26 ` Wyborny, Carolyn 2018-09-07 17:29 ` Wang, Dongsheng 0 siblings, 1 reply; 11+ messages in thread From: Wyborny, Carolyn @ 2018-09-07 15:26 UTC (permalink / raw) To: Wang, Dongsheng, Kirsher, Jeffrey T, sergei.shtylyov@cogentembedded.com Cc: Keller, Jacob E, davem@davemloft.net, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org > -----Original Message----- > From: Wang, Dongsheng [mailto:dongsheng.wang@hxt-semitech.com] > Sent: Friday, September 07, 2018 5:34 AM > To: Kirsher, Jeffrey T <jeffrey.t.kirsher@intel.com>; > sergei.shtylyov@cogentembedded.com > Cc: Keller, Jacob E <jacob.e.keller@intel.com>; davem@davemloft.net; > intel-wired-lan@lists.osuosl.org; netdev@vger.kernel.org; linux- > kernel@vger.kernel.org; Wyborny, Carolyn <carolyn.wyborny@intel.com> > Subject: Re: [PATCH v3 2/2] net: ethernet: i40evf: fix underlying build error > > Hello Jacob, > > Since Carolyn' team is working this, I think we don't need this patch > anymore because this header file is only for ethtool.c. > [..] Hello Dongsheng, The commonization effort we're working on is prioritizing our newest drivers. The i40e work is still being scoped, so we should fix this problem as needed now and not wait. I apologize for any miscommunication. Was trying to let people know that we aware of the issue and are trying to make progress in that direction. Thanks, Carolyn ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 2/2] net: ethernet: i40evf: fix underlying build error 2018-09-07 15:26 ` Wyborny, Carolyn @ 2018-09-07 17:29 ` Wang, Dongsheng 0 siblings, 0 replies; 11+ messages in thread From: Wang, Dongsheng @ 2018-09-07 17:29 UTC (permalink / raw) To: Wyborny, Carolyn, Kirsher, Jeffrey T, sergei.shtylyov@cogentembedded.com Cc: Keller, Jacob E, davem@davemloft.net, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org On 9/7/2018 11:27 PM, Wyborny, Carolyn wrote: >> -----Original Message----- >> From: Wang, Dongsheng [mailto:dongsheng.wang@hxt-semitech.com] >> Sent: Friday, September 07, 2018 5:34 AM >> To: Kirsher, Jeffrey T <jeffrey.t.kirsher@intel.com>; >> sergei.shtylyov@cogentembedded.com >> Cc: Keller, Jacob E <jacob.e.keller@intel.com>; davem@davemloft.net; >> intel-wired-lan@lists.osuosl.org; netdev@vger.kernel.org; linux- >> kernel@vger.kernel.org; Wyborny, Carolyn <carolyn.wyborny@intel.com> >> Subject: Re: [PATCH v3 2/2] net: ethernet: i40evf: fix underlying build error >> >> Hello Jacob, >> >> Since Carolyn' team is working this, I think we don't need this patch >> anymore because this header file is only for ethtool.c. >> [..] > Hello Dongsheng, > > The commonization effort we're working on is prioritizing our newest drivers. The i40e work is still being scoped, so we should fix this problem as needed now and not wait. After Sergei agree. ;) Cheers, Dongsheng > I apologize for any miscommunication. Was trying to let people know that we aware of the issue and are trying to make progress in that direction. > > Thanks, > > Carolyn > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 2/2] net: ethernet: i40evf: fix underlying build error 2018-09-07 11:19 ` [PATCH v3 2/2] net: ethernet: i40evf: fix underlying " Wang Dongsheng 2018-09-07 12:34 ` Wang, Dongsheng @ 2018-09-07 15:33 ` Sergei Shtylyov 2018-09-07 17:14 ` Wang, Dongsheng 1 sibling, 1 reply; 11+ messages in thread From: Sergei Shtylyov @ 2018-09-07 15:33 UTC (permalink / raw) To: Wang Dongsheng, jeffrey.t.kirsher Cc: jacob.e.keller, davem, intel-wired-lan, netdev, linux-kernel On 09/07/2018 02:19 PM, Wang Dongsheng wrote: > 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 <dongsheng.wang@hxt-semitech.com> > --- > 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[], There's no point to keeping *static* function in the header file (unless it's also *inline*). > - 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 [...] MBR, Sergei ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 2/2] net: ethernet: i40evf: fix underlying build error 2018-09-07 15:33 ` Sergei Shtylyov @ 2018-09-07 17:14 ` Wang, Dongsheng 0 siblings, 0 replies; 11+ messages in thread From: Wang, Dongsheng @ 2018-09-07 17:14 UTC (permalink / raw) To: Sergei Shtylyov, jeffrey.t.kirsher@intel.com Cc: jacob.e.keller@intel.com, davem@davemloft.net, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org On 9/7/2018 11:33 PM, Sergei Shtylyov wrote: > On 09/07/2018 02:19 PM, Wang Dongsheng wrote: > >> 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 <dongsheng.wang@hxt-semitech.com> >> --- >> 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[], > There's no point to keeping *static* function in the header file (unless it's > also *inline*). Yes, we need it for now. Because there is a copy file at i40e dir, and a "Multiple definition" will show up when we buildin i40e&i40evf and remove this *static* . Cause the header file is only used in ethtool.c so we can keep this static, and another option is not touch this header. As I replied to Jacob's email earlier, we can do without touch i40evf at all. Because this header is only for one and not included in another. Cheers, Dongsheng >> - 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 > [...] > > MBR, Sergei > ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2018-09-07 22:11 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2018-09-07 11:19 [PATCH v3 0/2] net: ethernet: i40e/i40evf fix build error Wang Dongsheng 2018-09-07 11:19 ` [PATCH v3 1/2] net: ethernet: i40e: " Wang Dongsheng 2018-09-07 12:40 ` Wang, Dongsheng 2018-09-07 21:42 ` Keller, Jacob E 2018-09-07 15:27 ` Keller, Jacob E 2018-09-07 11:19 ` [PATCH v3 2/2] net: ethernet: i40evf: fix underlying " Wang Dongsheng 2018-09-07 12:34 ` Wang, Dongsheng 2018-09-07 15:26 ` Wyborny, Carolyn 2018-09-07 17:29 ` Wang, Dongsheng 2018-09-07 15:33 ` Sergei Shtylyov 2018-09-07 17:14 ` Wang, Dongsheng
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).