]> git.ipfire.org Git - thirdparty/iproute2.git/log
thirdparty/iproute2.git
9 years agodevlink: allow to parse both devlink and port handle in the same time
Jiri Pirko [Fri, 15 Apr 2016 07:51:50 +0000 (09:51 +0200)] 
devlink: allow to parse both devlink and port handle in the same time

For filtering purposes, it makes sense for used to either specify
devlink handle of port handle.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
9 years agodevlink: introduce dump filtering function
Jiri Pirko [Fri, 15 Apr 2016 07:51:49 +0000 (09:51 +0200)] 
devlink: introduce dump filtering function

This function is to be used from dump callbacks to decide if the output
currect output should be filtered off or not. Filtering is based on
previously parsed and stored command line options.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
9 years agodevlink: split dl_argv_parse_put to parse and put parts
Jiri Pirko [Fri, 15 Apr 2016 07:51:48 +0000 (09:51 +0200)] 
devlink: split dl_argv_parse_put to parse and put parts

It is handy to have parsed cmdline data stored so they can be used for
dumps filtering. So split original dl_argv_parse_put into parse and put
parts.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
9 years agodevlink: introduce helper to print out nice names (ifnames)
Jiri Pirko [Fri, 15 Apr 2016 07:51:47 +0000 (09:51 +0200)] 
devlink: introduce helper to print out nice names (ifnames)

By default, ifnames will be printed out. User can turn that off using
"-n" option on the command line.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
9 years agodevlink: introduce pr_out_port_handle helper
Jiri Pirko [Fri, 15 Apr 2016 07:51:46 +0000 (09:51 +0200)] 
devlink: introduce pr_out_port_handle helper

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
9 years agolist: add list_add_tail helper
Jiri Pirko [Fri, 15 Apr 2016 07:51:45 +0000 (09:51 +0200)] 
list: add list_add_tail helper

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
9 years agolist: add list_for_each_entry_reverse macro
Jiri Pirko [Fri, 15 Apr 2016 07:51:44 +0000 (09:51 +0200)] 
list: add list_for_each_entry_reverse macro

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
9 years agodevlink: fix "devlink port" help message
Jiri Pirko [Fri, 15 Apr 2016 07:51:43 +0000 (09:51 +0200)] 
devlink: fix "devlink port" help message

"dl" -> "devlink"

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
9 years agoss: take care of unknown min_rtt
Eric Dumazet [Wed, 13 Apr 2016 22:18:38 +0000 (15:18 -0700)] 
ss: take care of unknown min_rtt

Kernel sets info->tcpi_min_rtt to ~0U when no RTT sample was ever
taken for the session, thus min_rtt is unknown.

Signed-off-by: Eric Dumazet <edumazet@google.com>
9 years agoss: Fix accidental state filter override
Phil Sutter [Wed, 13 Apr 2016 20:07:05 +0000 (22:07 +0200)] 
ss: Fix accidental state filter override

Passing a filter expression and selecting an address family using the
'-f' flag would overwrite the state filter by accident. Therefore
calling e.g. 'ss -nl -f inet '(sport = :22)' would not only print
listening sockets (as requested by '-l' flag) but connected ones, as
well.

Fix this by reusing the formerly ineffective call to filter_states_set()
to restore the state filter as it was before the call to
filter_af_set().

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoss: Drop silly assignment
Phil Sutter [Wed, 13 Apr 2016 20:07:04 +0000 (22:07 +0200)] 
ss: Drop silly assignment

An expression of the form '(a | b) & b' will evaluate to the value of b
for any value of a or b.

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoip: neigh: Fix leftover attributes message during flush
Jeff Harris [Thu, 14 Apr 2016 18:15:03 +0000 (14:15 -0400)] 
ip: neigh: Fix leftover attributes message during flush

Use the same rtnl_dump_request_n call as the show.  The rtnl_wilddump_request
assumes the type uses an ifinfomsg which is not the case for the neighbor
table.

Signed-off-by: Jeff Harris <jefftharris@gmail.com>
Acked-by: David Ahern <dsa@cumulusnetworks.com>
9 years agoip: whitespace cleanup
Stephen Hemminger [Mon, 11 Apr 2016 22:13:55 +0000 (22:13 +0000)] 
ip: whitespace cleanup

Fix whitespace

