aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/intel/i40e/i40e_ethtool.c')
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_ethtool.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index 9c93ff28d4aa..681a9e81ff51 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -155,6 +155,19 @@ static struct i40e_stats i40e_gstrings_stats[] = {
155 I40E_PF_STAT("rx_lpi_count", stats.rx_lpi_count), 155 I40E_PF_STAT("rx_lpi_count", stats.rx_lpi_count),
156}; 156};
157 157
158#ifdef I40E_FCOE
159static const struct i40e_stats i40e_gstrings_fcoe_stats[] = {
160 I40E_VSI_STAT("fcoe_bad_fccrc", fcoe_stats.fcoe_bad_fccrc),
161 I40E_VSI_STAT("rx_fcoe_dropped", fcoe_stats.rx_fcoe_dropped),
162 I40E_VSI_STAT("rx_fcoe_packets", fcoe_stats.rx_fcoe_packets),
163 I40E_VSI_STAT("rx_fcoe_dwords", fcoe_stats.rx_fcoe_dwords),
164 I40E_VSI_STAT("fcoe_ddp_count", fcoe_stats.fcoe_ddp_count),
165 I40E_VSI_STAT("fcoe_last_error", fcoe_stats.fcoe_last_error),
166 I40E_VSI_STAT("tx_fcoe_packets", fcoe_stats.tx_fcoe_packets),
167 I40E_VSI_STAT("tx_fcoe_dwords", fcoe_stats.tx_fcoe_dwords),
168};
169
170#endif /* I40E_FCOE */
158#define I40E_QUEUE_STATS_LEN(n) \ 171#define I40E_QUEUE_STATS_LEN(n) \
159 (((struct i40e_netdev_priv *)netdev_priv((n)))->vsi->num_queue_pairs \ 172 (((struct i40e_netdev_priv *)netdev_priv((n)))->vsi->num_queue_pairs \
160 * 2 /* Tx and Rx together */ \ 173 * 2 /* Tx and Rx together */ \
@@ -162,9 +175,17 @@ static struct i40e_stats i40e_gstrings_stats[] = {
162#define I40E_GLOBAL_STATS_LEN ARRAY_SIZE(i40e_gstrings_stats) 175#define I40E_GLOBAL_STATS_LEN ARRAY_SIZE(i40e_gstrings_stats)
163#define I40E_NETDEV_STATS_LEN ARRAY_SIZE(i40e_gstrings_net_stats) 176#define I40E_NETDEV_STATS_LEN ARRAY_SIZE(i40e_gstrings_net_stats)
164#define I40E_MISC_STATS_LEN ARRAY_SIZE(i40e_gstrings_misc_stats) 177#define I40E_MISC_STATS_LEN ARRAY_SIZE(i40e_gstrings_misc_stats)
178#ifdef I40E_FCOE
179#define I40E_FCOE_STATS_LEN ARRAY_SIZE(i40e_gstrings_fcoe_stats)
180#define I40E_VSI_STATS_LEN(n) (I40E_NETDEV_STATS_LEN + \
181 I40E_FCOE_STATS_LEN + \
182 I40E_MISC_STATS_LEN + \
183 I40E_QUEUE_STATS_LEN((n)))
184#else
165#define I40E_VSI_STATS_LEN(n) (I40E_NETDEV_STATS_LEN + \ 185#define I40E_VSI_STATS_LEN(n) (I40E_NETDEV_STATS_LEN + \
166 I40E_MISC_STATS_LEN + \ 186 I40E_MISC_STATS_LEN + \
167 I40E_QUEUE_STATS_LEN((n))) 187 I40E_QUEUE_STATS_LEN((n)))
188#endif /* I40E_FCOE */
168#define I40E_PFC_STATS_LEN ( \ 189#define I40E_PFC_STATS_LEN ( \
169 (FIELD_SIZEOF(struct i40e_pf, stats.priority_xoff_rx) + \ 190 (FIELD_SIZEOF(struct i40e_pf, stats.priority_xoff_rx) + \
170 FIELD_SIZEOF(struct i40e_pf, stats.priority_xon_rx) + \ 191 FIELD_SIZEOF(struct i40e_pf, stats.priority_xon_rx) + \
@@ -1112,6 +1133,13 @@ static void i40e_get_ethtool_stats(struct net_device *netdev,
1112 data[i++] = (i40e_gstrings_misc_stats[j].sizeof_stat == 1133 data[i++] = (i40e_gstrings_misc_stats[j].sizeof_stat ==
1113 sizeof(u64)) ? *(u64 *)p : *(u32 *)p; 1134 sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
1114 } 1135 }
1136#ifdef I40E_FCOE
1137 for (j = 0; j < I40E_FCOE_STATS_LEN; j++) {
1138 p = (char *)vsi + i40e_gstrings_fcoe_stats[j].stat_offset;
1139 data[i++] = (i40e_gstrings_fcoe_stats[j].sizeof_stat ==
1140 sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
1141 }
1142#endif
1115 rcu_read_lock(); 1143 rcu_read_lock();
1116 for (j = 0; j < vsi->num_queue_pairs; j++) { 1144 for (j = 0; j < vsi->num_queue_pairs; j++) {
1117 tx_ring = ACCESS_ONCE(vsi->tx_rings[j]); 1145 tx_ring = ACCESS_ONCE(vsi->tx_rings[j]);
@@ -1193,6 +1221,13 @@ static void i40e_get_strings(struct net_device *netdev, u32 stringset,
1193 i40e_gstrings_misc_stats[i].stat_string); 1221 i40e_gstrings_misc_stats[i].stat_string);
1194 p += ETH_GSTRING_LEN; 1222 p += ETH_GSTRING_LEN;
1195 } 1223 }
1224#ifdef I40E_FCOE
1225 for (i = 0; i < I40E_FCOE_STATS_LEN; i++) {
1226 snprintf(p, ETH_GSTRING_LEN, "%s",
1227 i40e_gstrings_fcoe_stats[i].stat_string);
1228 p += ETH_GSTRING_LEN;
1229 }
1230#endif
1196 for (i = 0; i < vsi->num_queue_pairs; i++) { 1231 for (i = 0; i < vsi->num_queue_pairs; i++) {
1197 snprintf(p, ETH_GSTRING_LEN, "tx-%u.tx_packets", i); 1232 snprintf(p, ETH_GSTRING_LEN, "tx-%u.tx_packets", i);
1198 p += ETH_GSTRING_LEN; 1233 p += ETH_GSTRING_LEN;