]> git.openpandora.org Git - pandora-kernel.git/commitdiff
sfc: Add PTP counters to ethtool stats
authorBen Hutchings <bhutchings@solarflare.com>
Wed, 11 Dec 2013 02:36:08 +0000 (02:36 +0000)
committerBen Hutchings <bhutchings@solarflare.com>
Thu, 12 Dec 2013 22:07:30 +0000 (22:07 +0000)
These were implemented by Andrew Jackson and Laurence Evans but not
previously included in-tree.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
drivers/net/ethernet/sfc/ethtool.c
drivers/net/ethernet/sfc/nic.h
drivers/net/ethernet/sfc/ptp.c

index bb2af8045281379e3fa753e3f0e9ca95b0c78d29..f181522688b258d4bec021b32f9516f363760ed8 100644 (file)
@@ -359,7 +359,8 @@ static int efx_ethtool_get_sset_count(struct net_device *net_dev,
        switch (string_set) {
        case ETH_SS_STATS:
                return efx->type->describe_stats(efx, NULL) +
-                       EFX_ETHTOOL_SW_STAT_COUNT;
+                       EFX_ETHTOOL_SW_STAT_COUNT +
+                       efx_ptp_describe_stats(efx, NULL);
        case ETH_SS_TEST:
                return efx_ethtool_fill_self_tests(efx, NULL, NULL, NULL);
        default:
@@ -380,6 +381,8 @@ static void efx_ethtool_get_strings(struct net_device *net_dev,
                for (i = 0; i < EFX_ETHTOOL_SW_STAT_COUNT; i++)
                        strlcpy(strings + i * ETH_GSTRING_LEN,
                                efx_sw_stat_desc[i].name, ETH_GSTRING_LEN);
+               strings += EFX_ETHTOOL_SW_STAT_COUNT * ETH_GSTRING_LEN;
+               efx_ptp_describe_stats(efx, strings);
                break;
        case ETH_SS_TEST:
                efx_ethtool_fill_self_tests(efx, NULL, strings, NULL);
@@ -429,8 +432,11 @@ static void efx_ethtool_get_stats(struct net_device *net_dev,
                        break;
                }
        }
+       data += EFX_ETHTOOL_SW_STAT_COUNT;
 
        spin_unlock_bh(&efx->stats_lock);
+
+       efx_ptp_update_stats(efx, data);
 }
 
 static void efx_ethtool_self_test(struct net_device *net_dev,
index 170ac6ee3ab236c50406714583f6e989bde75541..a001fae1a8d78640d9ed25faf1919941dfd6e975 100644 (file)
@@ -566,6 +566,8 @@ int efx_ptp_change_mode(struct efx_nic *efx, bool enable_wanted,
                        unsigned int new_mode);
 int efx_ptp_tx(struct efx_nic *efx, struct sk_buff *skb);
 void efx_ptp_event(struct efx_nic *efx, efx_qword_t *ev);
+size_t efx_ptp_describe_stats(struct efx_nic *efx, u8 *strings);
+size_t efx_ptp_update_stats(struct efx_nic *efx, u64 *stats);
 void efx_time_sync_event(struct efx_channel *channel, efx_qword_t *ev);
 void __efx_rx_skb_attach_timestamp(struct efx_channel *channel,
                                   struct sk_buff *skb);
Simple merge