Skip to contentSkip to conversation

profile my proto_hook.function

DISCUSSION zhou rui 2 participants 2 messages Apr 12, 2011

Subsystems (2)
lore
Share & tools
lore

zhou rui

author
#0 lore raw

hi
I used a prot_hook(added via dev_add_pack,protocol=ETH_P_ALL) to process packets in kernel part.but the performance was bad

ksoftirqd used almost 100% cpu on my 1G nic(intel e1000,w/o RSS) XEON 5400 hypertown machine.

looks my packet processing is too slow. but how to profile this? i.e. how many CPU resources used in softirq and normal kernel protocol stack(tcp/ip,etc)
and how many used in my packet processing function?

and any idea to improve it?how about moving the processing function to driver?

thanks
rui

#1 lore raw
Quoted 7 lines · zhou rui

hi
I used a prot_hook(added via dev_add_pack,protocol=ETH_P_ALL) to process packets in kernel part.but the performance was bad

ksoftirqd used almost 100% cpu on my 1G nic(intel e1000,w/o RSS) XEON 5400 hypertown machine.

Quoted 6 lines

looks my packet processing is too slow. but how to profile this? i.e. how many CPU resources used in softirq and normal kernel protocol stack(tcp/ip,etc)
and how many used in my packet processing function?

and any idea to improve it?how about moving the processing function to driver?

You coud use perf tool, included in kernel sources

# cd ~your_kernel_sources
# cd tools/perf
# make

<run your workload, and record activity :>

# ./perf record -a -g sleep 10

Then later, you can take a look at results

./perf report