summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-06-04rnd: break out prng from xutilsDaniel Borkmann7-46/+58
We only need it in curvetun, this makes it easier to maintain. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-04corking: use bool instead of intDaniel Borkmann2-6/+8
We have a boolen condition, so use bool instead of doing stupid things with ints. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-04trie: remove useless header commentDaniel Borkmann1-6/+0
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-04cpusched: remove useless header commentDaniel Borkmann1-6/+0
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-04corking: break out udp/tcp cork functionsDaniel Borkmann7-58/+80
No, it's not about whine bottles ... move udp and tcp cork functions out of xutils.c, so that we can further let it shrink. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-04xutils: remove unused declarationDaniel Borkmann1-1/+0
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-04cpus: break out cpu related functions from xutilsDaniel Borkmann6-12/+19
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-04xutils: break out string handling and lockingDaniel Borkmann32-95/+149
Break out all string handling functions and lockme stuff in order to further eliminate the big code blob in xutils, so that it can be easier maintained. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-03iosched: break out io scheduling functions from xutilsDaniel Borkmann8-62/+88
Break this stuff out, for better maintainability and readability. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-03netsniff-ng: v3: fix packet accounting on --numDaniel Borkmann5-30/+34
We need to carry frame_count through multiple calls of walk function to account correctly for --num <pkts>. Also, move socket stats printing into rx ring, since it belongs there. Todo: the kernel socket seems to have a different count that what we see. This needs to be fixed one way or the other. Not yet sure what's causing this. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-03irq: break out from xutils and save + restoreDaniel Borkmann8-112/+145
Break out IRQ functionality from xutils, simplify it, and save + restore IRQ affinity list. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-03zsh: update zsh autocompletion functions to implementationHideo Hattori4-8/+13
Update those functions to implementation status. Signed-off-by: Hideo Hattori <hhatto.jp@gmail.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-02ifpps: Rename variable containing top number of CPUsTobias Klauser1-8/+8
To make it more clear whether we're using the total number of CPUs or the top number (default 10 or specified by user), rename the variable, where the top number is used. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-05-31netsniff-ng: minor: update help descriptionDaniel Borkmann1-3/+3
Give -J a lower prio in the help option ranking and state that its only for replay or forwarding. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-31man: netsniff-ng: update man page to document when -J is neededDaniel Borkmann1-13/+16
--jumbo-support is now not always needed anymore. So document when one needs it and when not. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-31netsniff-ng: enable jumbo frames on default in tpacket_v3Daniel Borkmann1-4/+4
Since frames are stored more compressed and contiguous, we can also enable jumbo support in pcap dumps by default, since we have no further restrictions in terms of ring buffer frame size. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-31ring_rx: if v3, free it in kernel space during closeDaniel Borkmann1-2/+7
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>
2013-05-31ring: netsniff-ng: migrate capture only to TPACKET_V3Daniel Borkmann7-128/+176
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>
2013-05-31ring: setup frame structure for v2/v3 in a generic wayDaniel Borkmann8-18/+30
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>
2013-05-31ring: move duplicate/generic code parts from rx/tx into ring.cDaniel Borkmann7-72/+85
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>
2013-05-31ring: fix wrong error message text in __get_sockopt_tpacketDaniel Borkmann1-1/+1
Arg, this was a leftover when copying the other function. So fix it! Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-31ring: implement setup of tpacket v3 ringDaniel Borkmann3-3/+30
Implement ring setup routines and structures for TPACKET_V3. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-31man: ifpps: Mention CPU limit in first section and remove BUGS sectionTobias Klauser1-7/+2
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>
2013-05-30ring: setup_{rx,tx}_ring_layout: use bool for jumbo_supportDaniel Borkmann4-4/+4
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>
2013-05-30ring: prepare setup_rx_ring_layout for support in v2/v3Daniel Borkmann6-11/+28
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>
2013-05-30ring: add necessary structures and helper functions for v3Daniel Borkmann2-1/+15
Prepare and add some structures an helper functions for TPACKET_V3. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-30ring: move poll related fallback define to built_in.hDaniel Borkmann2-10/+12
It rather belongs to built_in.h, and not here. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-30ring: minor: remove define since only used onceDaniel Borkmann1-3/+1
We only use it once and nowhere else, so just replace the correct value right away. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-30ring: add set_sockopt_tpacket_v3 and refactor othersDaniel Borkmann1-4/+12
Add set_sockopt_tpacket_v3() in preparation for TPACKET_V3. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-30Merge branch 'master' of github.com:borkmann/netsniff-ngDaniel Borkmann3-18/+30
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>
2013-05-30man: manpage hyphen fixes, take threeKartik Mistry1-7/+7
More hyphen fixes all over. Signed-off-by: Kartik Mistry <kartik@debian.org> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-30man: manpage hyphen fixes, take twoKartik Mistry3-108/+109
Fix hyphens all over. Signed-off-by: Kartik Mistry <kartik@debian.org> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-30ifpps: Allow to select number of top hitter CPUs by command line optionTobias Klauser2-15/+28
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>
2013-05-30netsniff-ng: Add __maybe_unused attribute to timer functionsTobias Klauser1-3/+2
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>
2013-05-30ring: set_sockopt_tpacket: rename to set_sockopt_tpacket_v2Daniel Borkmann3-3/+3
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>
2013-05-30ifpps: Allocate cpu dependent stats in one placeTobias Klauser1-15/+9
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>
2013-05-30ring: remove fanout related bitsDaniel Borkmann1-20/+0
We currently do not support it, so do not keep it here. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-30man: manpages hyphen and spelling mistakesKartik Mistry7-48/+48
Some fixes all over, part 1. Signed-off-by: Kartik Mistry <kartik@debian.org> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-30misc: Fixed spelling mistakesKartik Mistry3-6/+6
Fix for spelling mistakes detected by Lintian. Signed-off-by: Kartik Mistry <kartik@debian.org> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-29conf: oui: run oui-update.py script over config fileDaniel Borkmann1-175/+519
Update oui entries. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-29docs: minor: fix whitespacing in copying fileDaniel Borkmann1-2/+2
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-29docs: move sponsor names into authorsDaniel Borkmann2-14/+7
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>
2013-05-29make: add DISTRO=1 for compilation on distributionsDaniel Borkmann1-6/+9
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>
2013-05-29make: allow to append CFLAGS in addition to overwriteDaniel Borkmann1-19/+14
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>
2013-05-29ifpps: fix segfault in terminal modeDaniel Borkmann1-0/+7
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>
2013-05-29ifpps: Properly zero out allocated statsTobias Klauser1-1/+1
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>
2013-05-29ifpps: support mq devices in /proc/interruptsDaniel Borkmann1-2/+7
/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>
2013-05-29ifpps: also show total number of cpusDaniel Borkmann1-2/+2
Just a minor change to also show the total number of cpus in the headline. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-29ifpps: remove unused function snr_to_strDaniel Borkmann1-16/+0
It's not used anywhere anymore, so remove it. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-27ifpps: Use strtoul() to convert unsigned valueTobias Klauser1-1/+1
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>