- 29 Nov, 2015 16 commits
-
-
Stephen Hemminger authored
-
Tom Herbert authored
This patch adds support to remote checksum checksum offload to VXLAN. This patch adds remcsumtx and remcsumrx to ip vxlan configuration to enable remote checksum offload for transmit and receive on the VXLAN tunnel. https://tools.ietf.org/html/draft-herbert-vxlan-rco-00 Example: ip link add name vxlan0 type vxlan id 42 group 239.1.1.1 dev eth0 \ udpcsum remcsumtx remcsumrx Testing: Ran single netperf over mlnx4 to illustrate the effest: - Without RCO (UDP csum set to zero) 4335.99 Mbps - With RCO enabled 7661.81 Mbps Signed-off-by: Tom Herbert <tom@herbertland.com>
-
Phil Sutter authored
fgets() will read at most size-1 bytes into the buffer and add a terminating null-char at the end. Therefore it is not necessary to pass a reduced buffer size when calling it. This change was generated using the following semantic patch: @@ identifier buf, fp; @@ - fgets(buf, sizeof(buf) - 1, fp) + fgets(buf, sizeof(buf), fp) Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
Although not fundamentally necessary to check return codes in these spots, preventing the warnings will put new ones into focus. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
No need to keep static port boundaries global, they are not used directly. Keeping them local also allows to safely reduce their names to the minimum. Assign hardcoded fallback values also if fscanf() fails. Get rid of unnecessary braces around return parameter. Instead of more or less duplicating is_ephemeral() in run_ssfilter(), simply call the function instead. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
Exit early or continue on error instead of putting conditional into conditional to make reading the code a bit easier. Also, the call to memcpy() can be skipped by initialising prog with the desired prefix. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
Instead of calling rewind() and fgets() before every call to scan_lines(), move them into scan_lines() itself. This should also fix compat mode, as before the second call to scan_lines() the first line was skipped unconditionally. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
- Replace commas at end of subsection with dots. - Replace double whitespace by single one. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
Technically, the range of possible hoplimit values are defined by IPv4 and IPv6 header formats. Both define the field to be eight bits in size, which leads to a value range of [0;255]. Setting a packet's hoplimit field to 0 though makes not much sense, as the next hop would immediately drop the packet. Therefore Linux uses 0 as a special value indicating to use the system's default hoplimit (configurable via sysctl). In iproute, setting the hoplimit of a route to 0 is equivalent to omitting the hoplimit parameter alltogether, so it is actually not necessary to allow that value to be specified, but keep it anyway for backwards compatibility. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
Since it uses only a single filter, rtnl_dump_filter() can be used. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
Right after ipaddr_reset_filter(), filter.family is always AF_UNSPEC. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
Linux version 3.1 introduced a consistency check for netlink dumps in commit 670dc28 ("netlink: advertise incomplete dumps"). This bites iproute2 when flushing more addresses than can fit into a single RTM_GETADDR response. To silence the spurious error message "Dump was interrupted and may be inconsistent.", advise rtnl_dump_filter_l() to not care about NLM_F_DUMP_INTR. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
Allow for a filter to ignore certain nlmsg_flags. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
Since it's no longer relevant whether an IP address is primary or secondary when flushing, ipaddr_flush() can be simplified a bit. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Stephen Hemminger authored
Cleanup all checkpatch complaints about whitespace in rt_names.
-
David Ahern authored
Add support for reading table id/name mappings from rt_tables.d directory. Suggested-by: Roopa Prabhu <roopa@cumulusnetworks.com> Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
-
- 24 Nov, 2015 3 commits
-
-
John W. Linville authored
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-
John W. Linville authored
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-
Daniel Borkmann authored
This larger work addresses one of the bigger remaining issues on tc's eBPF frontend, that is, to allow for persistent file descriptors. Whenever tc parses the ELF object, extracts and loads maps into the kernel, these file descriptors will be out of reach after the tc instance exits. Meaning, for simple (unnested) programs which contain one or multiple maps, the kernel holds a reference, and they will live on inside the kernel until the program holding them is unloaded, but they will be out of reach for user space, even worse with (also multiple nested) tail calls. For this issue, we introduced the concept of an agent that can receive the set of file descriptors from the tc instance creating them, in order to be able to further inspect/update map data for a specific use case. However, while that is more tied towards specific applications, it still doesn't easily allow for sharing maps accross multiple tc instances and would require a daemon to be running in the background. F.e. when a map should be shared by two eBPF programs, one attached to ingress, one to egress, this currently doesn't work with the tc frontend. This work solves exactly that, i.e. if requested, maps can now be _arbitrarily_ shared between object files (PIN_GLOBAL_NS) or within a single object (but various program sections, PIN_OBJECT_NS) without "loosing" the file descriptor set. To make that happen, we use eBPF object pinning introduced in kernel commit b2197755b263 ("bpf: add support for persistent maps/progs") for exactly this purpose. The shipped examples/bpf/bpf_shared.c code from this patch can be easily applied, for instance, as: - classifier-classifier shared: tc filter add dev foo parent 1: bpf obj shared.o sec egress tc filter add dev foo parent ffff: bpf obj shared.o sec ingress - classifier-action shared (here: late binding to a dummy classifier): tc actions add action bpf obj shared.o sec egress pass index 42 tc filter add dev foo parent ffff: bpf obj shared.o sec ingress tc filter add dev foo parent 1: bpf bytecode '1,6 0 0 4294967295,' \ action bpf index 42 The toy example increments a shared counter on egress and dumps its value on ingress (if no sharing (PIN_NONE) would have been chosen, map value is 0, of course, due to the two map instances being created): [...] <idle>-0 [002] ..s. 38264.788234: : map val: 4 <idle>-0 [002] ..s. 38264.788919: : map val: 4 <idle>-0 [002] ..s. 38264.789599: : map val: 5 [...] ... thus if both sections reference the pinned map(s) in question, tc will take care of fetching the appropriate file descriptor. The patch has been tested extensively on both, classifier and action sides. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
-
- 23 Nov, 2015 21 commits
-
-
Neil Horman authored
I found recently that, if I disabled address promotion in the kernel, that ip addr flush dev <dev> would fail with an EADDRNOTAVAIL errno (though the flush operation would in fact flush all addresses from an interface properly) Whats happening is that, if I add a primary and multiple secondary addresses to an interface, the flush operation first ennumerates them all with a GETADDR | DUMP operation, then sends a delete request for each address. But the kernel, having promotion disabled, deletes all secondary addresses when the primary is removed. That means, that several delete requests may still be pending in the netlink request for addresses that have been removed on our behalf, resulting in EADDRNOTAVAIL return codes. It seems the simplest thing to do is to understand that EADDRUNAVAIL isn't a fatal outcome on a flush operation, as it just indicates that an address which you want to remove is already removed, so it can safely be ignored. Signed-off-by: Neil Horman <nhorman@tuxdriver.com> CC: Stephen Hemminger <stephen@networkplumber.org> CC: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
-
Phil Sutter authored
Despite commit 45a82e5 ("iproute vxlan add support for fdb replace command"), the 'fdb replace' command was not mentioned in bridge.8. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
The algorithm depends on the loop counter ('i') to increment by one in each iteration. Though if running endlessly (count==0), the counter was not incremented at all. Also change formatting of the header printing conditional a bit so it's hopefully easier to read. Fixes: e7e2913f ("lnstat: run indefinitely by default") Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Stephen Hemminger authored
Post merge window changes
-
Phil Sutter authored
- Drop 'extern' keyword from all function prototypes. - Make line breaking of print_* functions consistent. - Make print_ntable() and ipntable_reset_filter() static and remove their declaration. - Drop declaration of non-existent ipaddr_list() and iproute_monitor(). Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Stephen Hemminger authored
-
Stephen Hemminger authored
Remove extraneous whitespace
-
Ville Skyttä authored
Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
-
Ville Skyttä authored
Fix syntax issues and warnings highlighted by `man --warnings=w' from man-db 2.7.1. Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
-
Phil Sutter authored
Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
Since p->name is only IFNAMSIZ bytes, do not copy more than IFNAMSIZ - 1 bytes into it so there remains at least a single null byte in the end. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
Instead of parsing an unsigned integer and checking boundaries, simply parse u8. This and the added ttl alias 'hlim' provide consistency with ip6tunnel. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
This makes output consistent with iptunnel, also supporting reverse DNS lookup for remote address if requested. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
In iptunnel, declare loop variables inside the loop as done in ip6tunnel. Fix and simplify goto logic in ip6tunnel: - Failure to read over header lines would have left fp opened. - By returning directly upon fopen() failure, fp can be closed unconditionally in the end. Use the same goto logic in iptunnel, as well. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
Although the cache is only initialized in do_show(), this way it is at least consistent with ip6tunnel. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
Make ip6tunnel print an error message as well. While there, get rid of unnecessary line breaking. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
Instead of duplicating the same code six times (key, ikey and okey in iptunnel and ip6tunnel), have a common parsing routine. This has the added benefit of having the same verbose error message in ip6tunnel as well as iptunnel. I'm not sure if parsing an IPv4 address as key makes sense for ip6tunnel, but the code was there before so this patch at least doesn't make it worse. Signed-off-by: Phil Sutter <phil@nwl.cc>
-