From: Eric Dumazet <eric.dumazet@gmail.com>
To: "Aníbal Almeida Pinto" <anibal.pinto@efacec.com>
Cc: netdev@vger.kernel.org
Subject: Re: Gianfar ethernet drop package
Date: Mon, 27 Aug 2012 06:32:39 -0700 [thread overview]
Message-ID: <1346074359.26634.4.camel@edumazet-glaptop> (raw)
In-Reply-To: <503B6FA7.8070807@efacec.com>
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. :-)
prev parent reply other threads:[~2012-08-27 13:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-24 16:14 Gianfar ethernet drop package Aníbal Almeida Pinto
2012-08-24 18:17 ` Eric Dumazet
2012-08-27 10:32 ` Aníbal Almeida Pinto
2012-08-27 11:08 ` Eric Dumazet
2012-08-27 13:01 ` Aníbal Almeida Pinto
2012-08-27 13:32 ` Eric Dumazet [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1346074359.26634.4.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=anibal.pinto@efacec.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox