From: mulyadi.santosa@gmail.com (Mulyadi Santosa)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Packet drop while using BPF filter
Date: Wed, 21 Dec 2011 07:52:20 +0700 [thread overview]
Message-ID: <CAGdaadazM6WnSeGqt_EWNDCb9GNTE_P_6t4w1gV+81OTPemsTw@mail.gmail.com> (raw)
In-Reply-To: <CACPS-PuMisxusXKsTVB8LxDKGbzjjTatQrp4RoED2a7sLzsZQg@mail.gmail.com>
Hi Mukesh..
On Wed, Dec 21, 2011 at 01:38, Mukesh Yadav <mukesh.fkd@gmail.com> wrote:
> BPF filters used are:
> Even IP filter :-> tcpdump -i interface 'ether dst <dest mac> && ip[19] &
> 0x01 = 0'
> Odd IP filter :-> ?tcpdump -i interface ?'ether dst <dest mac> && ip[19] &
> 0x01 = 1'
>
> There is a packet loss for odd IP thread even when CPU is?available. Reason
> being packet drop due ?recv buffer full.
> Same amount of traffic is well handled by even IP thread(user code being
> same in both), scaling CPU to full 100%.
>
> In odd IP thread, If filter is changed to "tcpdump -i interface ?'ether dst
> <dest mac> && ip proto 17'?", all goes fine.
> Also CPU usage at kernel drops from 50% to 4 % for a particular amount of
> traffic.
I have zero experience with BPF, so this is just my theory.
In kernel level, (or maybe between kernel and user level), by putting
your odd and even filter, kernel work too hard to separate the packets
into different "queue" or "channel"...or something like that. While in
the mean time, incoming packets are bursting .... This makes buffers
filled up fast.
How about this... just filter anything that match your target
MAC....fed this up to the user level application and let your
application do the odd and even IP filtering?
--
regards,
Mulyadi Santosa
Freelance Linux trainer and consultant
blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com
next prev parent reply other threads:[~2011-12-21 0:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-20 18:38 Packet drop while using BPF filter Mukesh Yadav
2011-12-21 0:52 ` Mulyadi Santosa [this message]
2011-12-21 5:25 ` Mukesh Yadav
2011-12-21 16:59 ` Mulyadi Santosa
2011-12-22 13:48 ` Raghavendra D Prabhu
2011-12-24 16:27 ` Mukesh Yadav
2011-12-24 18:54 ` Raghavendra D Prabhu
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=CAGdaadazM6WnSeGqt_EWNDCb9GNTE_P_6t4w1gV+81OTPemsTw@mail.gmail.com \
--to=mulyadi.santosa@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.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;
as well as URLs for NNTP newsgroup(s).