diff options
| -rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_main.c | 355 |
1 files changed, 189 insertions, 166 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 1954e1910dcd..e340e3ba240a 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c | |||
| @@ -720,19 +720,18 @@ static void i40e_update_prio_xoff_rx(struct i40e_pf *pf) | |||
| 720 | } | 720 | } |
| 721 | 721 | ||
| 722 | /** | 722 | /** |
| 723 | * i40e_update_stats - Update the board statistics counters. | 723 | * i40e_update_vsi_stats - Update the vsi statistics counters. |
| 724 | * @vsi: the VSI to be updated | 724 | * @vsi: the VSI to be updated |
| 725 | * | 725 | * |
| 726 | * There are a few instances where we store the same stat in a | 726 | * There are a few instances where we store the same stat in a |
| 727 | * couple of different structs. This is partly because we have | 727 | * couple of different structs. This is partly because we have |
| 728 | * the netdev stats that need to be filled out, which is slightly | 728 | * the netdev stats that need to be filled out, which is slightly |
| 729 | * different from the "eth_stats" defined by the chip and used in | 729 | * different from the "eth_stats" defined by the chip and used in |
| 730 | * VF communications. We sort it all out here in a central place. | 730 | * VF communications. We sort it out here. |
| 731 | **/ | 731 | **/ |
| 732 | void i40e_update_stats(struct i40e_vsi *vsi) | 732 | static void i40e_update_vsi_stats(struct i40e_vsi *vsi) |
| 733 | { | 733 | { |
| 734 | struct i40e_pf *pf = vsi->back; | 734 | struct i40e_pf *pf = vsi->back; |
| 735 | struct i40e_hw *hw = &pf->hw; | ||
| 736 | struct rtnl_link_stats64 *ons; | 735 | struct rtnl_link_stats64 *ons; |
| 737 | struct rtnl_link_stats64 *ns; /* netdev stats */ | 736 | struct rtnl_link_stats64 *ns; /* netdev stats */ |
| 738 | struct i40e_eth_stats *oes; | 737 | struct i40e_eth_stats *oes; |
| @@ -741,8 +740,6 @@ void i40e_update_stats(struct i40e_vsi *vsi) | |||
| 741 | u32 rx_page, rx_buf; | 740 | u32 rx_page, rx_buf; |
| 742 | u64 rx_p, rx_b; | 741 | u64 rx_p, rx_b; |
| 743 | u64 tx_p, tx_b; | 742 | u64 tx_p, tx_b; |
| 744 | u32 val; | ||
| 745 | int i; | ||
| 746 | u16 q; | 743 | u16 q; |
| 747 | 744 | ||
| 748 | if (test_bit(__I40E_DOWN, &vsi->state) || | 745 | if (test_bit(__I40E_DOWN, &vsi->state) || |
| @@ -804,8 +801,8 @@ void i40e_update_stats(struct i40e_vsi *vsi) | |||
| 804 | ns->tx_packets = tx_p; | 801 | ns->tx_packets = tx_p; |
| 805 | ns->tx_bytes = tx_b; | 802 | ns->tx_bytes = tx_b; |
| 806 | 803 | ||
| 807 | i40e_update_eth_stats(vsi); | ||
| 808 | /* update netdev stats from eth stats */ | 804 | /* update netdev stats from eth stats */ |
| 805 | i40e_update_eth_stats(vsi); | ||
| 809 | ons->rx_errors = oes->rx_errors; | 806 | ons->rx_errors = oes->rx_errors; |
| 810 | ns->rx_errors = es->rx_errors; | 807 | ns->rx_errors = es->rx_errors; |
| 811 | ons->tx_errors = oes->tx_errors; | 808 | ons->tx_errors = oes->tx_errors; |
| @@ -815,185 +812,211 @@ void i40e_update_stats(struct i40e_vsi *vsi) | |||
| 815 | ons->tx_dropped = oes->tx_discards; | 812 | ons->tx_dropped = oes->tx_discards; |
| 816 | ns->tx_dropped = es->tx_discards; | 813 | ns->tx_dropped = es->tx_discards; |
| 817 | 814 | ||
| 818 | /* Get the port data only if this is the main PF VSI */ | 815 | /* pull in a couple PF stats if this is the main vsi */ |
| 819 | if (vsi == pf->vsi[pf->lan_vsi]) { | 816 | if (vsi == pf->vsi[pf->lan_vsi]) { |
| 820 | struct i40e_hw_port_stats *nsd = &pf->stats; | 817 | ns->rx_crc_errors = pf->stats.crc_errors; |
| 821 | struct i40e_hw_port_stats *osd = &pf->stats_offsets; | 818 | ns->rx_errors = pf->stats.crc_errors + pf->stats.illegal_bytes; |
| 822 | 819 | ns->rx_length_errors = pf->stats.rx_length_errors; | |
| 823 | i40e_stat_update48(hw, I40E_GLPRT_GORCH(hw->port), | 820 | } |
| 824 | I40E_GLPRT_GORCL(hw->port), | 821 | } |
| 825 | pf->stat_offsets_loaded, | ||
| 826 | &osd->eth.rx_bytes, &nsd->eth.rx_bytes); | ||
| 827 | i40e_stat_update48(hw, I40E_GLPRT_GOTCH(hw->port), | ||
| 828 | I40E_GLPRT_GOTCL(hw->port), | ||
| 829 | pf->stat_offsets_loaded, | ||
| 830 | &osd->eth.tx_bytes, &nsd->eth.tx_bytes); | ||
| 831 | i40e_stat_update32(hw, I40E_GLPRT_RDPC(hw->port), | ||
| 832 | pf->stat_offsets_loaded, | ||
| 833 | &osd->eth.rx_discards, | ||
| 834 | &nsd->eth.rx_discards); | ||
| 835 | i40e_stat_update32(hw, I40E_GLPRT_TDPC(hw->port), | ||
| 836 | pf->stat_offsets_loaded, | ||
| 837 | &osd->eth.tx_discards, | ||
| 838 | &nsd->eth.tx_discards); | ||
| 839 | i40e_stat_update48(hw, I40E_GLPRT_MPRCH(hw->port), | ||
| 840 | I40E_GLPRT_MPRCL(hw->port), | ||
| 841 | pf->stat_offsets_loaded, | ||
| 842 | &osd->eth.rx_multicast, | ||
| 843 | &nsd->eth.rx_multicast); | ||
| 844 | 822 | ||
| 845 | i40e_stat_update32(hw, I40E_GLPRT_TDOLD(hw->port), | 823 | /** |
| 846 | pf->stat_offsets_loaded, | 824 | * i40e_update_pf_stats - Update the pf statistics counters. |
| 847 | &osd->tx_dropped_link_down, | 825 | * @pf: the PF to be updated |
| 848 | &nsd->tx_dropped_link_down); | 826 | **/ |
| 827 | static void i40e_update_pf_stats(struct i40e_pf *pf) | ||
| 828 | { | ||
| 829 | struct i40e_hw_port_stats *osd = &pf->stats_offsets; | ||
| 830 | struct i40e_hw_port_stats *nsd = &pf->stats; | ||
| 831 | struct i40e_hw *hw = &pf->hw; | ||
| 832 | u32 val; | ||
| 833 | int i; | ||
| 849 | 834 | ||
| 850 | i40e_stat_update32(hw, I40E_GLPRT_CRCERRS(hw->port), | 835 | i40e_stat_update48(hw, I40E_GLPRT_GORCH(hw->port), |
| 851 | pf->stat_offsets_loaded, | 836 | I40E_GLPRT_GORCL(hw->port), |
| 852 | &osd->crc_errors, &nsd->crc_errors); | 837 | pf->stat_offsets_loaded, |
| 853 | ns->rx_crc_errors = nsd->crc_errors; | 838 | &osd->eth.rx_bytes, &nsd->eth.rx_bytes); |
| 839 | i40e_stat_update48(hw, I40E_GLPRT_GOTCH(hw->port), | ||
| 840 | I40E_GLPRT_GOTCL(hw->port), | ||
| 841 | pf->stat_offsets_loaded, | ||
| 842 | &osd->eth.tx_bytes, &nsd->eth.tx_bytes); | ||
| 843 | i40e_stat_update32(hw, I40E_GLPRT_RDPC(hw->port), | ||
| 844 | pf->stat_offsets_loaded, | ||
| 845 | &osd->eth.rx_discards, | ||
| 846 | &nsd->eth.rx_discards); | ||
| 847 | i40e_stat_update32(hw, I40E_GLPRT_TDPC(hw->port), | ||
| 848 | pf->stat_offsets_loaded, | ||
| 849 | &osd->eth.tx_discards, | ||
| 850 | &nsd->eth.tx_discards); | ||
| 851 | i40e_stat_update48(hw, I40E_GLPRT_MPRCH(hw->port), | ||
| 852 | I40E_GLPRT_MPRCL(hw->port), | ||
| 853 | pf->stat_offsets_loaded, | ||
| 854 | &osd->eth.rx_multicast, | ||
| 855 | &nsd->eth.rx_multicast); | ||
| 854 | 856 | ||
| 855 | i40e_stat_update32(hw, I40E_GLPRT_ILLERRC(hw->port), | 857 | i40e_stat_update32(hw, I40E_GLPRT_TDOLD(hw->port), |
| 856 | pf->stat_offsets_loaded, | 858 | pf->stat_offsets_loaded, |
| 857 | &osd->illegal_bytes, &nsd->illegal_bytes); | 859 | &osd->tx_dropped_link_down, |
| 858 | ns->rx_errors = nsd->crc_errors | 860 | &nsd->tx_dropped_link_down); |
| 859 | + nsd->illegal_bytes; | ||
| 860 | 861 | ||
| 861 | i40e_stat_update32(hw, I40E_GLPRT_MLFC(hw->port), | 862 | i40e_stat_update32(hw, I40E_GLPRT_CRCERRS(hw->port), |
| 862 | pf->stat_offsets_loaded, | 863 | pf->stat_offsets_loaded, |
| 863 | &osd->mac_local_faults, | 864 | &osd->crc_errors, &nsd->crc_errors); |
| 864 | &nsd->mac_local_faults); | ||
| 865 | i40e_stat_update32(hw, I40E_GLPRT_MRFC(hw->port), | ||
| 866 | pf->stat_offsets_loaded, | ||
| 867 | &osd->mac_remote_faults, | ||
| 868 | &nsd->mac_remote_faults); | ||
| 869 | 865 | ||
| 870 | i40e_stat_update32(hw, I40E_GLPRT_RLEC(hw->port), | 866 | i40e_stat_update32(hw, I40E_GLPRT_ILLERRC(hw->port), |
| 871 | pf->stat_offsets_loaded, | 867 | pf->stat_offsets_loaded, |
| 872 | &osd->rx_length_errors, | 868 | &osd->illegal_bytes, &nsd->illegal_bytes); |
| 873 | &nsd->rx_length_errors); | ||
| 874 | ns->rx_length_errors = nsd->rx_length_errors; | ||
| 875 | 869 | ||
| 876 | i40e_stat_update32(hw, I40E_GLPRT_LXONRXC(hw->port), | 870 | i40e_stat_update32(hw, I40E_GLPRT_MLFC(hw->port), |
| 877 | pf->stat_offsets_loaded, | 871 | pf->stat_offsets_loaded, |
| 878 | &osd->link_xon_rx, &nsd->link_xon_rx); | 872 | &osd->mac_local_faults, |
| 879 | i40e_stat_update32(hw, I40E_GLPRT_LXONTXC(hw->port), | 873 | &nsd->mac_local_faults); |
| 880 | pf->stat_offsets_loaded, | 874 | i40e_stat_update32(hw, I40E_GLPRT_MRFC(hw->port), |
| 881 | &osd->link_xon_tx, &nsd->link_xon_tx); | 875 | pf->stat_offsets_loaded, |
| 882 | i40e_update_prio_xoff_rx(pf); /* handles I40E_GLPRT_LXOFFRXC */ | 876 | &osd->mac_remote_faults, |
| 883 | i40e_stat_update32(hw, I40E_GLPRT_LXOFFTXC(hw->port), | 877 | &nsd->mac_remote_faults); |
| 884 | pf->stat_offsets_loaded, | ||
| 885 | &osd->link_xoff_tx, &nsd->link_xoff_tx); | ||
| 886 | |||
| 887 | for (i = 0; i < 8; i++) { | ||
| 888 | i40e_stat_update32(hw, I40E_GLPRT_PXONRXC(hw->port, i), | ||
| 889 | pf->stat_offsets_loaded, | ||
| 890 | &osd->priority_xon_rx[i], | ||
| 891 | &nsd->priority_xon_rx[i]); | ||
| 892 | i40e_stat_update32(hw, I40E_GLPRT_PXONTXC(hw->port, i), | ||
| 893 | pf->stat_offsets_loaded, | ||
| 894 | &osd->priority_xon_tx[i], | ||
| 895 | &nsd->priority_xon_tx[i]); | ||
| 896 | i40e_stat_update32(hw, I40E_GLPRT_PXOFFTXC(hw->port, i), | ||
| 897 | pf->stat_offsets_loaded, | ||
| 898 | &osd->priority_xoff_tx[i], | ||
| 899 | &nsd->priority_xoff_tx[i]); | ||
| 900 | i40e_stat_update32(hw, | ||
| 901 | I40E_GLPRT_RXON2OFFCNT(hw->port, i), | ||
| 902 | pf->stat_offsets_loaded, | ||
| 903 | &osd->priority_xon_2_xoff[i], | ||
| 904 | &nsd->priority_xon_2_xoff[i]); | ||
| 905 | } | ||
| 906 | 878 | ||
| 907 | i40e_stat_update48(hw, I40E_GLPRT_PRC64H(hw->port), | 879 | i40e_stat_update32(hw, I40E_GLPRT_RLEC(hw->port), |
| 908 | I40E_GLPRT_PRC64L(hw->port), | 880 | pf->stat_offsets_loaded, |
| 909 | pf->stat_offsets_loaded, | 881 | &osd->rx_length_errors, |
| 910 | &osd->rx_size_64, &nsd->rx_size_64); | 882 | &nsd->rx_length_errors); |
| 911 | i40e_stat_update48(hw, I40E_GLPRT_PRC127H(hw->port), | ||
| 912 | I40E_GLPRT_PRC127L(hw->port), | ||
| 913 | pf->stat_offsets_loaded, | ||
| 914 | &osd->rx_size_127, &nsd->rx_size_127); | ||
| 915 | i40e_stat_update48(hw, I40E_GLPRT_PRC255H(hw->port), | ||
| 916 | I40E_GLPRT_PRC255L(hw->port), | ||
| 917 | pf->stat_offsets_loaded, | ||
| 918 | &osd->rx_size_255, &nsd->rx_size_255); | ||
| 919 | i40e_stat_update48(hw, I40E_GLPRT_PRC511H(hw->port), | ||
| 920 | I40E_GLPRT_PRC511L(hw->port), | ||
| 921 | pf->stat_offsets_loaded, | ||
| 922 | &osd->rx_size_511, &nsd->rx_size_511); | ||
| 923 | i40e_stat_update48(hw, I40E_GLPRT_PRC1023H(hw->port), | ||
| 924 | I40E_GLPRT_PRC1023L(hw->port), | ||
| 925 | pf->stat_offsets_loaded, | ||
| 926 | &osd->rx_size_1023, &nsd->rx_size_1023); | ||
| 927 | i40e_stat_update48(hw, I40E_GLPRT_PRC1522H(hw->port), | ||
| 928 | I40E_GLPRT_PRC1522L(hw->port), | ||
| 929 | pf->stat_offsets_loaded, | ||
| 930 | &osd->rx_size_1522, &nsd->rx_size_1522); | ||
| 931 | i40e_stat_update48(hw, I40E_GLPRT_PRC9522H(hw->port), | ||
| 932 | I40E_GLPRT_PRC9522L(hw->port), | ||
| 933 | pf->stat_offsets_loaded, | ||
| 934 | &osd->rx_size_big, &nsd->rx_size_big); | ||
| 935 | 883 | ||
| 936 | i40e_stat_update48(hw, I40E_GLPRT_PTC64H(hw->port), | 884 | i40e_stat_update32(hw, I40E_GLPRT_LXONRXC(hw->port), |
| 937 | I40E_GLPRT_PTC64L(hw->port), | 885 | pf->stat_offsets_loaded, |
| 938 | pf->stat_offsets_loaded, | 886 | &osd->link_xon_rx, &nsd->link_xon_rx); |
| 939 | &osd->tx_size_64, &nsd->tx_size_64); | 887 | i40e_stat_update32(hw, I40E_GLPRT_LXONTXC(hw->port), |
| 940 | i40e_stat_update48(hw, I40E_GLPRT_PTC127H(hw->port), | 888 | pf->stat_offsets_loaded, |
| 941 | I40E_GLPRT_PTC127L(hw->port), | 889 | &osd->link_xon_tx, &nsd->link_xon_tx); |
| 942 | pf->stat_offsets_loaded, | 890 | i40e_update_prio_xoff_rx(pf); /* handles I40E_GLPRT_LXOFFRXC */ |
| 943 | &osd->tx_size_127, &nsd->tx_size_127); | 891 | i40e_stat_update32(hw, I40E_GLPRT_LXOFFTXC(hw->port), |
| 944 | i40e_stat_update48(hw, I40E_GLPRT_PTC255H(hw->port), | 892 | pf->stat_offsets_loaded, |
| 945 | I40E_GLPRT_PTC255L(hw->port), | 893 | &osd->link_xoff_tx, &nsd->link_xoff_tx); |
| 946 | pf->stat_offsets_loaded, | ||
| 947 | &osd->tx_size_255, &nsd->tx_size_255); | ||
| 948 | i40e_stat_update48(hw, I40E_GLPRT_PTC511H(hw->port), | ||
| 949 | I40E_GLPRT_PTC511L(hw->port), | ||
| 950 | pf->stat_offsets_loaded, | ||
| 951 | &osd->tx_size_511, &nsd->tx_size_511); | ||
| 952 | i40e_stat_update48(hw, I40E_GLPRT_PTC1023H(hw->port), | ||
| 953 | I40E_GLPRT_PTC1023L(hw->port), | ||
| 954 | pf->stat_offsets_loaded, | ||
| 955 | &osd->tx_size_1023, &nsd->tx_size_1023); | ||
| 956 | i40e_stat_update48(hw, I40E_GLPRT_PTC1522H(hw->port), | ||
| 957 | I40E_GLPRT_PTC1522L(hw->port), | ||
| 958 | pf->stat_offsets_loaded, | ||
| 959 | &osd->tx_size_1522, &nsd->tx_size_1522); | ||
| 960 | i40e_stat_update48(hw, I40E_GLPRT_PTC9522H(hw->port), | ||
| 961 | I40E_GLPRT_PTC9522L(hw->port), | ||
| 962 | pf->stat_offsets_loaded, | ||
| 963 | &osd->tx_size_big, &nsd->tx_size_big); | ||
| 964 | 894 | ||
| 965 | i40e_stat_update32(hw, I40E_GLPRT_RUC(hw->port), | 895 | for (i = 0; i < 8; i++) { |
| 966 | pf->stat_offsets_loaded, | 896 | i40e_stat_update32(hw, I40E_GLPRT_PXONRXC(hw->port, i), |
| 967 | &osd->rx_undersize, &nsd->rx_undersize); | ||
| 968 | i40e_stat_update32(hw, I40E_GLPRT_RFC(hw->port), | ||
| 969 | pf->stat_offsets_loaded, | 897 | pf->stat_offsets_loaded, |
| 970 | &osd->rx_fragments, &nsd->rx_fragments); | 898 | &osd->priority_xon_rx[i], |
| 971 | i40e_stat_update32(hw, I40E_GLPRT_ROC(hw->port), | 899 | &nsd->priority_xon_rx[i]); |
| 900 | i40e_stat_update32(hw, I40E_GLPRT_PXONTXC(hw->port, i), | ||
| 972 | pf->stat_offsets_loaded, | 901 | pf->stat_offsets_loaded, |
| 973 | &osd->rx_oversize, &nsd->rx_oversize); | 902 | &osd->priority_xon_tx[i], |
| 974 | i40e_stat_update32(hw, I40E_GLPRT_RJC(hw->port), | 903 | &nsd->priority_xon_tx[i]); |
| 904 | i40e_stat_update32(hw, I40E_GLPRT_PXOFFTXC(hw->port, i), | ||
| 975 | pf->stat_offsets_loaded, | 905 | pf->stat_offsets_loaded, |
| 976 | &osd->rx_jabber, &nsd->rx_jabber); | 906 | &osd->priority_xoff_tx[i], |
| 977 | 907 | &nsd->priority_xoff_tx[i]); | |
| 978 | val = rd32(hw, I40E_PRTPM_EEE_STAT); | 908 | i40e_stat_update32(hw, |
| 979 | nsd->tx_lpi_status = | 909 | I40E_GLPRT_RXON2OFFCNT(hw->port, i), |
| 980 | (val & I40E_PRTPM_EEE_STAT_TX_LPI_STATUS_MASK) >> | ||
| 981 | I40E_PRTPM_EEE_STAT_TX_LPI_STATUS_SHIFT; | ||
| 982 | nsd->rx_lpi_status = | ||
| 983 | (val & I40E_PRTPM_EEE_STAT_RX_LPI_STATUS_MASK) >> | ||
| 984 | I40E_PRTPM_EEE_STAT_RX_LPI_STATUS_SHIFT; | ||
| 985 | i40e_stat_update32(hw, I40E_PRTPM_TLPIC, | ||
| 986 | pf->stat_offsets_loaded, | 910 | pf->stat_offsets_loaded, |
| 987 | &osd->tx_lpi_count, &nsd->tx_lpi_count); | 911 | &osd->priority_xon_2_xoff[i], |
| 988 | i40e_stat_update32(hw, I40E_PRTPM_RLPIC, | 912 | &nsd->priority_xon_2_xoff[i]); |
| 989 | pf->stat_offsets_loaded, | ||
| 990 | &osd->rx_lpi_count, &nsd->rx_lpi_count); | ||
| 991 | } | 913 | } |
| 992 | 914 | ||
| 915 | i40e_stat_update48(hw, I40E_GLPRT_PRC64H(hw->port), | ||
| 916 | I40E_GLPRT_PRC64L(hw->port), | ||
| 917 | pf->stat_offsets_loaded, | ||
| 918 | &osd->rx_size_64, &nsd->rx_size_64); | ||
| 919 | i40e_stat_update48(hw, I40E_GLPRT_PRC127H(hw->port), | ||
| 920 | I40E_GLPRT_PRC127L(hw->port), | ||
| 921 | pf->stat_offsets_loaded, | ||
| 922 | &osd->rx_size_127, &nsd->rx_size_127); | ||
| 923 | i40e_stat_update48(hw, I40E_GLPRT_PRC255H(hw->port), | ||
| 924 | I40E_GLPRT_PRC255L(hw->port), | ||
| 925 | pf->stat_offsets_loaded, | ||
| 926 | &osd->rx_size_255, &nsd->rx_size_255); | ||
| 927 | i40e_stat_update48(hw, I40E_GLPRT_PRC511H(hw->port), | ||
| 928 | I40E_GLPRT_PRC511L(hw->port), | ||
| 929 | pf->stat_offsets_loaded, | ||
| 930 | &osd->rx_size_511, &nsd->rx_size_511); | ||
| 931 | i40e_stat_update48(hw, I40E_GLPRT_PRC1023H(hw->port), | ||
| 932 | I40E_GLPRT_PRC1023L(hw->port), | ||
| 933 | pf->stat_offsets_loaded, | ||
| 934 | &osd->rx_size_1023, &nsd->rx_size_1023); | ||
| 935 | i40e_stat_update48(hw, I40E_GLPRT_PRC1522H(hw->port), | ||
| 936 | I40E_GLPRT_PRC1522L(hw->port), | ||
| 937 | pf->stat_offsets_loaded, | ||
| 938 | &osd->rx_size_1522, &nsd->rx_size_1522); | ||
| 939 | i40e_stat_update48(hw, I40E_GLPRT_PRC9522H(hw->port), | ||
| 940 | I40E_GLPRT_PRC9522L(hw->port), | ||
| 941 | pf->stat_offsets_loaded, | ||
| 942 | &osd->rx_size_big, &nsd->rx_size_big); | ||
| 943 | |||
| 944 | i40e_stat_update48(hw, I40E_GLPRT_PTC64H(hw->port), | ||
| 945 | I40E_GLPRT_PTC64L(hw->port), | ||
| 946 | pf->stat_offsets_loaded, | ||
| 947 | &osd->tx_size_64, &nsd->tx_size_64); | ||
| 948 | i40e_stat_update48(hw, I40E_GLPRT_PTC127H(hw->port), | ||
| 949 | I40E_GLPRT_PTC127L(hw->port), | ||
| 950 | pf->stat_offsets_loaded, | ||
| 951 | &osd->tx_size_127, &nsd->tx_size_127); | ||
| 952 | i40e_stat_update48(hw, I40E_GLPRT_PTC255H(hw->port), | ||
| 953 | I40E_GLPRT_PTC255L(hw->port), | ||
| 954 | pf->stat_offsets_loaded, | ||
| 955 | &osd->tx_size_255, &nsd->tx_size_255); | ||
| 956 | i40e_stat_update48(hw, I40E_GLPRT_PTC511H(hw->port), | ||
| 957 | I40E_GLPRT_PTC511L(hw->port), | ||
| 958 | pf->stat_offsets_loaded, | ||
| 959 | &osd->tx_size_511, &nsd->tx_size_511); | ||
| 960 | i40e_stat_update48(hw, I40E_GLPRT_PTC1023H(hw->port), | ||
| 961 | I40E_GLPRT_PTC1023L(hw->port), | ||
| 962 | pf->stat_offsets_loaded, | ||
| 963 | &osd->tx_size_1023, &nsd->tx_size_1023); | ||
| 964 | i40e_stat_update48(hw, I40E_GLPRT_PTC1522H(hw->port), | ||
| 965 | I40E_GLPRT_PTC1522L(hw->port), | ||
| 966 | pf->stat_offsets_loaded, | ||
| 967 | &osd->tx_size_1522, &nsd->tx_size_1522); | ||
| 968 | i40e_stat_update48(hw, I40E_GLPRT_PTC9522H(hw->port), | ||
| 969 | I40E_GLPRT_PTC9522L(hw->port), | ||
| 970 | pf->stat_offsets_loaded, | ||
| 971 | &osd->tx_size_big, &nsd->tx_size_big); | ||
| 972 | |||
| 973 | i40e_stat_update32(hw, I40E_GLPRT_RUC(hw->port), | ||
| 974 | pf->stat_offsets_loaded, | ||
| 975 | &osd->rx_undersize, &nsd->rx_undersize); | ||
| 976 | i40e_stat_update32(hw, I40E_GLPRT_RFC(hw->port), | ||
| 977 | pf->stat_offsets_loaded, | ||
| 978 | &osd->rx_fragments, &nsd->rx_fragments); | ||
| 979 | i40e_stat_update32(hw, I40E_GLPRT_ROC(hw->port), | ||
| 980 | pf->stat_offsets_loaded, | ||
| 981 | &osd->rx_oversize, &nsd->rx_oversize); | ||
| 982 | i40e_stat_update32(hw, I40E_GLPRT_RJC(hw->port), | ||
| 983 | pf->stat_offsets_loaded, | ||
| 984 | &osd->rx_jabber, &nsd->rx_jabber); | ||
| 985 | |||
| 986 | val = rd32(hw, I40E_PRTPM_EEE_STAT); | ||
| 987 | nsd->tx_lpi_status = | ||
| 988 | (val & I40E_PRTPM_EEE_STAT_TX_LPI_STATUS_MASK) >> | ||
| 989 | I40E_PRTPM_EEE_STAT_TX_LPI_STATUS_SHIFT; | ||
| 990 | nsd->rx_lpi_status = | ||
| 991 | (val & I40E_PRTPM_EEE_STAT_RX_LPI_STATUS_MASK) >> | ||
| 992 | I40E_PRTPM_EEE_STAT_RX_LPI_STATUS_SHIFT; | ||
| 993 | i40e_stat_update32(hw, I40E_PRTPM_TLPIC, | ||
| 994 | pf->stat_offsets_loaded, | ||
| 995 | &osd->tx_lpi_count, &nsd->tx_lpi_count); | ||
| 996 | i40e_stat_update32(hw, I40E_PRTPM_RLPIC, | ||
| 997 | pf->stat_offsets_loaded, | ||
| 998 | &osd->rx_lpi_count, &nsd->rx_lpi_count); | ||
| 999 | |||
| 993 | pf->stat_offsets_loaded = true; | 1000 | pf->stat_offsets_loaded = true; |
| 994 | } | 1001 | } |
| 995 | 1002 | ||
| 996 | /** | 1003 | /** |
| 1004 | * i40e_update_stats - Update the various statistics counters. | ||
| 1005 | * @vsi: the VSI to be updated | ||
| 1006 | * | ||
| 1007 | * Update the various stats for this VSI and its related entities. | ||
| 1008 | **/ | ||
| 1009 | void i40e_update_stats(struct i40e_vsi *vsi) | ||
| 1010 | { | ||
| 1011 | struct i40e_pf *pf = vsi->back; | ||
| 1012 | |||
| 1013 | if (vsi == pf->vsi[pf->lan_vsi]) | ||
| 1014 | i40e_update_pf_stats(pf); | ||
| 1015 | |||
| 1016 | i40e_update_vsi_stats(vsi); | ||
| 1017 | } | ||
| 1018 | |||
| 1019 | /** | ||
| 997 | * i40e_find_filter - Search VSI filter list for specific mac/vlan filter | 1020 | * i40e_find_filter - Search VSI filter list for specific mac/vlan filter |
| 998 | * @vsi: the VSI to be searched | 1021 | * @vsi: the VSI to be searched |
| 999 | * @macaddr: the MAC address | 1022 | * @macaddr: the MAC address |
