diff options
author | Christian Gromm <christian.gromm@microchip.com> | 2015-12-22 10:53:08 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-07 17:34:58 -0800 |
commit | 1c55d30b1da6bd4f3b0dbd64e660fad44b8958d8 (patch) | |
tree | bb368570b694bbd4f41c48638ce20f38526cba3a /drivers/staging/most | |
parent | 5adf5dc5682fa7968370a8bea773d98f1beeeddc (diff) | |
download | talos-op-linux-1c55d30b1da6bd4f3b0dbd64e660fad44b8958d8.tar.gz talos-op-linux-1c55d30b1da6bd4f3b0dbd64e660fad44b8958d8.zip |
staging: most: add statistics for dropped packets
This patch adds a counter for dropped packets. It needed for statistical
analysis.
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/most')
-rw-r--r-- | drivers/staging/most/aim-network/networking.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/staging/most/aim-network/networking.c b/drivers/staging/most/aim-network/networking.c index 3c7beb03871d..2f42de44d051 100644 --- a/drivers/staging/most/aim-network/networking.c +++ b/drivers/staging/most/aim-network/networking.c @@ -431,6 +431,7 @@ static int aim_rx_data(struct mbo *mbo) u32 len = mbo->processed_length; struct sk_buff *skb; struct net_device *dev; + unsigned int skb_len; nd = get_net_dev_context(mbo->ifp); if (!nd || !nd->channels_opened || nd->rx.ch_id != mbo->hdm_channel_id) @@ -482,9 +483,13 @@ static int aim_rx_data(struct mbo *mbo) memcpy(skb_put(skb, len), buf, len); skb->protocol = eth_type_trans(skb, dev); - dev->stats.rx_packets++; - dev->stats.rx_bytes += skb->len; - netif_rx(skb); + skb_len = skb->len; + if (netif_rx(skb) == NET_RX_SUCCESS) { + dev->stats.rx_packets++; + dev->stats.rx_bytes += skb_len; + } else { + dev->stats.rx_dropped++; + } out: most_put_mbo(mbo); |