mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-30 08:02:30 +00:00
nfp: fix ethtool stats gather retry
The while loop fetching 64 bit ethtool statistics may have
to retry multiple times, it shouldn't modify the outside state.
Fixes: 4c3523623d
("net: add driver for Netronome NFP4000/NFP6000 NIC VFs")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
3668bb8da1
commit
c3d64ad4fe
1 changed files with 5 additions and 3 deletions
|
@ -464,7 +464,7 @@ static u64 *nfp_vnic_get_sw_stats(struct net_device *netdev, u64 *data)
|
||||||
|
|
||||||
do {
|
do {
|
||||||
start = u64_stats_fetch_begin(&nn->r_vecs[i].rx_sync);
|
start = u64_stats_fetch_begin(&nn->r_vecs[i].rx_sync);
|
||||||
*data++ = nn->r_vecs[i].rx_pkts;
|
data[0] = nn->r_vecs[i].rx_pkts;
|
||||||
tmp[0] = nn->r_vecs[i].hw_csum_rx_ok;
|
tmp[0] = nn->r_vecs[i].hw_csum_rx_ok;
|
||||||
tmp[1] = nn->r_vecs[i].hw_csum_rx_inner_ok;
|
tmp[1] = nn->r_vecs[i].hw_csum_rx_inner_ok;
|
||||||
tmp[2] = nn->r_vecs[i].hw_csum_rx_error;
|
tmp[2] = nn->r_vecs[i].hw_csum_rx_error;
|
||||||
|
@ -472,14 +472,16 @@ static u64 *nfp_vnic_get_sw_stats(struct net_device *netdev, u64 *data)
|
||||||
|
|
||||||
do {
|
do {
|
||||||
start = u64_stats_fetch_begin(&nn->r_vecs[i].tx_sync);
|
start = u64_stats_fetch_begin(&nn->r_vecs[i].tx_sync);
|
||||||
*data++ = nn->r_vecs[i].tx_pkts;
|
data[1] = nn->r_vecs[i].tx_pkts;
|
||||||
*data++ = nn->r_vecs[i].tx_busy;
|
data[2] = nn->r_vecs[i].tx_busy;
|
||||||
tmp[3] = nn->r_vecs[i].hw_csum_tx;
|
tmp[3] = nn->r_vecs[i].hw_csum_tx;
|
||||||
tmp[4] = nn->r_vecs[i].hw_csum_tx_inner;
|
tmp[4] = nn->r_vecs[i].hw_csum_tx_inner;
|
||||||
tmp[5] = nn->r_vecs[i].tx_gather;
|
tmp[5] = nn->r_vecs[i].tx_gather;
|
||||||
tmp[6] = nn->r_vecs[i].tx_lso;
|
tmp[6] = nn->r_vecs[i].tx_lso;
|
||||||
} while (u64_stats_fetch_retry(&nn->r_vecs[i].tx_sync, start));
|
} while (u64_stats_fetch_retry(&nn->r_vecs[i].tx_sync, start));
|
||||||
|
|
||||||
|
data += 3;
|
||||||
|
|
||||||
for (j = 0; j < NN_ET_RVEC_GATHER_STATS; j++)
|
for (j = 0; j < NN_ET_RVEC_GATHER_STATS; j++)
|
||||||
gathered_stats[j] += tmp[j];
|
gathered_stats[j] += tmp[j];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue