diff options
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_ethtool.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_ethtool.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index a610016a0172..aaa4404e7c5f 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
@@ -97,9 +97,18 @@ static struct ixgbe_stats ixgbe_gstrings_stats[] = { | |||
97 | ((((struct ixgbe_adapter *)netdev_priv(netdev))->num_tx_queues + \ | 97 | ((((struct ixgbe_adapter *)netdev_priv(netdev))->num_tx_queues + \ |
98 | ((struct ixgbe_adapter *)netdev_priv(netdev))->num_rx_queues) * \ | 98 | ((struct ixgbe_adapter *)netdev_priv(netdev))->num_rx_queues) * \ |
99 | (sizeof(struct ixgbe_queue_stats) / sizeof(u64))) | 99 | (sizeof(struct ixgbe_queue_stats) / sizeof(u64))) |
100 | #define IXGBE_STATS_LEN (IXGBE_GLOBAL_STATS_LEN + IXGBE_QUEUE_STATS_LEN) | ||
101 | #define IXGBE_GLOBAL_STATS_LEN ARRAY_SIZE(ixgbe_gstrings_stats) | 100 | #define IXGBE_GLOBAL_STATS_LEN ARRAY_SIZE(ixgbe_gstrings_stats) |
102 | #define IXGBE_STATS_LEN (IXGBE_GLOBAL_STATS_LEN + IXGBE_QUEUE_STATS_LEN) | 101 | #define IXGBE_PB_STATS_LEN ( \ |
102 | (((struct ixgbe_adapter *)netdev->priv)->flags & \ | ||
103 | IXGBE_FLAG_DCB_ENABLED) ? \ | ||
104 | (sizeof(((struct ixgbe_adapter *)0)->stats.pxonrxc) + \ | ||
105 | sizeof(((struct ixgbe_adapter *)0)->stats.pxontxc) + \ | ||
106 | sizeof(((struct ixgbe_adapter *)0)->stats.pxoffrxc) + \ | ||
107 | sizeof(((struct ixgbe_adapter *)0)->stats.pxofftxc)) \ | ||
108 | / sizeof(u64) : 0) | ||
109 | #define IXGBE_STATS_LEN (IXGBE_GLOBAL_STATS_LEN + \ | ||
110 | IXGBE_PB_STATS_LEN + \ | ||
111 | IXGBE_QUEUE_STATS_LEN) | ||
103 | 112 | ||
104 | static int ixgbe_get_settings(struct net_device *netdev, | 113 | static int ixgbe_get_settings(struct net_device *netdev, |
105 | struct ethtool_cmd *ecmd) | 114 | struct ethtool_cmd *ecmd) |
@@ -831,6 +840,16 @@ static void ixgbe_get_ethtool_stats(struct net_device *netdev, | |||
831 | data[i + k] = queue_stat[k]; | 840 | data[i + k] = queue_stat[k]; |
832 | i += k; | 841 | i += k; |
833 | } | 842 | } |
843 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { | ||
844 | for (j = 0; j < MAX_TX_PACKET_BUFFERS; j++) { | ||
845 | data[i++] = adapter->stats.pxontxc[j]; | ||
846 | data[i++] = adapter->stats.pxofftxc[j]; | ||
847 | } | ||
848 | for (j = 0; j < MAX_RX_PACKET_BUFFERS; j++) { | ||
849 | data[i++] = adapter->stats.pxonrxc[j]; | ||
850 | data[i++] = adapter->stats.pxoffrxc[j]; | ||
851 | } | ||
852 | } | ||
834 | } | 853 | } |
835 | 854 | ||
836 | static void ixgbe_get_strings(struct net_device *netdev, u32 stringset, | 855 | static void ixgbe_get_strings(struct net_device *netdev, u32 stringset, |
@@ -859,6 +878,13 @@ static void ixgbe_get_strings(struct net_device *netdev, u32 stringset, | |||
859 | sprintf(p, "rx_queue_%u_bytes", i); | 878 | sprintf(p, "rx_queue_%u_bytes", i); |
860 | p += ETH_GSTRING_LEN; | 879 | p += ETH_GSTRING_LEN; |
861 | } | 880 | } |
881 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { | ||
882 | for (i = 0; i < MAX_TX_PACKET_BUFFERS; i++) { | ||
883 | sprintf(p, "tx_pb_%u_pxon", i); | ||
884 | } | ||
885 | for (i = 0; i < MAX_RX_PACKET_BUFFERS; i++) { | ||
886 | } | ||
887 | } | ||
862 | /* BUG_ON(p - data != IXGBE_STATS_LEN * ETH_GSTRING_LEN); */ | 888 | /* BUG_ON(p - data != IXGBE_STATS_LEN * ETH_GSTRING_LEN); */ |
863 | break; | 889 | break; |
864 | } | 890 | } |