9 years agoip-link: Support printing VF trust setting
Phil Sutter [Thu, 31 Mar 2016 12:43:32 +0000 (14:43 +0200)] 
ip-link: Support printing VF trust setting

This adds a new item to VF lines of a PF, stating whether the VF is
trusted or not.

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoiproute2: tc_bpf.c: fix building with musl libc
Gustavo Zacarias [Fri, 8 Apr 2016 12:59:33 +0000 (09:59 -0300)] 
iproute2: tc_bpf.c: fix building with musl libc

We need limits.h for PATH_MAX, fixes:

tc_bpf.c: In function ‘bpf_map_selfcheck_pinned’:
tc_bpf.c:222:12: error: ‘PATH_MAX’ undeclared (first use in this
function)
  char file[PATH_MAX], buff[4096];

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
9 years agoip: only display phys attributes with details option
Stephen Hemminger [Mon, 11 Apr 2016 22:07:51 +0000 (22:07 +0000)] 
ip: only display phys attributes with details option

Since output of ip commands are already cluttered, move the physical port details
under a show_details option.

9 years agoiplink: display IFLA_PHYS_PORT_NAME
Nicolas Dichtel [Fri, 1 Apr 2016 14:22:01 +0000 (16:22 +0200)] 
iplink: display IFLA_PHYS_PORT_NAME

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
9 years agotc, bpf: add support for map pre/allocation
Daniel Borkmann [Fri, 8 Apr 2016 22:32:05 +0000 (00:32 +0200)] 
tc, bpf: add support for map pre/allocation

