diff options
author | David Kershner <david.kershner@unisys.com> | 2015-09-04 12:01:30 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-09-13 09:43:40 -0700 |
commit | f6b6a8ec9a3bcba8cc9a9c302b514cf3848e7d35 (patch) | |
tree | fe09b256285bb5308dfeef17b55abce244fb1652 /drivers/staging | |
parent | 5b12100a53c11ef760e78c2899be8f1bf33812ca (diff) | |
download | blackbird-op-linux-f6b6a8ec9a3bcba8cc9a9c302b514cf3848e7d35.tar.gz blackbird-op-linux-f6b6a8ec9a3bcba8cc9a9c302b514cf3848e7d35.zip |
staging: unisys: visornic: Fix receive bytes statistics
The receive byte statistics was wrong in /proc/net/dev.
Move the collection of statistics after the proper amount
of bytes has been calculated and make sure you add it to
rx_bytes instead of just replacing it.
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/unisys/visornic/visornic_main.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/unisys/visornic/visornic_main.c b/drivers/staging/unisys/visornic/visornic_main.c index bacf1af4e8d4..7b08a8998a6d 100644 --- a/drivers/staging/unisys/visornic/visornic_main.c +++ b/drivers/staging/unisys/visornic/visornic_main.c @@ -1189,16 +1189,16 @@ visornic_rx(struct uiscmdrsp *cmdrsp) spin_lock_irqsave(&devdata->priv_lock, flags); atomic_dec(&devdata->num_rcvbuf_in_iovm); - /* update rcv stats - call it with priv_lock held */ - devdata->net_stats.rx_packets++; - devdata->net_stats.rx_bytes = skb->len; - /* set length to how much was ACTUALLY received - * NOTE: rcv_done_len includes actual length of data rcvd * including ethhdr */ skb->len = cmdrsp->net.rcv.rcv_done_len; + /* update rcv stats - call it with priv_lock held */ + devdata->net_stats.rx_packets++; + devdata->net_stats.rx_bytes += skb->len; + /* test enabled while holding lock */ if (!(devdata->enabled && devdata->enab_dis_acked)) { /* don't process it unless we're in enable mode and until |