netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* multi bpf filter will impact performance?
@ 2010-11-30  9:22 Rui
  2010-11-30  9:34 ` Eric Dumazet
                   ` (2 more replies)
  0 siblings, 3 replies; 42+ messages in thread
From: Rui @ 2010-11-30  9:22 UTC (permalink / raw)
  To: netdev

hi

I did a test with an intel X520 10Gnic, HP DL380 G6,  to see how the
bpf filter will impact the performance.

kernel .2.6.32 SLES11+SP1, original ixgbe driver

step 0:
launch 4 tcpdump processes,each applied a filter to filter out some
GTP-U packets. seen with 'tcpdump -d', the bpf code has about 100
lines.

#!/bin/sh
PCAP_FRAMES=32000 ./tcpdump_MMAP -i eth4 'udp dst port 2152 and (
(((ether[48:1]&0x07)>0) and
(((ether[66:1]+ether[67:1]+ether[68:1]+ether[69:1]+ether[70:1]+ether[71:1]+ether[72:1]+ether[73:1])&0x03)==0))
or (((ether[48:1]&0x07)==0) and
(((ether[62:1]+ether[63:1]+ether[64:1]+ether[65:1]+ether[66:1]+ether[67:1]+ether[68:1]+ether[69:1])&0x03)==0))
) ' -w /dev/null -s 4096 2>f1.log &
PCAP_FRAMES=32000 ./tcpdump_MMAP -i eth4 'udp dst port 2152 and (
(((ether[48:1]&0x07)>0) and
(((ether[66:1]+ether[67:1]+ether[68:1]+ether[69:1]+ether[70:1]+ether[71:1]+ether[72:1]+ether[73:1])&0x03)==1))
or (((ether[48:1]&0x07)==0) and
(((ether[62:1]+ether[63:1]+ether[64:1]+ether[65:1]+ether[66:1]+ether[67:1]+ether[68:1]+ether[69:1])&0x03)==1))
) ' -w /dev/null -s 4096 2>f2.log &
PCAP_FRAMES=32000 ./tcpdump_MMAP -i eth4 'udp dst port 2152 and (
(((ether[48:1]&0x07)>0) and
(((ether[66:1]+ether[67:1]+ether[68:1]+ether[69:1]+ether[70:1]+ether[71:1]+ether[72:1]+ether[73:1])&0x03)==2))
or (((ether[48:1]&0x07)==0) and
(((ether[62:1]+ether[63:1]+ether[64:1]+ether[65:1]+ether[66:1]+ether[67:1]+ether[68:1]+ether[69:1])&0x03)==2))
) ' -w /dev/null -s 4096 2>f3.log &
PCAP_FRAMES=32000 ./tcpdump_MMAP -i eth4 'udp dst port 2152 and (
(((ether[48:1]&0x07)>0) and
(((ether[66:1]+ether[67:1]+ether[68:1]+ether[69:1]+ether[70:1]+ether[71:1]+ether[72:1]+ether[73:1])&0x03)==3))
or (((ether[48:1]&0x07)==0) and
(((ether[62:1]+ether[63:1]+ether[64:1]+ether[65:1]+ether[66:1]+ether[67:1]+ether[68:1]+ether[69:1])&0x03)==3))
) ' -w /dev/null -s 4096 2>f4.log &


step1:
use stress test equipment to generate traffic >1.2Gbps


step2:
type 'ifconfig eth4'
saw many packets dropped

step3:
type 'sar -n DEV 1', the incoming throughput limited at 800Mbps


my questions:

Q1. the bpf filter is run one by one? will only one filter be executed
for one sock? (so that the tcpdump corresponding kernel part will run
filter in parallel?)

Q2. performance is bad? any idea to improve it?

thanks a lot
rui

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

end of thread, other threads:[~2010-12-06 21:07 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-30  9:22 multi bpf filter will impact performance? Rui
2010-11-30  9:34 ` Eric Dumazet
     [not found]   ` <AANLkTi=VpmnrXTBNV7McQm6mq9ULT7KTKbM8_hLPoL=2@mail.gmail.com>
     [not found]     ` <1291127670.2904.96.camel@edumazet-laptop>
2010-12-01  3:48       ` Rui
2010-12-01  4:03         ` Eric Dumazet
2010-12-01  7:45           ` [PATCH net-next-2.6] filter: add SKF_AD_RXHASH and SKF_AD_CPU Eric Dumazet
2010-12-01  8:03             ` Changli Gao
2010-12-06 21:02             ` David Miller
2010-12-03  9:40           ` multi bpf filter will impact performance? Junchang Wang
2010-12-01  7:36         ` Changli Gao
2010-12-01  7:47           ` Eric Dumazet
2010-12-01  7:59             ` Changli Gao
2010-12-01  8:09               ` Eric Dumazet
2010-12-01  8:15                 ` Changli Gao
2010-12-01  8:42                   ` Eric Dumazet
2010-12-01 17:22                     ` Hagen Paul Pfeifer
2010-12-01 18:18                       ` David Miller
2010-12-01 18:24                         ` David Miller
2010-12-01 18:24                         ` Eric Dumazet
2010-12-01 18:44                           ` David Miller
2010-12-01 19:48                             ` Eric Dumazet
2010-12-01 20:23                               ` David Miller
2010-12-01 20:45                                 ` [PATCH net-next-2.6] filter: add a security check at install time Eric Dumazet
2010-12-02  2:30                                   ` Changli Gao
2010-12-02  6:46                                     ` Eric Dumazet
2010-12-02  8:11                                       ` Changli Gao
2010-12-02  8:53                                         ` Eric Dumazet
2010-12-02  9:00                                           ` Eric Dumazet
2010-12-02  9:10                                             ` Changli Gao
2010-12-02  9:54                                               ` Eric Dumazet
2010-12-02 10:10                                                 ` Changli Gao
2010-12-02 11:15                                                   ` Eric Dumazet
2010-12-02 11:29                                                     ` Changli Gao
2010-12-02 13:14                                                       ` Eric Dumazet
2010-12-02 10:59                                             ` Changli Gao
2010-12-06 21:07                                       ` David Miller
2010-12-03  6:32                         ` multi bpf filter will impact performance? Eric Dumazet
2010-12-05 20:53                           ` PATCH] filter: fix sk_filter rcu handling Eric Dumazet
2010-12-05 21:08                             ` Andi Kleen
2010-12-05 21:28                               ` Eric Dumazet
2010-12-06 17:29                             ` David Miller
2010-11-30 10:01 ` multi bpf filter will impact performance? Eric Dumazet
2010-11-30 11:17 ` Eric Dumazet

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).