Follow-up to kernel commit 6c9059817432 ("bpf: pre-allocate hash map
elements"). Add flags support, so that we can pass in BPF_F_NO_PREALLOC
flag for disallowing preallocation. Update examples accordingly and also
remove the BPF_* map helper macros from them as they were not very useful.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
9 years agotc, bpf: further improve error reporting
Daniel Borkmann [Fri, 8 Apr 2016 22:32:04 +0000 (00:32 +0200)] 
tc, bpf: further improve error reporting

Make it easier to spot issues when loading the object file fails. This
includes reporting in what pinned object specs differ, better indication
when we've reached instruction limits. Don't retry to load a non relo
program once we failed with bpf(2), and report out of bounds tail call key.

Also, add truncation of huge log outputs by default. Sometimes errors are
quite easy to spot by only looking at the tail of the verifier log, but
logs can get huge in size e.g. up to few MB (due to verifier checking all
possible program paths). Thus, by default limit output to the last 4096
bytes and indicate that it's truncated. For the full log, the verbose option
can be used.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
9 years agotc, bpf: add new csum and tunnel signatures
Daniel Borkmann [Fri, 8 Apr 2016 22:32:03 +0000 (00:32 +0200)] 
tc, bpf: add new csum and tunnel signatures

Add new signatures for BPF_FUNC_csum_diff, BPF_FUNC_skb_get_tunnel_opt
and BPF_FUNC_skb_set_tunnel_opt.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
9 years agobridge: vlan: add support to filter by vlan id
Nikolay Aleksandrov [Mon, 11 Apr 2016 15:45:16 +0000 (17:45 +0200)] 
bridge: vlan: add support to filter by vlan id

Add the optional keyword "vid" to bridge vlan show so the user can
request filtering by a specific vlan id. Currently the filtering is
implemented only in user-space. The argument name has been chosen to
match the add/del one - "vid". This filtering can be used also with the
"-compressvlans" option to see in which range is a vlan (if in any).
Also this will be used to show only specific per-vlan statistics later
when support is added to the kernel for it.

Examples:
$ bridge vlan show vid 450
port vlan ids
eth2  450

$ bridge -c vlan show vid 450
port vlan ids
eth2  400-500

$ bridge vlan show vid 1
port vlan ids
eth1  1 PVID Egress Untagged
eth2  1 PVID
br0  1 PVID Egress Untagged

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
9 years agobridge: mdb: add support to filter by vlan id
Nikolay Aleksandrov [Mon, 11 Apr 2016 15:45:15 +0000 (17:45 +0200)] 
bridge: mdb: add support to filter by vlan id

Add the optional keyword "vid" to bridge mdb show so the user can
request filtering by a specific vlan id. Currently the filtering is
implemented only in user-space. The argument name has been chosen to match
the add/del one - "vid".

Example:
$ bridge mdb show vid 200
dev br0 port eth2 grp 239.0.0.1 permanent vid 200

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
9 years agobridge: fdb: add support to filter by vlan id
Nikolay Aleksandrov [Mon, 11 Apr 2016 15:45:14 +0000 (17:45 +0200)] 
bridge: fdb: add support to filter by vlan id

Add the optional keyword "vlan" to bridge fdb show so the user can request
filtering by a specific vlan id. Currently the filtering is implemented
only in user-space. The argument name has been chosen to match the
add/del one - "vlan".

Example:
$ bridge fdb show vlan 400
52:54:00:bf:57:16 dev eth2 vlan 400 master br0 permanent

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
9 years agoiplink: display number of rx/tx queues
Eric Dumazet [Thu, 7 Apr 2016 23:11:39 +0000 (16:11 -0700)] 
iplink: display number of rx/tx queues

We can set the attributes, so would be nice to display them when
provided by the kernel.

Signed-off-by: Eric Dumazet <edumazet@google.com>
9 years agoupdate kernel headers
Stephen Hemminger [Mon, 11 Apr 2016 20:40:40 +0000 (13:40 -0700)] 
update kernel headers

Update from 4.6-rc3

9 years agodevlink: ignore build result
Stephen Hemminger [Mon, 11 Apr 2016 20:32:22 +0000 (13:32 -0700)] 
devlink: ignore build result

devlink binary is built

9 years agogeneve: add support to set flow label
Daniel Borkmann [Thu, 24 Mar 2016 15:49:56 +0000 (16:49 +0100)] 
geneve: add support to set flow label

Follow-up for kernel commit 8eb3b99554b8 ("geneve: support setting
IPv6 flow label") to allow setting the label for the device config.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
9 years agovxlan: add support to set flow label
Daniel Borkmann [Thu, 24 Mar 2016 15:49:55 +0000 (16:49 +0100)] 
vxlan: add support to set flow label

Follow-up for kernel commit e7f70af111f0 ("vxlan: support setting
IPv6 flow label") to allow setting the label for the device config.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
9 years agoadd devlink tool
Jiri Pirko [Tue, 22 Mar 2016 09:02:21 +0000 (10:02 +0100)] 
add devlink tool

Add new tool called devlink which is userspace counterpart of devlink
Netlink socket.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
9 years agoinclude: add linked list implementation from kernel
Jiri Pirko [Tue, 22 Mar 2016 09:02:20 +0000 (10:02 +0100)] 
include: add linked list implementation from kernel

Rename hlist.h to list.h while adding it to be aligned with kernel

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
9 years agogeneve: Add support for configuring UDP checksums.
Jesse Gross [Sat, 19 Mar 2016 00:51:09 +0000 (17:51 -0700)] 
geneve: Add support for configuring UDP checksums.

Enable support for configuring outer UDP checksums on Geneve tunnels:

ip link add type geneve id 10 remote 10.0.0.2 udpcsum

Signed-off-by: Jesse Gross <jesse@kernel.org>
9 years agovxlan: Follow kernel defaults for outer UDP checksum.
Jesse Gross [Sat, 19 Mar 2016 00:51:08 +0000 (17:51 -0700)] 
vxlan: Follow kernel defaults for outer UDP checksum.

On recent kernels, UDP checksum computation has become more efficient and
the default behavior was changed, however, the ip command overrides this
by always specifying a particular behavior.

If the user does not specify that UDP checksums should either be computed
or not then we don't need to send an explicit netlink message - the kernel
can just use its default behavior.

Signed-off-by: Jesse Gross <jesse@kernel.org>
9 years agoscrub out whitespace issues
Stephen Hemminger [Sun, 27 Mar 2016 17:47:46 +0000 (10:47 -0700)] 
scrub out whitespace issues

Run script that removes trailing whitespace everywhere.

9 years agofix get_addr() and get_prefix() error messages
Marco Varlese [Sun, 27 Mar 2016 17:45:51 +0000 (10:45 -0700)] 
fix get_addr() and get_prefix() error messages

An attempt to add invalid address to interface would print "???" string
instead of the address family name.

For example:
$ ip address add 256.10.166.1/24 dev ens8
Error: ??? prefix is expected rather than "256.10.166.1/24".

$ ip neighbor add proxy 2001:db8::g dev ens8
Error: ??? address is expected rather than "2001:db8::g".

With this patch the output will look like:
$ ip address add 256.10.166.1/24 dev ens8
Error: inet prefix is expected rather than "256.10.166.1/24".

$ ip neighbor add proxy 2001:db8::g dev ens8
Error: inet6 address is expected rather than "2001:db8::g".

Signed-off-by: Przemyslaw Szczerbik <przemyslawx.szczerbik@intel.com>
Signed-off-by: Marco Varlese <marco.varlese@intel.com>
9 years agolib/ll_addr: improve ll_addr_n2a() a bit
Phil Sutter [Tue, 22 Mar 2016 18:35:19 +0000 (19:35 +0100)] 
lib/ll_addr: improve ll_addr_n2a() a bit

Apart from making the code a bit more compact and efficient, this also
prevents a potential buffer overflow if the passed buffer is really too
small: Although correctly decrementing the size parameter passed to
snprintf, it could become negative which would then wrap since snprintf
uses (unsigned) size_t for the parameter.

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agolib/utils: introduce rt_addr_n2a_rta()
Phil Sutter [Tue, 22 Mar 2016 18:35:18 +0000 (19:35 +0100)] 
lib/utils: introduce rt_addr_n2a_rta()

This simple macro eases calling rt_addr_n2a() with data from an rt_attr
pointer.

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agolib/utils: introduce format_host_rta()
Phil Sutter [Tue, 22 Mar 2016 18:35:17 +0000 (19:35 +0100)] 
lib/utils: introduce format_host_rta()

This simple macro eases calling format_host() with data from an rt_attr
pointer.

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoutils: make rt_addr_n2a() non-reentrant by default
Phil Sutter [Tue, 22 Mar 2016 18:35:16 +0000 (19:35 +0100)] 
utils: make rt_addr_n2a() non-reentrant by default

There is only a single user who needs it to be reentrant (not really,
but it's safer like this), add rt_addr_n2a_r() for it to use.

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agomake format_host non-reentrant by default
Phil Sutter [Tue, 22 Mar 2016 18:35:15 +0000 (19:35 +0100)] 
make format_host non-reentrant by default

There are only three users which require it to be reentrant, the rest is
fine without. Instead, provide a reentrant format_host_r() for users
which need it.

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoipaddress: colorize peer, broadcast and anycast addresses as well
Phil Sutter [Tue, 22 Mar 2016 18:35:14 +0000 (19:35 +0100)] 
ipaddress: colorize peer, broadcast and anycast addresses as well

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agocolor: introduce color helpers and COLOR_CLEAR
Phil Sutter [Tue, 22 Mar 2016 18:35:13 +0000 (19:35 +0100)] 
color: introduce color helpers and COLOR_CLEAR

This adds two helper functions which map a given data field to a color,
so color_fprintf() statements don't have to be duplicated with only a
different color value depending on that data field's value. In order for
this to work in a generic way, COLOR_CLEAR has been added to serve as a
fallback default of uncolored output.

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoman: tc-vlan.8: Describe CONTROL option
Phil Sutter [Tue, 22 Mar 2016 14:48:39 +0000 (15:48 +0100)] 
man: tc-vlan.8: Describe CONTROL option

This should be made generic and part of a common tc-actions man page.
Though leave it here for now to not confuse readers of the example which
uses it.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 years agotc/m_vlan.c: mention CONTROL option in help text
Phil Sutter [Tue, 22 Mar 2016 14:48:38 +0000 (15:48 +0100)] 
tc/m_vlan.c: mention CONTROL option in help text

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 years agoman: tc-skbedit.8: Elaborate a bit on TX queues
Phil Sutter [Tue, 22 Mar 2016 14:48:37 +0000 (15:48 +0100)] 
man: tc-skbedit.8: Elaborate a bit on TX queues

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 years agoman: tc-police.8: Emphasize on the two rate control mechanisms
Phil Sutter [Tue, 22 Mar 2016 14:48:36 +0000 (15:48 +0100)] 
man: tc-police.8: Emphasize on the two rate control mechanisms

As Jamal pointed out, there are two different approaches to bandwidth
measurement. Try to make this clear by separating them in synopsis and
also documenting the way to fine-tune avrate.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 years agoman: tc-mirred.8: Reword man page a bit, add generic mirror example
Phil Sutter [Tue, 22 Mar 2016 14:48:35 +0000 (15:48 +0100)] 
man: tc-mirred.8: Reword man page a bit, add generic mirror example

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 years agoman: tc-csum.8: Add an example
Phil Sutter [Tue, 22 Mar 2016 14:48:34 +0000 (15:48 +0100)] 
man: tc-csum.8: Add an example

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 years agotc: connmark, pedit: Rename BRANCH to CONTROL
Phil Sutter [Tue, 22 Mar 2016 14:48:33 +0000 (15:48 +0100)] 
tc: connmark, pedit: Rename BRANCH to CONTROL

As Jamal suggested, BRANCH is the wrong name, as these keywords go
beyond simple branch control - e.g. loops are possible, too. Therefore
rename the non-terminal to CONTROL instead which should be more
appropriate.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 years agodoc/tc-filters.tex: Drop overly subjective paragraphs
Phil Sutter [Tue, 22 Mar 2016 14:48:32 +0000 (15:48 +0100)] 
doc/tc-filters.tex: Drop overly subjective paragraphs

Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 years agotestsuite: add a test for tc pedit action
Phil Sutter [Tue, 22 Mar 2016 14:16:24 +0000 (15:16 +0100)] 
testsuite: add a test for tc pedit action

This is not a full test, since kernel functionality is not actually
tested. It only compares that the kernel returned values when listing
the action are what one expects them to be.

Since this test succeeded on both a little-endian and a big-endian
system, it shows that any endianness issues have been resolved in
tc/p_ip.c at least.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 years agotc: pedit: Fix raw op
Phil Sutter [Tue, 22 Mar 2016 14:16:23 +0000 (15:16 +0100)] 
tc: pedit: Fix raw op

The retain value was wrong for u16 and u8 types.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 years agotc: pedit: Fix for big-endian systems
Phil Sutter [Tue, 22 Mar 2016 14:16:22 +0000 (15:16 +0100)] 
tc: pedit: Fix for big-endian systems

This was tricky to get right:
- The 'stride' value used for 8 and 16 bit values must behave inverse to
  the value's intra word offset to work correctly with big-endian data
  act_pedit is editing.
- The 'm' array's values are in host byte order, so they have to be
  converted as well (and the ordering was just inverse, for some
  reason).
- The only sane way of getting this right is to manipulate value/mask in
  host byte order and convert the output.
- TIPV4 (i.e. 'munge ip src/dst') had it's own pitfall: the address
  parser converts to network byte order automatically. This patch fixes
  this by converting it back before calling pack_key32, which is a hack
  but at least does not require to implement a completely separate code
  flow.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 years agotc/p_ip.c: Minor coding style cleanup
Phil Sutter [Tue, 22 Mar 2016 14:16:21 +0000 (15:16 +0100)] 
tc/p_ip.c: Minor coding style cleanup

Break overlong function definitions and remove one extraneous
whitespace.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 years agonetconf: add support for ignore route attribute
Zhang Shengju [Mon, 21 Mar 2016 19:16:25 +0000 (12:16 -0700)] 
netconf: add support for ignore route attribute

Add support for ignore route attribute, and refine the code to use
rta_getattr_* function to get attribute value.

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
9 years agoman: update netconf manual for new attributes
Zhang Shengju [Tue, 15 Mar 2016 02:32:12 +0000 (02:32 +0000)] 
man: update netconf manual for new attributes

Update this manual to add attributes proxy_neigh and
ignore_routes_with_linkdown.

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
9 years agonetconf: replace macro with a function
Stephen Hemminger [Mon, 21 Mar 2016 19:13:57 +0000 (12:13 -0700)] 
netconf: replace macro with a function

The number of casts in macro was excessive.

9 years agoupdate kernel headers to 4.6 (pre rc1)
Stephen Hemminger [Mon, 21 Mar 2016 19:02:32 +0000 (12:02 -0700)] 
update kernel headers to 4.6 (pre rc1)

9 years agomisc: fix style issues
Stephen Hemminger [Mon, 21 Mar 2016 18:56:36 +0000 (11:56 -0700)] 
misc: fix style issues

More checkpatch spring cleaning

9 years agobridge: code cleanup
Stephen Hemminger [Mon, 21 Mar 2016 18:56:01 +0000 (11:56 -0700)] 
bridge: code cleanup

Use checkpatch auto fix to cleanup lingering style issues

9 years agoip: code cleanup
Stephen Hemminger [Mon, 21 Mar 2016 18:52:19 +0000 (11:52 -0700)] 
ip: code cleanup

Run all the ip code through checkpatch and have it fix the obvious stuff.

9 years agotc: code cleanup
Stephen Hemminger [Mon, 21 Mar 2016 18:48:36 +0000 (11:48 -0700)] 
tc: code cleanup

Use checkpatch to fix whitespace and other style issues.

9 years agotc: q_{codel,fq_codel}: add missing space in help text
Luca Lemmo [Wed, 16 Mar 2016 16:56:14 +0000 (17:56 +0100)] 
tc: q_{codel,fq_codel}: add missing space in help text

Signed-off-by: Luca Lemmo <luca@linux.com>
9 years agotc: f_u32: trivial coding style cleanups
Luca Lemmo [Wed, 16 Mar 2016 16:56:13 +0000 (17:56 +0100)] 
tc: f_u32: trivial coding style cleanups

Signed-off-by: Luca Lemmo <luca@linux.com>
9 years agotc: f_u32: add missing spaces around operators
Luca Lemmo [Wed, 16 Mar 2016 16:56:12 +0000 (17:56 +0100)] 
tc: f_u32: add missing spaces around operators

Signed-off-by: Luca Lemmo <luca@linux.com>
9 years agobridge: mdb: add support for extended router port information
Nikolay Aleksandrov [Mon, 14 Mar 2016 10:04:46 +0000 (11:04 +0100)] 
bridge: mdb: add support for extended router port information

Recently a new temp router port mode was added and with it the dumped
information was extended similar to how mdb entries were done. This
patch adds support to dump the new information by using the "-s" switch.
Example:
$ bridge -d -s mdb show
dev br0 port eth1 grp ff02::1:ffbf:5716 temp 234.39
dev br0 port eth1 grp 239.0.0.2 temp  97.17
dev br0 port eth1 grp 239.0.0.3 temp 105.36
router ports on br0: eth1    0.00 permanent
router ports on br0: eth2  254.87 temp

It also updates the bridge man page.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
9 years agoMerge branch 'master' into net-next
Stephen Hemminger [Mon, 14 Mar 2016 23:05:00 +0000 (16:05 -0700)] 
Merge branch 'master' into net-next

9 years agov4.5.0 v4.5.0
Stephen Hemminger [Mon, 14 Mar 2016 23:02:31 +0000 (16:02 -0700)] 
v4.5.0

9 years agoMerge branch 'master' into net-next
Stephen Hemminger [Sun, 6 Mar 2016 20:56:23 +0000 (12:56 -0800)] 
Merge branch 'master' into net-next

9 years agotc: pedit: Fix retain value for ihl adjustments
Phil Sutter [Wed, 2 Mar 2016 11:20:31 +0000 (12:20 +0100)] 
tc: pedit: Fix retain value for ihl adjustments

Since the IP Header Length field is just half a byte, adjust retain to
only match these bits so the Version field is not overwritten by
accident.

The whole concept is actually broken due to dependency on endianness
which pedit ignores.

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agotc: pedit: Fix parse_cmd()
Phil Sutter [Wed, 2 Mar 2016 11:20:30 +0000 (12:20 +0100)] 
tc: pedit: Fix parse_cmd()

This was horribly broken:
* pack_key8() and pack_key16() ...
  * missed to invert retain value when applying it to the mask,
  * did not sanitize val by ANDing it with retain,
  * and ignored the mask which is necessary for 'invert' command.
* pack_key16() did not convert mask to network byte order.
* Changing the retain value for 'invert' or 'retain' operation seems
  just plain wrong.
* While here, also got rid of unnecessary offset sanitization in
  pack_key32().
* Simplify code a bit by always assigning the local mask variable to
  tkey->mask before calling any of the pack_key*() variants.

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agotc: pedit: Fix layered op parsing
Phil Sutter [Wed, 2 Mar 2016 11:20:29 +0000 (12:20 +0100)] 
tc: pedit: Fix layered op parsing

After lookup of the layered op submodule, pedit would pass argv and argc
including the layered op identifier at first position which confused the
submodule parser. Fix this by calling NEXT_ARG() before calling the
parse_peopt() callback.

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agolibnetlink: Double the dump buffer size
Phil Sutter [Fri, 4 Mar 2016 18:57:28 +0000 (19:57 +0100)] 
libnetlink: Double the dump buffer size

There have been reports about 'ip addr' printing "Message truncated" on
systems with large numbers of VFs. Although I haven't been able to get
my hands on hardware suitable to reproduce this, increasing the dump
buffer has been reported to resolve the issue. For want of a better
idea, just double the buffer size to 32k.

Feels like this opportunistic buffer size selection is rather
workarounding a design flaw in libnetlink or maybe even the netlink
protocol itself.

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoifstat, nstat: fix daemon mode
Phil Sutter [Wed, 2 Mar 2016 15:56:27 +0000 (16:56 +0100)] 
ifstat, nstat: fix daemon mode

Since the relevant code (and it's bugs) is identical in both files, fix
them in one go. This patch fixes multiple issues:

* Using 'int' for the 'tdiff' variable does not suffice on 64bit
  systems, the assigned initial time difference makes it wrap and
  contain a negative value afterwards. Instead use the more appropriate
  'time_t' type.

* As far as I understood the code, poll() is supposed to time out just
  at the right time to trigger update_db() in the configured interval.
  Therefore it's timeout must be set to the desired interval *minus* the
  time that has already passed since then.

* With the last change to the algorithm in place, it does not make sense
  to call update_db() before returning data to the connected client.
  Actually, it never does otherwise we could skip the periodic updates
  in the first place.

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agobridge: mdb: add support for offloaded mdb entries
Elad Raz [Sun, 6 Mar 2016 20:46:04 +0000 (12:46 -0800)] 
bridge: mdb: add support for offloaded mdb entries

Mark MDB entries which are offloaded to HW with "offload" flag

Signed-off-by: Elad Raz <eladr@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
9 years agoMerge branch 'master' into net-next
Stephen Hemminger [Fri, 4 Mar 2016 23:47:18 +0000 (15:47 -0800)] 
Merge branch 'master' into net-next

9 years agodoc: Add my article about tc, filters and actions
Phil Sutter [Fri, 4 Mar 2016 12:11:47 +0000 (13:11 +0100)] 
doc: Add my article about tc, filters and actions

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoipneigh: List all nud states in help output
Phil Sutter [Fri, 4 Mar 2016 19:07:21 +0000 (20:07 +0100)] 
ipneigh: List all nud states in help output

To not make the output overly confusing, list them in a definition of
the STATE placeholder which is already used in the show/flush syntax but
wasn't explained before.

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoman: ip-neighbour.8: Document all known nud states
Phil Sutter [Fri, 4 Mar 2016 19:07:20 +0000 (20:07 +0100)] 
man: ip-neighbour.8: Document all known nud states

Not sure how useful they are in practice, but as 'ip neigh' supports
setting them all, they deserve to be described as well.

While at it, also add a missing layer of indentation to the subordinate
nud state list.

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agodoc, man: ip-rule: Remove incorrect statement about rule 0
Phil Sutter [Fri, 4 Mar 2016 11:52:41 +0000 (12:52 +0100)] 
doc, man: ip-rule: Remove incorrect statement about rule 0

The documentation is wrong here: it is indeed possible to remove policy
rule 0 and recreate it afterwards. Therefore remove these statements.

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoman: ip-route: Make synopsis consistent with description
Phil Sutter [Fri, 4 Mar 2016 11:52:40 +0000 (12:52 +0100)] 
man: ip-route: Make synopsis consistent with description

While the synopsis section contains 'ip route list', it is later
described as 'ip route show'. Make this consistent by replacing 'list'
with 'show' in synopsis.

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agotc: pedit: document branch control in help output
Phil Sutter [Fri, 4 Mar 2016 11:52:37 +0000 (12:52 +0100)] 
tc: pedit: document branch control in help output

This seems to have been a hidden feature, though it's very useful and
necessary at least when combining multiple pedit actions.

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoman: ip-link: Beef up VXLAN csum options a bit
Phil Sutter [Fri, 4 Mar 2016 11:52:38 +0000 (12:52 +0100)] 
man: ip-link: Beef up VXLAN csum options a bit

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoman: tc-u32: Minor syntax fix
Phil Sutter [Fri, 4 Mar 2016 11:52:39 +0000 (12:52 +0100)] 
man: tc-u32: Minor syntax fix

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoman: ship action man pages
Phil Sutter [Fri, 4 Mar 2016 12:11:46 +0000 (13:11 +0100)] 
man: ship action man pages

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoman: Add a man page for the xt action
Phil Sutter [Fri, 4 Mar 2016 12:11:45 +0000 (13:11 +0100)] 
man: Add a man page for the xt action

Cc: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoman: Add a man page for the vlan action
Phil Sutter [Fri, 4 Mar 2016 12:11:44 +0000 (13:11 +0100)] 
man: Add a man page for the vlan action

Cc: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoman: Add a man page for the skbedit action
Phil Sutter [Fri, 4 Mar 2016 12:11:43 +0000 (13:11 +0100)] 
man: Add a man page for the skbedit action

Cc: Alexander Duyck <alexander.duyck@gmail.com>
Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoman: Add a man page for the simple action
Phil Sutter [Fri, 4 Mar 2016 12:11:42 +0000 (13:11 +0100)] 
man: Add a man page for the simple action

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoman: Add a man page for the police action
Phil Sutter [Fri, 4 Mar 2016 12:11:41 +0000 (13:11 +0100)] 
man: Add a man page for the police action

Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoman: Add a man page for the pedit action
Phil Sutter [Fri, 4 Mar 2016 12:11:40 +0000 (13:11 +0100)] 
man: Add a man page for the pedit action

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoman: Add a man page for the nat action
Phil Sutter [Fri, 4 Mar 2016 12:11:39 +0000 (13:11 +0100)] 
man: Add a man page for the nat action

Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoman: Add a man page for the mirred action
Phil Sutter [Fri, 4 Mar 2016 12:11:38 +0000 (13:11 +0100)] 
man: Add a man page for the mirred action

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoman: Add a man page for the csum action.
Phil Sutter [Fri, 4 Mar 2016 12:11:37 +0000 (13:11 +0100)] 
man: Add a man page for the csum action.

Cc: Gregoire Baron <baronchon@n7mm.org>
Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoman: Add a man page for the connmark action
Phil Sutter [Fri, 4 Mar 2016 12:11:36 +0000 (13:11 +0100)] 
man: Add a man page for the connmark action

Cc: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoman: ip-*.8: drop any reference to generic ip options
Phil Sutter [Wed, 2 Mar 2016 18:20:08 +0000 (19:20 +0100)] 
man: ip-*.8: drop any reference to generic ip options

Listing generic 'ip' options in subcommand man pages is redundant and
error-prone, as they won't be kept in sync anyway. Since many other man
pages don't list them either, drop references to them in the remaining
ones.

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoman: ip-l2tp.8: Fix BNF syntax
Phil Sutter [Wed, 2 Mar 2016 18:20:07 +0000 (19:20 +0100)] 
man: ip-l2tp.8: Fix BNF syntax

The 'ADDR' part of 'local' and 'remote' parameters is not optional, but
may also consist of the word 'any'. While at it, add missing whitespace
and fix fonts.

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoman: ip.8: Add missing flags and token subcommand description
Phil Sutter [Wed, 2 Mar 2016 18:20:06 +0000 (19:20 +0100)] 
man: ip.8: Add missing flags and token subcommand description

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoman: ip-xfrm.8: Document missing parameters
Phil Sutter [Wed, 2 Mar 2016 18:20:05 +0000 (19:20 +0100)] 
man: ip-xfrm.8: Document missing parameters

Namely, 'extra-flag' of 'ip xfrm state' and 'flag' of 'ip xfrm policy'.

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoman: ip-tunnel.8: Document missing 6rd action
Phil Sutter [Wed, 2 Mar 2016 18:20:04 +0000 (19:20 +0100)] 
man: ip-tunnel.8: Document missing 6rd action

Also drop the non-terminal 'TIME' description as it is not referenced
anywhere.

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoman: ip-token.8: Review synopsis section
Phil Sutter [Wed, 2 Mar 2016 18:20:03 +0000 (19:20 +0100)] 
man: ip-token.8: Review synopsis section

Drop unnecessary curly braces around single action keywords, point out
that 'dev' parameter to 'ip token get' is optional and clarify that 'ip
token' defaults to 'list' action.

Signed-off-by: Phil Sutter <phil@nwl.cc>