Age | Commit message (Collapse) | Author | Files | Lines |
|
Let this be freed by the kernel during close(2) call in case of v3
otherwise we would get a -EINVAL.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
Lets migrate capturing to TPACKET_V3, since it will bring a better
performance due to fewer page cache misses caused by a higher density
of packets, since now they are contigous placed in the ring buffer.
It is said that TPACKET_V3 brings the following benefits:
*) ~15 - 20% reduction in CPU-usage
*) ~20% increase in packet capture rate
*) ~2x increase in packet density
*) Port aggregation analysis
*) Non static frame size to capture entire packet payload
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
Prepare TPACKET_V3 for allowing to transparently setting up the
frame structure such that we do not need to change much in the
netsniff-ng/trafgen code.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
We do not want to maintain duplicate code, so move this into a separate
file and name those *_generic() helpers.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
Arg, this was a leftover when copying the other function. So fix it!
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
Implement ring setup routines and structures for TPACKET_V3.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
Mention the -n command line option in the general description, not just
the hard limit. Also remove the BUGS section, since this is now
basically resolved.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
There's no good reason why we currently waste an 'int' for
jumbo_support while this must better be done as 'bool'.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
Prepare setup_rx_ring_layout for both, v2 and v3. Also do some checks
during compile time if offsets stay the same as we operate on different
union mappings.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
Prepare and add some structures an helper functions for TPACKET_V3.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
It rather belongs to built_in.h, and not here.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
We only use it once and nowhere else, so just replace the correct
value right away.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
Add set_sockopt_tpacket_v3() in preparation for TPACKET_V3.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
Needed to let Git merge to not run into conflicts with Tobias' set
of changes on ifpps resp. ifpps manpage.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
More hyphen fixes all over.
Signed-off-by: Kartik Mistry <kartik@debian.org>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
Fix hyphens all over.
Signed-off-by: Kartik Mistry <kartik@debian.org>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
Instead of hard-coding the maximum number of top hitter CPUs, allow the
user to set it manually using a command line option. The default value
(if no command line parameter is specified) remains at 10.
Also update the manpage accordingly.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
The two functions timer_elapsed() and timer_next_dump() both take an
argument which they don't use. Annotate them appropriately using the
__maybe_unused attribute.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Rename it to set_sockopt_tpacket_v2 so that we later on can also
add other versions and have it clearly stated which one we use.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
Avoid code duplication by allocating the stats arrays dependent on the
number of CPUs in main() rather than screen_main() and term_main().
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
We currently do not support it, so do not keep it here.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
Some fixes all over, part 1.
Signed-off-by: Kartik Mistry <kartik@debian.org>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
Fix for spelling mistakes detected by Lintian.
Signed-off-by: Kartik Mistry <kartik@debian.org>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
Update oui entries.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
We don't need to keep an extra file around, put this into the
AUTHORS file under sponsor section. Also credit Team Cymru for
providing an extra machine for us for ASN mappings.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
For packaging, we cannot use -O3, -march etc, so have an option that
allows for distribution build and does less tuning.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
This is needed for distribution packaging purposes. Also remove the
warning, because -I/-L paths for nacl could be defined via cmdline
as well.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
Introduced by commit 0e47d1d5011f ("ifpps: Don't assume a maximum of
32 CPUs"). Also update term_main with initial allocation of CPU data.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
The dynamically allocated members of struct ifstat have an entry for
each CPU. Properly consider this when resetting the stats in the
STATS_ZERO1 macro.
Reported-by: Daniel Borkmann <borkmann@iogearbox.net>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
/proc/interrupts can have such a structure ...
98: 35 0 2902361 PCI-MSI-X eth1-0
106: 61 11 3841 PCI-MSI-X eth1-1
114: 28 0 61452 PCI-MSI-X eth1-2
122: 24 1586 22 PCI-MSI-X eth1-3
130: 2912 0 337 PCI-MSI-X eth1-4
138: 21 0 28 PCI-MSI-X eth1-5
146: 21 0 56 PCI-MSI-X eth1-6
154: 34 1 1 PCI-MSI-X eth1-7
... and will not count all IRQs for eth1-*. Thus change it to
sum up multiple entries.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
Just a minor change to also show the total number of cpus in the
headline.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
It's not used anywhere anymore, so remove it.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
The refresh interval can only be positive and is stored in an uint64_t,
so use strtoul() to convert it.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
Document the behaviour of ifpps when we switch to heavy hitter mode.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
When parsing irq numbers on e.g. 24 CPU machines, procfs lines can get
very long, so our static temporary buffer size will fail here with:
Assertion `!(stats->irq_nr == 0)' failed.
So allocate it relative to the CPU number.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
I've tested it on a 24 CPU machine, and it does not look so nice if
there's different padding along the lines. This patch fixes it.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
Add my name to the ouput of --version and --help.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
There are people with machines containing far more than 32 CPUs. In
their case ifpps didn't work until now because of a limitation to 32
CPUs.
Rework ifpps to support an arbitrary number of CPUs. In order to still
remain within the display space, if more than 10 (TOP_CPUS) CPUs are
available, only the 10 top hitting (in terms of usr and sys time or irqs
respectively) are displayed.
Suggested-by: Daniel Borkmann <borkmann@iogearbox.net>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Just shortly also mention JIT disassembler in conjunction with bpfc.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
This is a minimal stand-alone user space helper, that allows for debugging or
verification of emitted BPF JIT images. This is in particular useful for
emitted opcode debugging, since minor bugs in the JIT compiler can be fatal.
The disassembler is architecture generic and uses libopcodes and libbfd.
How to get to the disassembly, example:
1) `echo 2 > /proc/sys/net/core/bpf_jit_enable`
2) Load a BPF filter (e.g. `tcpdump -p -n -s 0 -i eth1 host 192.168.20.0/24`)
3) Run e.g. `bpf_jit_disasm -o` to disassemble the most recent JIT code output
`bpf_jit_disasm -o` will display the related opcodes to a particular instruction
as well. Example for x86_64:
$./bpf_jit_disasm
94 bytes emitted from JIT compiler (pass:3, flen:9)
ffffffffa0356000 + <x>:
0: push %rbp
1: mov %rsp,%rbp
4: sub $0x60,%rsp
8: mov %rbx,-0x8(%rbp)
c: mov 0x68(%rdi),%r9d
10: sub 0x6c(%rdi),%r9d
14: mov 0xe0(%rdi),%r8
1b: mov $0xc,%esi
20: callq 0xffffffffe0d01b71
25: cmp $0x86dd,%eax
2a: jne 0x000000000000003d
2c: mov $0x14,%esi
31: callq 0xffffffffe0d01b8d
36: cmp $0x6,%eax
[...]
5c: leaveq
5d: retq
$ ./bpf_jit_disasm -o
94 bytes emitted from JIT compiler (pass:3, flen:9)
ffffffffa0356000 + <x>:
0: push %rbp
55
1: mov %rsp,%rbp
48 89 e5
4: sub $0x60,%rsp
48 83 ec 60
8: mov %rbx,-0x8(%rbp)
48 89 5d f8
c: mov 0x68(%rdi),%r9d
44 8b 4f 68
10: sub 0x6c(%rdi),%r9d
44 2b 4f 6c
[...]
5c: leaveq
c9
5d: retq
c3
Note that this is also part of the Linux kernel source tree under
tools/net/. We also keep a copy of it here, since it is quite useful
in conjunction with bpfc for debugging purposes. However, we do not
integrate this small helper into the main build process. People who
care to have this need to compile it on their own which is not a big
deal.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
Format larger text sections into subsections, include .PPs
and other fixups.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
Minor change in BUGS section to bring it up to date.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
Make the 2nd section of the description a bit easier to read by
splitting and rearranging sentences. Also add a few missing punctuations
or make it more consistent repectively.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
Remove some unneeded stuff, and move other things around.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|
|
Add a paragraph about multi-threading with netsniff-ng.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
|