kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Packet drop while using BPF filter
@ 2011-12-20 18:38 Mukesh Yadav
  2011-12-21  0:52 ` Mulyadi Santosa
  2011-12-22 13:48 ` Raghavendra D Prabhu
  0 siblings, 2 replies; 7+ messages in thread
From: Mukesh Yadav @ 2011-12-20 18:38 UTC (permalink / raw)
  To: kernelnewbies

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20111221/129e99c3/attachment.html 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-12-24 18:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).