From: raghu.prabhu13@gmail.com (Raghavendra D Prabhu)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Packet drop while using BPF filter
Date: Sun, 25 Dec 2011 00:24:45 +0530 [thread overview]
Message-ID: <20111224185445.GC35489@Xye> (raw)
In-Reply-To: <CACPS-PuywThT4aHZdia4HtJoLBjA1jbyxU5q+KCBm5RKoCRitQ@mail.gmail.com>
* On Sat, Dec 24, 2011 at 09:57:50PM +0530, Mukesh Yadav <mukesh.fkd@gmail.com> wrote:
>Hi Raghavendra,
>
>" /proc/sys/net/core/bpf_jit_**enable " is not present on machine. Seems
>kernel need to be configured for these.
Yes, it is a fairly new option -- CONFIG_BPF_JIT=y
>Btw CPU scaling issue is resolved. Packet drop was because all interrupt
>handling was happening on core where packets were getting drop. Tuning
>system for interrupt handling using smp_affinity resolved the issue.
That is generally how it is done. The core which handles packets
initially
handles the interrupts too. Do you mean all non-network
interrupts were happening on same core ? Then give irqbalance a
shot.
>
>Thanks
>Mukesh
>
>On 22 December 2011 19:18, Raghavendra D Prabhu <raghu.prabhu13@gmail.com>wrote:
>
>> Hi,
>> Have you tried enabling -- /proc/sys/net/core/bpf_jit_**enable --
>> provides JIT compiled BPF on 64 bit linux.
>> * On Wed, Dec 21, 2011 at 12:08:04AM +0530, Mukesh Yadav <
>> mukesh.fkd at gmail.com> wrote:
>>> Hi Guys,
>>> I am working on user level code which uses BPF filter.
>>> Solution has two threads and BPF filter for incoming packets to raw
>>> socket
>>> dedicated to each thread.
>>> Intent is to divide ingress traffic between two thread based on whether
>>> dest IP is even or odd.
>>> 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.
>>> Would appreciate any I/ps for reducing load at kernel for packet
>>> filtering(Odd/Even IP distribution)
>>> Cheers
>>> Mukesh
>> ______________________________**_________________
>>> Kernelnewbies mailing list
>>> Kernelnewbies at kernelnewbies.**org <Kernelnewbies@kernelnewbies.org>
>>> http://lists.kernelnewbies.**org/mailman/listinfo/**kernelnewbies<http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies>
>> --------------------------
>> Raghavendra Prabhu
>> GPG Id : 0xD72BE977
>> Fingerprint: B93F EBCB 8E05 7039 CD3C A4B8 A616 DCA1 D72B E977
>> www: wnohang.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20111225/dea47c08/attachment.bin
prev parent reply other threads:[~2011-12-24 18:54 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
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 [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=20111224185445.GC35489@Xye \
--to=raghu.prabhu13@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).