11/****************************************************************************
22 * Driver for Solarflare Solarstorm network controllers and boards
33 * Copyright 2005-2006 Fen Systems Ltd.
4- * Copyright 2006-2009 Solarflare Communications Inc.
4+ * Copyright 2006-2010 Solarflare Communications Inc.
55 *
66 * This program is free software; you can redistribute it and/or modify it
77 * under the terms of the GNU General Public License version 2 as published
@@ -28,7 +28,8 @@ struct efx_ethtool_stat {
2828 enum {
2929 EFX_ETHTOOL_STAT_SOURCE_mac_stats ,
3030 EFX_ETHTOOL_STAT_SOURCE_nic ,
31- EFX_ETHTOOL_STAT_SOURCE_channel
31+ EFX_ETHTOOL_STAT_SOURCE_channel ,
32+ EFX_ETHTOOL_STAT_SOURCE_tx_queue
3233 } source ;
3334 unsigned offset ;
3435 u64 (* get_stat ) (void * field ); /* Reader function */
@@ -86,6 +87,10 @@ static u64 efx_get_atomic_stat(void *field)
8687 EFX_ETHTOOL_STAT(field, channel, n_##field, \
8788 unsigned int, efx_get_uint_stat)
8889
90+ #define EFX_ETHTOOL_UINT_TXQ_STAT (field ) \
91+ EFX_ETHTOOL_STAT(tx_##field, tx_queue, field, \
92+ unsigned int, efx_get_uint_stat)
93+
8994static struct efx_ethtool_stat efx_ethtool_stats [] = {
9095 EFX_ETHTOOL_U64_MAC_STAT (tx_bytes ),
9196 EFX_ETHTOOL_U64_MAC_STAT (tx_good_bytes ),
@@ -116,6 +121,10 @@ static struct efx_ethtool_stat efx_ethtool_stats[] = {
116121 EFX_ETHTOOL_ULONG_MAC_STAT (tx_non_tcpudp ),
117122 EFX_ETHTOOL_ULONG_MAC_STAT (tx_mac_src_error ),
118123 EFX_ETHTOOL_ULONG_MAC_STAT (tx_ip_src_error ),
124+ EFX_ETHTOOL_UINT_TXQ_STAT (tso_bursts ),
125+ EFX_ETHTOOL_UINT_TXQ_STAT (tso_long_headers ),
126+ EFX_ETHTOOL_UINT_TXQ_STAT (tso_packets ),
127+ EFX_ETHTOOL_UINT_TXQ_STAT (pushes ),
119128 EFX_ETHTOOL_U64_MAC_STAT (rx_bytes ),
120129 EFX_ETHTOOL_U64_MAC_STAT (rx_good_bytes ),
121130 EFX_ETHTOOL_U64_MAC_STAT (rx_bad_bytes ),
@@ -237,8 +246,8 @@ static void efx_ethtool_get_drvinfo(struct net_device *net_dev,
237246 strlcpy (info -> driver , KBUILD_MODNAME , sizeof (info -> driver ));
238247 strlcpy (info -> version , EFX_DRIVER_VERSION , sizeof (info -> version ));
239248 if (efx_nic_rev (efx ) >= EFX_REV_SIENA_A0 )
240- siena_print_fwver (efx , info -> fw_version ,
241- sizeof (info -> fw_version ));
249+ efx_mcdi_print_fwver (efx , info -> fw_version ,
250+ sizeof (info -> fw_version ));
242251 strlcpy (info -> bus_info , pci_name (efx -> pci_dev ), sizeof (info -> bus_info ));
243252}
244253
@@ -470,6 +479,7 @@ static void efx_ethtool_get_stats(struct net_device *net_dev,
470479 struct efx_mac_stats * mac_stats = & efx -> mac_stats ;
471480 struct efx_ethtool_stat * stat ;
472481 struct efx_channel * channel ;
482+ struct efx_tx_queue * tx_queue ;
473483 struct rtnl_link_stats64 temp ;
474484 int i ;
475485
@@ -495,6 +505,15 @@ static void efx_ethtool_get_stats(struct net_device *net_dev,
495505 data [i ] += stat -> get_stat ((void * )channel +
496506 stat -> offset );
497507 break ;
508+ case EFX_ETHTOOL_STAT_SOURCE_tx_queue :
509+ data [i ] = 0 ;
510+ efx_for_each_channel (channel , efx ) {
511+ efx_for_each_channel_tx_queue (tx_queue , channel )
512+ data [i ] +=
513+ stat -> get_stat ((void * )tx_queue
514+ + stat -> offset );
515+ }
516+ break ;
498517 }
499518 }
500519}
0 commit comments