[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1346074359.26634.4.camel@edumazet-glaptop>
Date: Mon, 27 Aug 2012 06:32:39 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Aníbal Almeida Pinto <anibal.pinto@...cec.com>
Cc: netdev@...r.kernel.org
Subject: Re: Gianfar ethernet drop package
On Mon, 2012-08-27 at 14:01 +0100, Aníbal Almeida Pinto wrote:
> Is there any way of put tcpdump or other tool to only log the packages
> dropped ?
To log such packets with tcpdump, I am afraid you'll need to patch your
kernel.
We dont have a way to tell tcpdump "sniff dropped packets"
Something like this one
(alternatively you can use dropwatch (based on drop_monitor)) and tweak
it...
diff --git a/net/core/dev.c b/net/core/dev.c
index 3401e2d..1336570 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3263,14 +3263,6 @@ another_round:
if (sk_memalloc_socks() && skb_pfmemalloc(skb))
goto skip_taps;
- list_for_each_entry_rcu(ptype, &ptype_all, list) {
- if (!ptype->dev || ptype->dev == skb->dev) {
- if (pt_prev)
- ret = deliver_skb(skb, pt_prev, orig_dev);
- pt_prev = ptype;
- }
- }
-
skip_taps:
#ifdef CONFIG_NET_CLS_ACT
skb = handle_ing(skb, &pt_prev, &ret, orig_dev);
@@ -3337,6 +3329,11 @@ ncls:
} else {
drop:
atomic_long_inc(&skb->dev->rx_dropped);
+ list_for_each_entry_rcu(ptype, &ptype_all, list) {
+ if (!ptype->dev || ptype->dev == skb->dev) {
+ ret = deliver_skb(skb, ptype, orig_dev);
+ }
+ }
kfree_skb(skb);
/* Jamal, now you will not able to escape explaining
* me how you were going to use this. :-)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists