diff options
| -rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 18 | ||||
| -rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_main.c | 8 |
2 files changed, 26 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c index e23d514ae93b..1bb470b94094 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c | |||
| @@ -62,6 +62,12 @@ static const struct i40e_stats i40e_gstrings_net_stats[] = { | |||
| 62 | I40E_NETDEV_STAT(rx_crc_errors), | 62 | I40E_NETDEV_STAT(rx_crc_errors), |
| 63 | }; | 63 | }; |
| 64 | 64 | ||
| 65 | static const struct i40e_stats i40e_gstrings_misc_stats[] = { | ||
| 66 | I40E_VSI_STAT("rx_unknown_protocol", eth_stats.rx_unknown_protocol), | ||
| 67 | I40E_VSI_STAT("rx_broadcast", eth_stats.rx_broadcast), | ||
| 68 | I40E_VSI_STAT("tx_broadcast", eth_stats.tx_broadcast), | ||
| 69 | }; | ||
| 70 | |||
| 65 | static int i40e_add_fdir_ethtool(struct i40e_vsi *vsi, | 71 | static int i40e_add_fdir_ethtool(struct i40e_vsi *vsi, |
| 66 | struct ethtool_rxnfc *cmd); | 72 | struct ethtool_rxnfc *cmd); |
| 67 | 73 | ||
| @@ -125,7 +131,9 @@ static struct i40e_stats i40e_gstrings_stats[] = { | |||
| 125 | * (sizeof(struct i40e_queue_stats) / sizeof(u64))) | 131 | * (sizeof(struct i40e_queue_stats) / sizeof(u64))) |
| 126 | #define I40E_GLOBAL_STATS_LEN ARRAY_SIZE(i40e_gstrings_stats) | 132 | #define I40E_GLOBAL_STATS_LEN ARRAY_SIZE(i40e_gstrings_stats) |
| 127 | #define I40E_NETDEV_STATS_LEN ARRAY_SIZE(i40e_gstrings_net_stats) | 133 | #define I40E_NETDEV_STATS_LEN ARRAY_SIZE(i40e_gstrings_net_stats) |
| 134 | #define I40E_MISC_STATS_LEN ARRAY_SIZE(i40e_gstrings_misc_stats) | ||
| 128 | #define I40E_VSI_STATS_LEN(n) (I40E_NETDEV_STATS_LEN + \ | 135 | #define I40E_VSI_STATS_LEN(n) (I40E_NETDEV_STATS_LEN + \ |
| 136 | I40E_MISC_STATS_LEN + \ | ||
| 129 | I40E_QUEUE_STATS_LEN((n))) | 137 | I40E_QUEUE_STATS_LEN((n))) |
| 130 | #define I40E_PFC_STATS_LEN ( \ | 138 | #define I40E_PFC_STATS_LEN ( \ |
| 131 | (FIELD_SIZEOF(struct i40e_pf, stats.priority_xoff_rx) + \ | 139 | (FIELD_SIZEOF(struct i40e_pf, stats.priority_xoff_rx) + \ |
| @@ -648,6 +656,11 @@ static void i40e_get_ethtool_stats(struct net_device *netdev, | |||
| 648 | data[i++] = (i40e_gstrings_net_stats[j].sizeof_stat == | 656 | data[i++] = (i40e_gstrings_net_stats[j].sizeof_stat == |
| 649 | sizeof(u64)) ? *(u64 *)p : *(u32 *)p; | 657 | sizeof(u64)) ? *(u64 *)p : *(u32 *)p; |
| 650 | } | 658 | } |
| 659 | for (j = 0; j < I40E_MISC_STATS_LEN; j++) { | ||
| 660 | p = (char *)vsi + i40e_gstrings_misc_stats[j].stat_offset; | ||
| 661 | data[i++] = (i40e_gstrings_misc_stats[j].sizeof_stat == | ||
| 662 | sizeof(u64)) ? *(u64 *)p : *(u32 *)p; | ||
| 663 | } | ||
| 651 | rcu_read_lock(); | 664 | rcu_read_lock(); |
| 652 | for (j = 0; j < vsi->num_queue_pairs; j++) { | 665 | for (j = 0; j < vsi->num_queue_pairs; j++) { |
| 653 | tx_ring = ACCESS_ONCE(vsi->tx_rings[j]); | 666 | tx_ring = ACCESS_ONCE(vsi->tx_rings[j]); |
| @@ -714,6 +727,11 @@ static void i40e_get_strings(struct net_device *netdev, u32 stringset, | |||
| 714 | i40e_gstrings_net_stats[i].stat_string); | 727 | i40e_gstrings_net_stats[i].stat_string); |
| 715 | p += ETH_GSTRING_LEN; | 728 | p += ETH_GSTRING_LEN; |
| 716 | } | 729 | } |
| 730 | for (i = 0; i < I40E_MISC_STATS_LEN; i++) { | ||
| 731 | snprintf(p, ETH_GSTRING_LEN, "%s", | ||
| 732 | i40e_gstrings_misc_stats[i].stat_string); | ||
| 733 | p += ETH_GSTRING_LEN; | ||
| 734 | } | ||
| 717 | for (i = 0; i < vsi->num_queue_pairs; i++) { | 735 | for (i = 0; i < vsi->num_queue_pairs; i++) { |
| 718 | snprintf(p, ETH_GSTRING_LEN, "tx-%u.tx_packets", i); | 736 | snprintf(p, ETH_GSTRING_LEN, "tx-%u.tx_packets", i); |
| 719 | p += ETH_GSTRING_LEN; | 737 | p += ETH_GSTRING_LEN; |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 76bd168c63ee..35e5ba4a7856 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c | |||
| @@ -530,6 +530,12 @@ void i40e_update_eth_stats(struct i40e_vsi *vsi) | |||
| 530 | i40e_stat_update32(hw, I40E_GLV_RDPC(stat_idx), | 530 | i40e_stat_update32(hw, I40E_GLV_RDPC(stat_idx), |
| 531 | vsi->stat_offsets_loaded, | 531 | vsi->stat_offsets_loaded, |
| 532 | &oes->rx_discards, &es->rx_discards); | 532 | &oes->rx_discards, &es->rx_discards); |
| 533 | i40e_stat_update32(hw, I40E_GLV_RUPP(stat_idx), | ||
| 534 | vsi->stat_offsets_loaded, | ||
| 535 | &oes->rx_unknown_protocol, &es->rx_unknown_protocol); | ||
| 536 | i40e_stat_update32(hw, I40E_GLV_TEPC(stat_idx), | ||
| 537 | vsi->stat_offsets_loaded, | ||
| 538 | &oes->tx_errors, &es->tx_errors); | ||
| 533 | 539 | ||
| 534 | i40e_stat_update48(hw, I40E_GLV_GORCH(stat_idx), | 540 | i40e_stat_update48(hw, I40E_GLV_GORCH(stat_idx), |
| 535 | I40E_GLV_GORCL(stat_idx), | 541 | I40E_GLV_GORCL(stat_idx), |
| @@ -807,6 +813,8 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi) | |||
| 807 | ns->tx_errors = es->tx_errors; | 813 | ns->tx_errors = es->tx_errors; |
| 808 | ons->multicast = oes->rx_multicast; | 814 | ons->multicast = oes->rx_multicast; |
| 809 | ns->multicast = es->rx_multicast; | 815 | ns->multicast = es->rx_multicast; |
| 816 | ons->rx_dropped = oes->rx_discards; | ||
| 817 | ns->rx_dropped = es->rx_discards; | ||
| 810 | ons->tx_dropped = oes->tx_discards; | 818 | ons->tx_dropped = oes->tx_discards; |
| 811 | ns->tx_dropped = es->tx_discards; | 819 | ns->tx_dropped = es->tx_discards; |
| 812 | 820 | ||
