Subject: Re: [PATCH net-next v2 3/3] net: libwx: support vf hardware statistics

From: Jakub Kicinski <[email-masked]>
Date: Tue, 26 May 2026 18:49:03 -0700

On Mon, 25 May 2026 18:11:15 +0800 Mengyuan Lou wrote:
> Add support to show hardware statistics for ethtool -S ethx.

Sadly this does not build. When you repost I think it would be good
to split this patch into two - one for ethtool -S and one for 
the queue stats via the netdev API.

../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:423:16: warning: declaration of 'struct netdev_queue_stats_rx' will not be visible outside of this function [-Wvisibility]
  423 |                                     struct netdev_queue_stats_rx *stats)
      |                                            ^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:428:7: error: incomplete definition of type 'struct netdev_queue_stats_rx'
  428 |         stats->packets = ring->stats.packets;
      |         ~~~~~^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:423:16: note: forward declaration of 'struct netdev_queue_stats_rx'
  423 |                                     struct netdev_queue_stats_rx *stats)
      |                                            ^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:429:7: error: incomplete definition of type 'struct netdev_queue_stats_rx'
  429 |         stats->bytes = ring->stats.bytes;
      |         ~~~~~^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:423:16: note: forward declaration of 'struct netdev_queue_stats_rx'
  423 |                                     struct netdev_queue_stats_rx *stats)
      |                                            ^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:430:7: error: incomplete definition of type 'struct netdev_queue_stats_rx'
  430 |         stats->alloc_fail = wx->alloc_rx_buff_failed;
      |         ~~~~~^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:423:16: note: forward declaration of 'struct netdev_queue_stats_rx'
  423 |                                     struct netdev_queue_stats_rx *stats)
      |                                            ^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:431:7: error: incomplete definition of type 'struct netdev_queue_stats_rx'
  431 |         stats->csum_complete = wx->hw_csum_rx_good;
      |         ~~~~~^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:423:16: note: forward declaration of 'struct netdev_queue_stats_rx'
  423 |                                     struct netdev_queue_stats_rx *stats)
      |                                            ^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:432:7: error: incomplete definition of type 'struct netdev_queue_stats_rx'
  432 |         stats->csum_bad = wx->hw_csum_rx_error;
      |         ~~~~~^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:423:16: note: forward declaration of 'struct netdev_queue_stats_rx'
  423 |                                     struct netdev_queue_stats_rx *stats)
      |                                            ^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:436:16: warning: declaration of 'struct netdev_queue_stats_tx' will not be visible outside of this function [-Wvisibility]
  436 |                                     struct netdev_queue_stats_tx *stats)
      |                                            ^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:441:7: error: incomplete definition of type 'struct netdev_queue_stats_tx'
  441 |         stats->packets = ring->stats.packets;
      |         ~~~~~^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:436:16: note: forward declaration of 'struct netdev_queue_stats_tx'
  436 |                                     struct netdev_queue_stats_tx *stats)
      |                                            ^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:442:7: error: incomplete definition of type 'struct netdev_queue_stats_tx'
  442 |         stats->bytes = ring->stats.bytes;
      |         ~~~~~^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:436:16: note: forward declaration of 'struct netdev_queue_stats_tx'
  436 |                                     struct netdev_queue_stats_tx *stats)
      |                                            ^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:446:12: warning: declaration of 'struct netdev_queue_stats_rx' will not be visible outside of this function [-Wvisibility]
  446 |                                 struct netdev_queue_stats_rx *rx,
      |                                        ^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:447:12: warning: declaration of 'struct netdev_queue_stats_tx' will not be visible outside of this function [-Wvisibility]
  447 |                                 struct netdev_queue_stats_tx *tx)
      |                                        ^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:449:4: error: incomplete definition of type 'struct netdev_queue_stats_rx'
  449 |         rx->bytes = 0;
      |         ~~^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:446:12: note: forward declaration of 'struct netdev_queue_stats_rx'
  446 |                                 struct netdev_queue_stats_rx *rx,
      |                                        ^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:450:4: error: incomplete definition of type 'struct netdev_queue_stats_rx'
  450 |         rx->packets = 0;
      |         ~~^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:446:12: note: forward declaration of 'struct netdev_queue_stats_rx'
  446 |                                 struct netdev_queue_stats_rx *rx,
      |                                        ^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:451:4: error: incomplete definition of type 'struct netdev_queue_stats_rx'
  451 |         rx->alloc_fail = 0;
      |         ~~^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:446:12: note: forward declaration of 'struct netdev_queue_stats_rx'
  446 |                                 struct netdev_queue_stats_rx *rx,
      |                                        ^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:452:4: error: incomplete definition of type 'struct netdev_queue_stats_rx'
  452 |         rx->csum_complete = 0;
      |         ~~^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:446:12: note: forward declaration of 'struct netdev_queue_stats_rx'
  446 |                                 struct netdev_queue_stats_rx *rx,
      |                                        ^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:453:4: error: incomplete definition of type 'struct netdev_queue_stats_rx'
  453 |         rx->csum_bad = 0;
      |         ~~^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:446:12: note: forward declaration of 'struct netdev_queue_stats_rx'
  446 |                                 struct netdev_queue_stats_rx *rx,
      |                                        ^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:454:4: error: incomplete definition of type 'struct netdev_queue_stats_tx'
  454 |         tx->bytes = 0;
      |         ~~^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:447:12: note: forward declaration of 'struct netdev_queue_stats_tx'
  447 |                                 struct netdev_queue_stats_tx *tx)
      |                                        ^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:455:4: error: incomplete definition of type 'struct netdev_queue_stats_tx'
  455 |         tx->packets = 0;
      |         ~~^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:447:12: note: forward declaration of 'struct netdev_queue_stats_tx'
  447 |                                 struct netdev_queue_stats_tx *tx)
      |                                        ^
../drivers/net/ethernet/wangxun/libwx/wx_vf_common.c:458:37: error: variable has incomplete type 'const struct netdev_stat_ops'
  458 | static const struct netdev_stat_ops wxvf_stat_ops = {
      |                                     ^
../include/linux/netdevice.h:2452:15: note: forward declaration of 'struct netdev_stat_ops'
 2452 |         const struct netdev_stat_ops *stat_ops;
      |                      ^
-- 
pw-bot: cr