* [PATCH net-2.6] tg3: restore rx_dropped accounting
@ 2010-10-11 5:55 Eric Dumazet
2010-10-11 22:26 ` Matt Carlson
0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2010-10-11 5:55 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Matt Carlson, Michael Chan
commit 511d22247be7 (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: Eric Dumazet <eric.dumazet@gmail.com>
CC: Michael Chan <mchan@broadcom.com>
CC: Matt Carlson <mcarlson@broadcom.com>
---
drivers/net/tg3.c | 6 ++++--
drivers/net/tg3.h | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index bc3af78..1ec4b9e 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -4666,7 +4666,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
desc_idx, *post_ptr);
drop_it_no_recycle:
/* Other statistics kept track of by card. */
- tp->net_stats.rx_dropped++;
+ tp->rx_dropped++;
goto next_pkt;
}
@@ -4726,7 +4726,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
if (len > (tp->dev->mtu + ETH_HLEN) &&
skb->protocol != htons(ETH_P_8021Q)) {
dev_kfree_skb(skb);
- goto next_pkt;
+ goto drop_it_no_recycle;
}
if (desc->type_flags & RXD_FLAG_VLAN &&
@@ -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 +
get_stat64(&hw_stats->rx_discards);
+ stats->rx_dropped = tp->rx_dropped;
+
return stats;
}
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 4937bd1..be7ff13 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -2759,7 +2759,7 @@ struct tg3 {
/* begin "everything else" cacheline(s) section */
- struct rtnl_link_stats64 net_stats;
+ unsigned long rx_dropped;
struct rtnl_link_stats64 net_stats_prev;
struct tg3_ethtool_stats estats;
struct tg3_ethtool_stats estats_prev;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-2.6] tg3: restore rx_dropped accounting
2010-10-11 5:55 [PATCH net-2.6] tg3: restore rx_dropped accounting Eric Dumazet
@ 2010-10-11 22:26 ` Matt Carlson
2010-10-11 23:06 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Matt Carlson @ 2010-10-11 22:26 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, netdev, Matthew Carlson, Michael Chan
On Sun, Oct 10, 2010 at 10:55:52PM -0700, Eric Dumazet wrote:
> commit 511d22247be7 (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: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Matt Carlson <mcarlson@broadcom.com>
> CC: Michael Chan <mchan@broadcom.com>
> CC: Matt Carlson <mcarlson@broadcom.com>
> ---
> drivers/net/tg3.c | 6 ++++--
> drivers/net/tg3.h | 2 +-
> 2 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
> index bc3af78..1ec4b9e 100644
> --- a/drivers/net/tg3.c
> +++ b/drivers/net/tg3.c
> @@ -4666,7 +4666,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
> desc_idx, *post_ptr);
> drop_it_no_recycle:
> /* Other statistics kept track of by card. */
> - tp->net_stats.rx_dropped++;
> + tp->rx_dropped++;
> goto next_pkt;
> }
>
> @@ -4726,7 +4726,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
> if (len > (tp->dev->mtu + ETH_HLEN) &&
> skb->protocol != htons(ETH_P_8021Q)) {
> dev_kfree_skb(skb);
> - goto next_pkt;
> + goto drop_it_no_recycle;
> }
>
> if (desc->type_flags & RXD_FLAG_VLAN &&
> @@ -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 +
> get_stat64(&hw_stats->rx_discards);
>
> + stats->rx_dropped = tp->rx_dropped;
> +
> return stats;
> }
>
> diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
> index 4937bd1..be7ff13 100644
> --- a/drivers/net/tg3.h
> +++ b/drivers/net/tg3.h
> @@ -2759,7 +2759,7 @@ struct tg3 {
>
>
> /* begin "everything else" cacheline(s) section */
> - struct rtnl_link_stats64 net_stats;
> + unsigned long rx_dropped;
> struct rtnl_link_stats64 net_stats_prev;
> struct tg3_ethtool_stats estats;
> struct tg3_ethtool_stats estats_prev;
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-2.6] tg3: restore rx_dropped accounting
2010-10-11 22:26 ` Matt Carlson
@ 2010-10-11 23:06 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2010-10-11 23:06 UTC (permalink / raw)
To: mcarlson; +Cc: eric.dumazet, netdev, mchan
From: "Matt Carlson" <mcarlson@broadcom.com>
Date: Mon, 11 Oct 2010 15:26:57 -0700
> On Sun, Oct 10, 2010 at 10:55:52PM -0700, Eric Dumazet wrote:
>> commit 511d22247be7 (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: Eric Dumazet <eric.dumazet@gmail.com>
>
> Acked-by: Matt Carlson <mcarlson@broadcom.com>
Applied, thanks Matt.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-10-11 23:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-11 5:55 [PATCH net-2.6] tg3: restore rx_dropped accounting Eric Dumazet
2010-10-11 22:26 ` Matt Carlson
2010-10-11 23:06 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).