提交 b0057c51 编写于 作者: E Eric Dumazet 提交者: David S. Miller

tg3: restore rx_dropped accounting

commit 511d2224 (tg3: 64 bit stats on all arches), overlooked the
rx_dropped accounting.

We use a full "struct rtnl_link_stats64" to hold rx_dropped value, but
forgot to report it in tg3_get_stats64().

Use an "unsigned long" instead to shrink "struct tg3" by 176 bytes, and
report this value to stats readers.

Increment rx_dropped counter for oversized frames.
Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
CC: Michael Chan <mchan@broadcom.com>
CC: Matt Carlson <mcarlson@broadcom.com>
Acked-by: NMatt Carlson <mcarlson@broadcom.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 bcf64aa3
...@@ -4666,7 +4666,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget) ...@@ -4666,7 +4666,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
desc_idx, *post_ptr); desc_idx, *post_ptr);
drop_it_no_recycle: drop_it_no_recycle:
/* Other statistics kept track of by card. */ /* Other statistics kept track of by card. */
tp->net_stats.rx_dropped++; tp->rx_dropped++;
goto next_pkt; goto next_pkt;
} }
...@@ -4726,7 +4726,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget) ...@@ -4726,7 +4726,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
if (len > (tp->dev->mtu + ETH_HLEN) && if (len > (tp->dev->mtu + ETH_HLEN) &&
skb->protocol != htons(ETH_P_8021Q)) { skb->protocol != htons(ETH_P_8021Q)) {
dev_kfree_skb(skb); dev_kfree_skb(skb);
goto next_pkt; goto drop_it_no_recycle;
} }
if (desc->type_flags & RXD_FLAG_VLAN && if (desc->type_flags & RXD_FLAG_VLAN &&
...@@ -9240,6 +9240,8 @@ static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *dev, ...@@ -9240,6 +9240,8 @@ static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *dev,
stats->rx_missed_errors = old_stats->rx_missed_errors + stats->rx_missed_errors = old_stats->rx_missed_errors +
get_stat64(&hw_stats->rx_discards); get_stat64(&hw_stats->rx_discards);
stats->rx_dropped = tp->rx_dropped;
return stats; return stats;
} }
......
...@@ -2759,7 +2759,7 @@ struct tg3 { ...@@ -2759,7 +2759,7 @@ struct tg3 {
/* begin "everything else" cacheline(s) section */ /* begin "everything else" cacheline(s) section */
struct rtnl_link_stats64 net_stats; unsigned long rx_dropped;
struct rtnl_link_stats64 net_stats_prev; struct rtnl_link_stats64 net_stats_prev;
struct tg3_ethtool_stats estats; struct tg3_ethtool_stats estats;
struct tg3_ethtool_stats estats_prev; struct tg3_ethtool_stats estats_prev;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册