Commit 1c55d30b authored by Christian Gromm's avatar Christian Gromm Committed by Greg Kroah-Hartman

staging: most: add statistics for dropped packets

This patch adds a counter for dropped packets. It needed for statistical
analysis.
Signed-off-by: default avatarChristian Gromm <christian.gromm@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5adf5dc5
...@@ -431,6 +431,7 @@ static int aim_rx_data(struct mbo *mbo) ...@@ -431,6 +431,7 @@ static int aim_rx_data(struct mbo *mbo)
u32 len = mbo->processed_length; u32 len = mbo->processed_length;
struct sk_buff *skb; struct sk_buff *skb;
struct net_device *dev; struct net_device *dev;
unsigned int skb_len;
nd = get_net_dev_context(mbo->ifp); nd = get_net_dev_context(mbo->ifp);
if (!nd || !nd->channels_opened || nd->rx.ch_id != mbo->hdm_channel_id) 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) ...@@ -482,9 +483,13 @@ static int aim_rx_data(struct mbo *mbo)
memcpy(skb_put(skb, len), buf, len); memcpy(skb_put(skb, len), buf, len);
skb->protocol = eth_type_trans(skb, dev); skb->protocol = eth_type_trans(skb, dev);
dev->stats.rx_packets++; skb_len = skb->len;
dev->stats.rx_bytes += skb->len; if (netif_rx(skb) == NET_RX_SUCCESS) {
netif_rx(skb); dev->stats.rx_packets++;
dev->stats.rx_bytes += skb_len;
} else {
dev->stats.rx_dropped++;
}
out: out:
most_put_mbo(mbo); most_put_mbo(mbo);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment