]> git.proxmox.com Git - mirror_iproute2.git/log
mirror_iproute2.git
7 years agotc: flower checkpatch cleanups
Stephen Hemminger [Tue, 29 Nov 2016 19:48:52 +0000 (11:48 -0800)]
tc: flower checkpatch cleanups

break long lines and minor whitespace changes.

7 years agotc: flower: Support matching on SCTP ports
Simon Horman [Thu, 3 Nov 2016 12:26:41 +0000 (13:26 +0100)]
tc: flower: Support matching on SCTP ports

Support matching on SCTP ports in the same way that matching
on TCP and UDP ports is already supported.

Example usage:

tc qdisc add dev eth0 ingress

tc filter add dev eth0 protocol ip parent ffff: \
        flower indev eth0 ip_proto sctp dst_port 80 \
        action drop

Signed-off-by: Simon Horman <simon.horman@netronome.com>
7 years agoupdate net-next headers
Stephen Hemminger [Tue, 29 Nov 2016 19:43:40 +0000 (11:43 -0800)]
update net-next headers

8 years agotc: m_mirred: Add support for ingress redirect/mirror
Shmulik Ladkani [Wed, 19 Oct 2016 14:14:09 +0000 (17:14 +0300)]
tc: m_mirred: Add support for ingress redirect/mirror

So far, only the 'egress' direction was implemented.

Allow specifying 'ingress' as the direction packet appears on the target
interface.

For example, this takes incoming 802.1q frames on veth0 and redirects
them for input on dummy0:

 # tc filter add dev veth0 parent ffff: pref 1 protocol 802.1q basic \
     action mirred ingress redirect dev dummy0

Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
8 years agoupdate kernel headers to 4.9-net-next
Stephen Hemminger [Wed, 26 Oct 2016 18:20:29 +0000 (11:20 -0700)]
update kernel headers to 4.9-net-next

8 years agocleanup debris from revert
Stephen Hemminger [Wed, 26 Oct 2016 18:19:11 +0000 (11:19 -0700)]
cleanup debris from revert

Last revert didn't come out clean.

8 years agoRevert "iproute2: macvlan: add "source" mode"
Stephen Hemminger [Wed, 26 Oct 2016 18:15:09 +0000 (11:15 -0700)]
Revert "iproute2: macvlan: add "source" mode"

This reverts commit f33b7276102c019795c034816b91de72a26cdda3.

The upstream changes are not in 4.9

8 years agotc, ipt: don't enforce iproute2 dependency on iptables-devel
Daniel Borkmann [Tue, 18 Oct 2016 12:13:09 +0000 (14:13 +0200)]
tc, ipt: don't enforce iproute2 dependency on iptables-devel

Since 5cd1adba79d3 ("Update to current iptables headers") compilation
of iproute2 broke for systems without iptables-devel package [1].
Reason is that even though we fall back to build m_ipt.c, the include
depends on a xtables-version.h header, which only ships with
iptables-devel. Machines not having this package fail compilation with:

    [...]
    CC       m_ipt.o
In file included from ../include/iptables.h:5:0,
                 from m_ipt.c:17:
../include/xtables.h:34:29: fatal error: xtables-version.h: No such file or directory
compilation terminated.
../Config:31: recipe for target 'm_ipt.o' failed
make[1]: *** [m_ipt.o] Error 1

The configure script only barks that package xtables was not found in
the pkg-config search path. The generated Config then only contains f.e.
TC_CONFIG_IPSET. In tc's Makefile we thus fall back to adding m_ipt.o
to TCMODULES. m_ipt.c then includes the local include/iptables.h header
copy, which includes the include/xtables.h copy. Latter then includes
xtables-version.h, which only ships with iptables-devel.

One way to resolve this is to skip this whole mess when pkg-config has
no xtables config available. I've carried something along these lines
locally for a while now, but it's just too annyoing. :/ Build works fine
now also when xtables.pc is not available.

  [1] http://www.spinics.net/lists/netdev/msg366162.html

Fixes: 5cd1adba79d3 ("Update to current iptables headers")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
8 years agodevlink: Convert conditional in dl_argv_handle_port() to switch()
Hangbin Liu [Sun, 9 Oct 2016 02:14:18 +0000 (10:14 +0800)]
devlink: Convert conditional in dl_argv_handle_port() to switch()

Discovered by Phil's covscan. The final return statement is never reached.
This is not inherently clear from looking at the code, so change the
conditional to a switch() statement which should clarify this.

CC: Phil Sutter <phil@nwl.cc>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Acked-by: Phil Sutter <phil@nwl.cc>
8 years agobridge: add support for the multicast flood flag
Nikolay Aleksandrov [Thu, 13 Oct 2016 15:54:20 +0000 (17:54 +0200)]
bridge: add support for the multicast flood flag

Recently a new per-port flag was added which controls the flooding of
unknown multicast, this patch adds support for controlling it via iproute2.
It also updates the man pages with information about the new flag.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
8 years agotc: cls_bpf: handle skip_sw and skip_hw flags
Jakub Kicinski [Wed, 12 Oct 2016 15:46:36 +0000 (16:46 +0100)]
tc: cls_bpf: handle skip_sw and skip_hw flags

Add support for controling hardware offload using (now standard)
skip_sw and skip_hw flags in cls_bpf.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
8 years agobridge: vlan: remove wrong stats help
Nikolay Aleksandrov [Wed, 12 Oct 2016 13:02:28 +0000 (15:02 +0200)]
bridge: vlan: remove wrong stats help

When I did the per-vlan stats iproute2 support, I left out a hunk from a
previous version of the patch that was using a special subcommand "stats".
Since the latest version uses the -s switch remove the help for the stats
subcommand.

Fixes: 7abf5de677e32 ("bridge: vlan: add support to display per-vlan statistics")
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
8 years agoip: macvlan style cleanup
Stephen Hemminger [Wed, 12 Oct 2016 22:23:27 +0000 (15:23 -0700)]
ip: macvlan style cleanup

breaklong lines.

8 years agoiproute2: macvlan: add "source" mode
michael-dev@fami-braun.de [Sun, 25 Sep 2016 19:08:55 +0000 (21:08 +0200)]
iproute2: macvlan: add "source" mode

Adjusting iproute2 utility to support new macvlan link type mode called
"source".

Example of commands that can be applied:
  ip link add link eth0 name macvlan0 type macvlan mode source
  ip link set link dev macvlan0 type macvlan macaddr add 00:11:11:11:11:11
  ip link set link dev macvlan0 type macvlan macaddr del 00:11:11:11:11:11
  ip link set link dev macvlan0 type macvlan macaddr flush
  ip -details link show dev macvlan0

Based on previous work of Stefan Gula <steweg@gmail.com>

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
Cc: steweg@gmail.com
8 years agoman pages: add man page for skbmod action
Lucas Bates [Tue, 11 Oct 2016 11:00:48 +0000 (07:00 -0400)]
man pages: add man page for skbmod action

Signed-off-by: Lucas Bates <lucasb@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
8 years agotc_filter: style cleanup
Stephen Hemminger [Wed, 12 Oct 2016 22:21:13 +0000 (15:21 -0700)]
tc_filter: style cleanup

Break long lines and whtespace changes.

8 years agotc filters: add support to get individual filters by handle
Jamal Hadi Salim [Mon, 10 Oct 2016 16:45:14 +0000 (12:45 -0400)]
tc filters: add support to get individual filters by handle

sudo $TC filter add dev $ETH parent ffff: prio 2 protocol ip \
u32 match u32 0 0 flowid 1:1 \
action ok
sudo $TC filter add dev $ETH parent ffff: prio 1 protocol ip \
u32 match ip protocol 1 0xff flowid 1:10 \
action ok

now dump to see all rules..
$TC -s filter ls dev $ETH parent ffff: protocol ip
 ....
filter pref 1 u32
filter pref 1 u32 fh 801: ht divisor 1
filter pref 1 u32 fh 801::800 order 2048 key ht 801 bkt 0 flowid 1:10  (rule hit 0 success 0)
  match 00010000/00ff0000 at 8 (success 0 )
        action order 1: gact action drop
         random type none pass val 0
         index 6 ref 1 bind 1 installed 4 sec used 4 sec
        Action statistics:
        Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
        backlog 0b 0p requeues 0

filter pref 2 u32
filter pref 2 u32 fh 800: ht divisor 1
filter pref 2 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:1  (rule hit 336 success 336)
  match 00000000/00000000 at 0 (success 336 )
        action order 1: gact action pass
         random type none pass val 0
         index 5 ref 1 bind 1 installed 38 sec used 4 sec
        Action statistics:
        Sent 24864 bytes 336 pkt (dropped 0, overlimits 0 requeues 0)
        backlog 0b 0p requeues 0
 ....

..get filter 801::800
$TC -s filter get dev $ETH parent ffff: protocol ip \
handle 801:0:800 prio 2  u32

 ....
filter parent ffff: protocol ip pref 1 u32 fh 801::800 order 2048 key ht 801 bkt 0 flowid 1:10  (rule hit 260 success 130)
  match 00010000/00ff0000 at 8 (success 130 )
        action order 1: gact action drop
         random type none pass val 0
         index 6 ref 1 bind 1 installed 348 sec used 0 sec
        Action statistics:
        Sent 11440 bytes 130 pkt (dropped 130, overlimits 0 requeues 0)
        backlog 0b 0p requeues 0
 ....

..get other one
$TC -s filter get dev $ETH parent ffff: protocol ip \
handle 800:0:800 prio 2  u32

....
filter parent ffff: protocol ip pref 2 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:1  (rule hit 514 success 514)
  match 00000000/00000000 at 0 (success 514 )
        action order 1: gact action pass
         random type none pass val 0
         index 5 ref 1 bind 1 installed 506 sec used 4 sec
        Action statistics:
        Sent 35544 bytes 514 pkt (dropped 0, overlimits 0 requeues 0)
        backlog 0b 0p requeues 0
....

..try something that doesnt exist
$TC -s filter get dev $ETH parent ffff: protocol ip  handle 800:0:803 prio 2  u32

.....
RTNETLINK answers: No such file or directory
We have an error talking to the kernel
.....

Note, added NLM_F_ECHO is for backward compatibility. old kernels never
before Eric's patch will not respond without it and newer kernels (after Erics patch)
will ignore it.
In old kernels there is a side effect:
In addition to a response to the GET you will receive an event (if you do tc mon).
But this is still better than what it was before (not working at all).

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
8 years agotc: skbmod style cleanup
Stephen Hemminger [Wed, 12 Oct 2016 22:12:51 +0000 (15:12 -0700)]
tc: skbmod style cleanup

break long lines

8 years agoman pages: Add tc-ife to Makefile
Jamal Hadi Salim [Tue, 11 Oct 2016 11:00:47 +0000 (07:00 -0400)]
man pages: Add tc-ife to Makefile

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
8 years agoman pages: update ife action to include tcindex
Lucas Bates [Tue, 11 Oct 2016 11:00:46 +0000 (07:00 -0400)]
man pages: update ife action to include tcindex

Signed-off-by: Lucas Bates <lucasb@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
8 years agoactions: add skbmod action
Jamal Hadi Salim [Tue, 11 Oct 2016 11:00:45 +0000 (07:00 -0400)]
actions: add skbmod action

This action is intended to be an upgrade from a usability perspective
from pedit (as well as operational debugability).
Compare this:

sudo tc filter add dev $ETH parent 1: protocol ip prio 10 \
u32 match ip protocol 1 0xff flowid 1:2 \
action pedit munge offset -14 u8 set 0x02 \
    munge offset -13 u8 set 0x15 \
    munge offset -12 u8 set 0x15 \
    munge offset -11 u8 set 0x15 \
    munge offset -10 u16 set 0x1515 \
    pipe

to:

sudo tc filter add dev $ETH parent 1: protocol ip prio 10 \
u32 match ip protocol 1 0xff flowid 1:2 \
action skbmod dmac 02:15:15:15:15:15

Or worse, try to debug a policy with destination mac, source mac and
etherype. Then make that a hundred rules and you'll get my point.

The most important ethernet use case at the moment is when redirecting or
mirroring packets to a remote machine. The dst mac address needs a re-write
so that it doesn't get dropped or confuse an interconnecting (learning) switch
or dropped by a target machine (which looks at the dst mac).

In the future common use cases on pedit can be migrated to this action
(as an example different fields in ip v4/6, transports like tcp/udp/sctp
etc). For this first cut, this allows modifying basic ethernet header.

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
8 years agoaction gact: list pipe as a valid action
Craig Dillabaugh [Tue, 11 Oct 2016 11:00:44 +0000 (07:00 -0400)]
action gact: list pipe as a valid action

Signed-off-by: Craig Dillabaugh <cdillaba@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
8 years agoactions ife: Introduce encoding and decoding of tcindex metadata
Jamal Hadi Salim [Tue, 11 Oct 2016 11:00:43 +0000 (07:00 -0400)]
actions ife: Introduce encoding and decoding of tcindex metadata

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
8 years agoife: improve help text
Roman Mashak [Tue, 11 Oct 2016 11:00:42 +0000 (07:00 -0400)]
ife: improve help text

Signed-off-by: Roman Mashak <mrv@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
8 years agoife: print prio, mark and hash as unsigned
Roman Mashak [Tue, 11 Oct 2016 11:00:41 +0000 (07:00 -0400)]
ife: print prio, mark and hash as unsigned

Signed-off-by: Roman Mashak <mrv@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
8 years agoife action: allow specifying index in hex
Roman Mashak [Tue, 11 Oct 2016 11:00:40 +0000 (07:00 -0400)]
ife action: allow specifying index in hex

Signed-off-by: Roman Mashak <mrv@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
8 years agoip: iprule style cleanup
Stephen Hemminger [Mon, 10 Oct 2016 02:29:24 +0000 (19:29 -0700)]
ip: iprule style cleanup

Trivial whitespace cleanup to iprule

8 years agoip rule: add selector support
Hangbin Liu [Fri, 23 Sep 2016 03:25:55 +0000 (11:25 +0800)]
ip rule: add selector support

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
8 years agoip rule: merge ip rule flush and list, save together
Hangbin Liu [Fri, 23 Sep 2016 03:25:54 +0000 (11:25 +0800)]
ip rule: merge ip rule flush and list, save together

iprule_flush() and iprule_list_or_save() both call function
rtnl_wilddump_request() and rtnl_dump_filter(). So merge them
together just like other files do.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
8 years agoiplink: cleanup style errors
Stephen Hemminger [Mon, 10 Oct 2016 02:24:38 +0000 (19:24 -0700)]
iplink: cleanup style errors

Fix long strings causing checkpatch warnings

8 years agoip link: Add support to configure SR-IOV VF to vlan protocol 802.1ad (VST QinQ)
Moshe Shemesh [Wed, 28 Sep 2016 07:58:59 +0000 (10:58 +0300)]
ip link: Add support to configure SR-IOV VF to vlan protocol 802.1ad (VST QinQ)

Introduce a new API that exposes a list of vlans per VF (IFLA_VF_VLAN_LIST),
giving the ability for user-space application to specify it for the VF as
an option to support 802.1ad (VST QinQ).

We introduce struct vf_vlan_info, which extends struct vf_vlan and adds
an optional VF VLAN proto parameter.
Default VLAN-protocol is 802.1Q.

Add IFLA_VF_VLAN_LIST in addition to IFLA_VF_VLAN to keep backward
compatibility with older kernel versions.

Suitable ip link tool command examples:
 - Set vf vlan protocol 802.1ad (S-TAG)
ip link set eth0 vf 1 vlan 100 proto 802.1ad
 - Set vf vlan S-TAG and vlan C-TAG (VST QinQ)
ip link set eth0 vf 1 vlan 100 proto 802.1ad vlan 30 proto 802.1Q
 - Set vf to VST (802.1Q) mode
ip link set eth0 vf 1 vlan 100 proto 802.1Q
 - Or by omitting the new parameter (backward compatible)
ip link set eth0 vf 1 vlan 100

Signed-off-by: Moshe Shemesh <moshe@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
8 years agotc: fq: display unthrottle latency
Eric Dumazet [Wed, 28 Sep 2016 13:23:15 +0000 (06:23 -0700)]
tc: fq: display unthrottle latency

In linux-4.9 fq packet scheduler got a new stat :

unthrottle_latency in nano second units.

Gives a good indication of system load or timer implementation
latencies.

Signed-off-by: Eric Dumazet <edumazet@google.com>
8 years agotc: m_vlan: Add vlan modify action
Shmulik Ladkani [Thu, 22 Sep 2016 18:01:05 +0000 (21:01 +0300)]
tc: m_vlan: Add vlan modify action

The 'vlan modify' action allows to replace an existing 802.1q tag
according to user provided settings.
It accepts same arguments as the 'vlan push' action.

For example, this replaces vid 6 with vid 5:

 # tc filter add dev veth0 parent ffff: pref 1 protocol 802.1q \
      basic match 'meta(vlan mask 0xfff eq 6)' \
      action vlan modify id 5 continue

Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
8 years agoipmroute: add support for age dumping
Nikolay Aleksandrov [Wed, 21 Sep 2016 09:45:58 +0000 (11:45 +0200)]
ipmroute: add support for age dumping

Add support to dump the mroute cache entry age if the show_stats (-s)
switch is provided.
Example:
$ ip -s mroute
(0.0.0.0, 239.10.10.10)          Iif: eth0       Oifs: eth0
  0 packets, 0 bytes, Age  245.44

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
8 years agoMerge branch 'master' into net-next
Stephen Hemminger [Mon, 10 Oct 2016 02:04:50 +0000 (19:04 -0700)]
Merge branch 'master' into net-next

8 years agov4.8.0
Stephen Hemminger [Mon, 10 Oct 2016 02:00:11 +0000 (19:00 -0700)]
v4.8.0

8 years agoiproute2: build nsid-name cache only for commands that need it
Anton Aksola [Tue, 20 Sep 2016 06:01:27 +0000 (06:01 +0000)]
iproute2: build nsid-name cache only for commands that need it

The calling of netns_map_init() before command parsing introduced
a performance issue with large number of namespaces.

As commands such as add, del and exec do not need to iterate through
/var/run/netns it would be good not no build the cache before executing
these commands.

Example:
unpatched:
time seq 1 1000 | xargs -n 1 ip netns add

real    0m16.832s
user    0m1.350s
sys    0m15.029s

patched:
time seq 1 1000 | xargs -n 1 ip netns add

real    0m3.859s
user    0m0.132s
sys    0m3.205s

Signed-off-by: Anton Aksola <aakso@iki.fi>
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
8 years agoupdate headers from pre 4.9 (net-next)
Stephen Hemminger [Mon, 10 Oct 2016 01:55:58 +0000 (18:55 -0700)]
update headers from pre 4.9 (net-next)

8 years agoMerge branch 'master' into net-next
Stephen Hemminger [Mon, 10 Oct 2016 01:53:52 +0000 (18:53 -0700)]
Merge branch 'master' into net-next

8 years agotc: f_u32: Fill in 'linkid' provided by user
Sushma Sitaram [Wed, 28 Sep 2016 18:30:16 +0000 (11:30 -0700)]
tc: f_u32: Fill in 'linkid' provided by user

Currently, 'linkid' input by the user is parsed but 'handle' is appended to the netlink message.

# tc filter add dev enp1s0f1 protocol ip parent ffff: prio 99 u32 ht 800: \
order 1 link 1: offset at 0 mask 0f00 shift 6 plus 0 eat match ip \
protocol 6 ff

resulted in:
filter protocol ip pref 99 u32 fh 800::1 order 1 key ht 800 bkt 0
  match 00060000/00ff0000 at 8
    offset 0f00>>6 at 0  eat

This patch results in:
filter protocol ip pref 99 u32 fh 800::1 order 1 key ht 800 bkt 0 link 1:
  match 00060000/00ff0000 at 8
    offset 0f00>>6 at 0  eat

Signed-off-by Sushma Sitaram: Sushma Sitaram <sushma.sitaram@intel.com>

8 years agobridge: Fix garbled json output seen if a vlan filter is specified
anuradhak [Fri, 7 Oct 2016 16:40:18 +0000 (09:40 -0700)]
bridge: Fix garbled json output seen if a vlan filter is specified

json objects were started but not completed if the fdb vlan did not
match the specified filter vlan.

Sample output:
$ bridge -j fdb show vlan 111
[{
        "mac": "44:38:39:00:69:88",
        "dev": "br0",
        "vlan": 111,
        "master": "br0",
        "state": "permanent"
    }
]
$ bridge -j fdb show vlan 100
[]
$

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
8 years agofix netlink message length checks
Igor Ryzhov [Tue, 4 Oct 2016 10:16:55 +0000 (13:16 +0300)]
fix netlink message length checks

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
8 years agoip: Use specific slave id
Hangbin Liu [Tue, 20 Sep 2016 10:02:12 +0000 (18:02 +0800)]
ip: Use specific slave id

The original bond/bridge/vrf and slaves use same id, which make people
confused. Use bond/bridge/vrf_slave as id name will make code more clear.

Acked-by: Phil Sutter <psutter@redhat.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
8 years agomisc/ss: tcp cwnd should be unsigned
Hangbin Liu [Thu, 22 Sep 2016 08:40:28 +0000 (16:40 +0800)]
misc/ss: tcp cwnd should be unsigned

tcp->snd_cwd is a u32, but ss treats it like a signed int. This may
results in negative bandwidth calculations.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Acked-by: Phil Sutter <phil@nwl.cc>
8 years agomisc/ss: tcp cwnd should be unsigned
Hangbin Liu [Thu, 22 Sep 2016 08:40:28 +0000 (16:40 +0800)]
misc/ss: tcp cwnd should be unsigned

tcp->snd_cwd is a u32, but ss treats it like a signed int. This may
results in negative bandwidth calculations.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Acked-by: Phil Sutter <phil@nwl.cc>
8 years agoss: Support displaying and filtering on socket marks.
Lorenzo Colitti [Wed, 21 Sep 2016 16:02:50 +0000 (01:02 +0900)]
ss: Support displaying and filtering on socket marks.

This allows the user to dump sockets with a given mark (via
"fwmark = 0x1234/0x1234" or "fwmark = 12345", etc.) , and to
display the socket marks of dumped sockets.

The relevant kernel commits are: d545caca827b ("net: inet: diag:
expose the socket mark to privileged processes.") and
a52e95abf772 ("net: diag: allow socket bytecode filters to
match socket marks")

Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
8 years agoiptnl: add support for collect_md flag in IPv4 and IPv6 tunnels
Alexei Starovoitov [Tue, 20 Sep 2016 00:03:14 +0000 (17:03 -0700)]
iptnl: add support for collect_md flag in IPv4 and IPv6 tunnels

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
8 years agoMerge branch 'master' into net-next
Stephen Hemminger [Wed, 21 Sep 2016 23:35:56 +0000 (16:35 -0700)]
Merge branch 'master' into net-next

8 years agotunnels: use macros for IPv6 address comparison
Jiri Benc [Mon, 5 Sep 2016 09:35:27 +0000 (11:35 +0200)]
tunnels: use macros for IPv6 address comparison

Replace open coded comparison of IPv6 addresses with appropriate macros.

Signed-off-by: Jiri Benc <jbenc@redhat.com>
8 years agoipmonitor: fix ip monitor can't work when NET_NS is not enabled
Liping Zhang [Tue, 20 Sep 2016 09:09:02 +0000 (02:09 -0700)]
ipmonitor: fix ip monitor can't work when NET_NS is not enabled

In ip monitor, netns_map_init will check getnsid is supported or not.
But when /proc/self/ns/net does not exist, we just print out error
messages and exit. So user cannot use ip monitor anymore when
CONFIG_NET_NS is disabled:
  # ip monitor
  open("/proc/self/ns/net"): No such file or directory

If open "/proc/self/ns/net" failed, set have_rtnl_getnsid to false.

Fixes: d652ccbf8195 ("netns: allow to dump and monitor nsid")
Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com>
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
8 years agoss: output TCP BBR diag information
Neal Cardwell [Wed, 21 Sep 2016 02:43:44 +0000 (22:43 -0400)]
ss: output TCP BBR diag information

Dump useful TCP BBR state information from a struct tcp_bbr_info that
was grabbed using the inet_diag API.

We tolerate info that is shorter or longer than expected, in case the
kernel is older or newer than the ss binary. We simply print the
minimum of what is expected from the kernel and what is provided from
the kernel. We use the same trick as that used for struct tcp_info:
when the info from the kernel is shorter than we hoped, we pad the end
with zeroes, and don't print fields if they are zero.

The BBR output looks like:
  bbr:(bw:1.2Mbps,mrtt:18.965,pacing_gain:2.88672,cwnd_gain:2.88672)

The motivation here is to be consistent with DCTCP, which looks like:
  dctcp(ce_state:23,alpha:23,ab_ecn:23,ab_tot:23)

Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
8 years agoupdate bpf.h
Stephen Hemminger [Wed, 21 Sep 2016 23:28:56 +0000 (16:28 -0700)]
update bpf.h

8 years agoip route: check ftell, fseek return value
Hangbin Liu [Thu, 8 Sep 2016 02:26:57 +0000 (10:26 +0800)]
ip route: check ftell, fseek return value

ftell() may return -1 in error case, which is not handled and
therefore pass a negative offset to fseek(). The return code of
fseek() is also not checked.

Reported-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
8 years agoMerge branch 'master' into net-next
Stephen Hemminger [Tue, 20 Sep 2016 16:50:53 +0000 (09:50 -0700)]
Merge branch 'master' into net-next

8 years agoip: (ipvlan) introduce L3s mode
Mahesh Bandewar [Mon, 19 Sep 2016 21:39:40 +0000 (14:39 -0700)]
ip: (ipvlan) introduce L3s mode

The new mode 'l3s' can be set like -

  ip link add link <master> dev <IPvlan-slave> type ipvlan mode l3s

  e.g. ip link add link eth0 dev ipvl0 type ipvlan mode l3s

Also did some trivial code restructuring.

Signed-off-by: Mahesh Bandewar <maheshb@google.com>
8 years agomacsec: fix input range of 'icvlen' parameter
Davide Caratti [Fri, 9 Sep 2016 14:02:22 +0000 (16:02 +0200)]
macsec: fix input range of 'icvlen' parameter

the maximum possible ICV length in a MACsec frame is 16 octects, not 32:
fix get_icvlen() accordingly, so that a proper error message is displayed
in case input 'icvlen' is greater than 16.

Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Acked-by: Phil Sutter <phil@nwl.cc>
Acked-by: Sabrina Dubroca <sd@queasysnail.net>
8 years agovxlan: group address requires net device
Jiri Benc [Mon, 5 Sep 2016 09:35:28 +0000 (11:35 +0200)]
vxlan: group address requires net device

This is now enforced in the kernel, check also in iproute to get a better
error message.

Signed-off-by: Jiri Benc <jbenc@redhat.com>
8 years agotc: don't accept qdisc 'handle' greater than ffff
Davide Caratti [Fri, 16 Sep 2016 08:30:00 +0000 (10:30 +0200)]
tc: don't accept qdisc 'handle' greater than ffff

since get_qdisc_handle() truncates the input value to 16 bit, return an
error and prompt "invalid qdisc ID" in case input 'handle' parameter needs
more than 16 bit to be stored.

Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Acked-by: Phil Sutter <phil@nwl.cc>
8 years agoiproute: fix documentation for ip rule scan order
Phil Sutter [Thu, 8 Sep 2016 10:33:03 +0000 (12:33 +0200)]
iproute: fix documentation for ip rule scan order

Looks like the real issue is missing definition of priority.

8 years agoupdate kernel headers from net-next
Stephen Hemminger [Tue, 20 Sep 2016 16:31:42 +0000 (09:31 -0700)]
update kernel headers from net-next

8 years agotipc: cleanup style issues
Stephen Hemminger [Tue, 20 Sep 2016 16:25:42 +0000 (09:25 -0700)]
tipc: cleanup style issues

Fix style issues reported by checkpatch.

8 years agotipc: update man page for link monitor
Parthasarathy Bhuvaragan [Mon, 12 Sep 2016 15:17:21 +0000 (17:17 +0200)]
tipc: update man page for link monitor

Add description for the new link monitor commands.

Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
8 years agotipc: add link monitor list
Parthasarathy Bhuvaragan [Mon, 12 Sep 2016 15:17:20 +0000 (17:17 +0200)]
tipc: add link monitor list

In this commit, we list the monitor attributes. By default it lists
the attributes for all bearers, otherwise the specified bearer.

A sample usage is shown below:
$ tipc link monitor list

bearer eth:data0
node          status monitored generation applied_node_status [non_applied_node:status]
1.1.1         up     direct    16         UU []
1.1.2         up     direct    16         UU []
1.1.3         up     direct    16         UU []

bearer eth:data1
node          status monitored generation applied_node_status [non_applied_node:status]
1.1.1         up     direct    2          UU []
1.1.2         up     direct    3          UU []
1.1.3         up     direct    3          UU []

$ tipc link monitor list media eth device data0

bearer eth:data0
node          status monitored generation applied_node_status [non_applied_node:status]
1.1.1         up     direct    16         UU []
1.1.2         up     direct    16         UU []
1.1.3         up     direct    16         UU []

$ tipc link monitor list -h
Usage: tipc monitor list [ media MEDIA ARGS...]

MEDIA
 udp                   - User Datagram Protocol
 ib                    - Infiniband
 eth                   - Ethernet

Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Tested-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
8 years agotipc: refractor bearer to facilitate link monitor
Parthasarathy Bhuvaragan [Mon, 12 Sep 2016 15:17:19 +0000 (17:17 +0200)]
tipc: refractor bearer to facilitate link monitor

In this commit, we:
1. Export print_bearer_media()
2. Move the bearer name handling from nl_add_bearer_name() into
   a new function cmd_get_unique_bearer_name().

These exported functions will be used by link monitor used in
subsequent commits.

Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
8 years agotipc: add link monitor summary
Parthasarathy Bhuvaragan [Mon, 12 Sep 2016 15:17:18 +0000 (17:17 +0200)]
tipc: add link monitor summary

The monitor summary command prints the basic attributes
specific to the local node.
A sample usage is shown below:
$ tipc link monitor summary
bearer eth:data0
    table_generation 15
    cluster_size 8
    algorithm overlapping-ring

bearer eth:data1
    table_generation 15
    cluster_size 8
    algorithm overlapping-ring

$ tipc link monitor summary -h
Usage: tipc monitor summary

Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Tested-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
8 years agotipc: add link monitor get threshold
Parthasarathy Bhuvaragan [Mon, 12 Sep 2016 15:17:17 +0000 (17:17 +0200)]
tipc: add link monitor get threshold

The command prints the monitor activation threshold.
A sample usage is shown below:
$ tipc link monitor get threshold
32

$ tipc link monitor get -h
Usage: tipc monitor get PPROPERTY

PROPERTIES
 threshold      - Get monitor activation threshold

Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Tested-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
8 years agotipc: add link monitor set threshold
Parthasarathy Bhuvaragan [Mon, 12 Sep 2016 15:17:16 +0000 (17:17 +0200)]
tipc: add link monitor set threshold

The command sets the activation threshold for the new
cluster ring supervision.
A sample usage is shown below:
$ tipc link monitor set threshold 4

$ tipc link monitor set -h
Usage: tipc monitor set PPROPERTY

PROPERTIES
 threshold SIZE - Set activation threshold for monitor

Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Tested-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
8 years agotipc: remove dead code
Parthasarathy Bhuvaragan [Mon, 12 Sep 2016 15:17:15 +0000 (17:17 +0200)]
tipc: remove dead code

remove dead code and a newline.

Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
8 years agoMerge branch 'master' into net-next
Stephen Hemminger [Tue, 20 Sep 2016 16:13:03 +0000 (09:13 -0700)]
Merge branch 'master' into net-next

8 years agoiproute: fix documentation for ip rule scan order
Phil Sutter [Thu, 8 Sep 2016 10:33:03 +0000 (12:33 +0200)]
iproute: fix documentation for ip rule scan order

Hi,

On Thu, Sep 08, 2016 at 11:59:55AM +0200, Michal Kubecek wrote:
> On Thu, Sep 01, 2016 at 09:04:54AM -0700, Stephen Hemminger wrote:
> > On Tue, 30 Aug 2016 17:32:52 -0700
> > Iskren Chernev <iskren@imo.im> wrote:
> >
> > > From 416f45b62f33017d19a9b14e7b0179807c993cbe Mon Sep 17 00:00:00 2001
> > > From: Iskren Chernev <iskren@imo.im>
> > > Date: Tue, 30 Aug 2016 17:08:54 -0700
> > > Subject: [PATCH bug-fix] iproute: fix documentation for ip rule scan order
> > >
> > > ---
> > >  man/man8/ip-rule.8 | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/man/man8/ip-rule.8 b/man/man8/ip-rule.8
> > > index 1774ae3..3508d80 100644
> > > --- a/man/man8/ip-rule.8
> > > +++ b/man/man8/ip-rule.8
> > > @@ -93,7 +93,7 @@ Each policy routing rule consists of a
> > >  .B selector
> > >  and an
> > >  .B action predicate.
> > > -The RPDB is scanned in order of decreasing priority. The selector
> > > +The RPDB is scanned in order of increasing priority. The selector
> > >  of each rule is applied to {source address, destination address,
> > > incoming
> > >  interface, tos, fwmark} and, if the selector matches the packet,
> > >  the action is performed. The action predicate may return with success.
> > > --
> > > 2.4.5
> >
> > Applied
>
> I'm sorry I didn't notice before but this just reverts the change done
> by commit 49572501664d ("iproute2: clarification of various man8 pages").
> IMHO the problem is that both versions are equally confusing as the word
> "priority" can be understood in two different senses.
>
> How about more explicit formulation, e.g.
>
>   ... in order of decreasing logical priority (i.e. increasing numeric
>   values).
>
> Would that be better?

Looks like the real issue is missing definition of priority. What about
this:

8 years agotuntap: Add name attribute to usage text
Thomas Graf [Thu, 8 Sep 2016 12:56:34 +0000 (14:56 +0200)]
tuntap: Add name attribute to usage text

Signed-off-by: Thomas Graf <tgraf@suug.ch>
8 years agogitignore: Ignore 'tags' file generated by ctags
Hangbin Liu [Tue, 6 Sep 2016 06:42:52 +0000 (14:42 +0800)]
gitignore: Ignore 'tags' file generated by ctags

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
8 years agonstat: add sctp snmp support
Hangbin Liu [Mon, 5 Sep 2016 03:35:02 +0000 (11:35 +0800)]
nstat: add sctp snmp support

SCTP module was not load by default. But this should be OK since we will not
load table if fdopen() failed, also opening the proc file won't load SCTP
kernel module.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
8 years agoMerge branch 'master' into net-next
Stephen Hemminger [Thu, 1 Sep 2016 16:11:10 +0000 (09:11 -0700)]
Merge branch 'master' into net-next

8 years agoupdate kernel headers from 4.8-rc4
Stephen Hemminger [Thu, 1 Sep 2016 16:10:43 +0000 (09:10 -0700)]
update kernel headers from 4.8-rc4

8 years agomacsec: fix byte ordering on input/display of 'sci'
Davide Caratti [Tue, 30 Aug 2016 11:23:14 +0000 (13:23 +0200)]
macsec: fix byte ordering on input/display of 'sci'

use get_be64() in place of get_u64() when parsing input 'sci' parameter,
so that 'sci' can be entered using network byte order regardless the
endianness of target system; use ntohll() when printing out 'sci'. While
at it, improve documentation of 'sci' in ip-link.8.

Signed-off-by: Davide Caratti <dcaratti@redhat.com>
8 years agoman: ip.8: add missing 'macsec' item to OBJECT list
Davide Caratti [Tue, 30 Aug 2016 11:23:13 +0000 (13:23 +0200)]
man: ip.8: add missing 'macsec' item to OBJECT list

Signed-off-by: Davide Caratti <dcaratti@redhat.com>
8 years agomacsec: fix input of 'port', improve documentation of 'address'
Davide Caratti [Tue, 30 Aug 2016 11:23:12 +0000 (13:23 +0200)]
macsec: fix input of 'port', improve documentation of 'address'

remove hardcoded base 10 parsing of 'port' parameter, update man page
and fix usage() functions as well. Fix misleading line in man page that
theoretically allowed specifying 'port' keyword right after 'sci' keyword.
Provide documentation of 'address' parameter in man pages and in usage()
functions as well.

Signed-off-by: Davide Caratti <dcaratti@redhat.com>
8 years agoip: iptuntap cleanup
Stephen Hemminger [Thu, 1 Sep 2016 16:03:40 +0000 (09:03 -0700)]
ip: iptuntap cleanup

Minor whitespace changes

8 years agoremove useless return statement
Stephen Hemminger [Thu, 1 Sep 2016 15:44:20 +0000 (08:44 -0700)]
remove useless return statement

Get rid of:
void foo() {
...
return;
}

8 years agoiproute: fix documentation for ip rule scan order
Iskren Chernev [Wed, 31 Aug 2016 00:08:54 +0000 (17:08 -0700)]
iproute: fix documentation for ip rule scan order

8 years agoiproute: disallow ip rule del without parameters
Andrey Jr. Melnikov [Wed, 24 Aug 2016 20:43:00 +0000 (23:43 +0300)]
iproute: disallow ip rule del without parameters

Disallow run `ip rule del` without any parameter to avoid delete any first
rule from table.

Signed-off-by: Andrey Jr. Melnikov <temnota.am@gmail.com>
8 years agoiptuntap: show processes using tuntap interface
Hannes Frederic Sowa [Wed, 24 Aug 2016 18:08:25 +0000 (20:08 +0200)]
iptuntap: show processes using tuntap interface

Show which processes are using which tun/tap devices, e.g.:

$ ip -d tuntap
tun0: tun
Attached to processes: vpnc(9531)
vnet0: tap vnet_hdr
Attached to processes: qemu-system-x86(10442)
virbr0-nic: tap UNKNOWN_FLAGS:800
Attached to processes:

Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
8 years agoip: route: fix multicast route dumps
Nikolay Aleksandrov [Sat, 20 Aug 2016 12:53:10 +0000 (14:53 +0200)]
ip: route: fix multicast route dumps

If we have multicast routes and do ip route show table all we'll get the
following output:
 ...
 multicast ???/32 from ???/32  table default  proto static  iif eth0
The "???" are because the rtm_family is set to RTNL_FAMILY_IPMR instead
(or RTNL_FAMILY_IP6MR for ipv6). Add a simple workaround that returns the
real family based on the rtm_type (always RTN_MULTICAST for ipmr routes)
and the rtm_family. Similar workaround is already used in ipmroute, and
we can use this helper there as well.

After the patch the output is:
multicast 239.10.10.10/32 from 0.0.0.0/32  table default  proto static  iif eth0

Also fix a minor whitespace error and switch to tabs.

Reported-by: Satish Ashok <sashok@cumulusnetworks.com>
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
8 years agoMerge branch 'master' into net-next
Stephen Hemminger [Thu, 1 Sep 2016 15:39:15 +0000 (08:39 -0700)]
Merge branch 'master' into net-next

8 years agotc: m_vlan: Add priority option to push vlan action
Hadar Hen Zion [Thu, 1 Sep 2016 06:45:48 +0000 (09:45 +0300)]
tc: m_vlan: Add priority option to push vlan action

The current vlan push action supports only vid and protocol options.
Add priority option.

Example script that adds vlan push action with vid and priority:

tc filter add dev veth0 protocol ip parent ffff: \
flower \
indev veth0 \
action vlan push id 100 priority 5

Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
8 years agotc: flower: Introduce vlan support
Hadar Hen Zion [Thu, 1 Sep 2016 06:45:47 +0000 (09:45 +0300)]
tc: flower: Introduce vlan support

Classification according to vlan id and vlan priority.

Example script that adds vlan filter:

 # add ingress qdisc
 tc qdisc add dev ens4f0 ingress

 # add a flower filter with vlan id and priority classification
 tc filter add dev ens4f0 protocol 802.1Q parent ffff: \
flower \
indev ens4f0 \
vlan_ethtype ipv4 \
vlan_id 100 \
vlan_prio 3 \
action vlan pop

Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
8 years agotc: man: Add man entry for the matchall classifier.
Yotam Gigi [Wed, 31 Aug 2016 07:28:27 +0000 (09:28 +0200)]
tc: man: Add man entry for the matchall classifier.

In addition to providing information about the mathcall filter and its
configurations, the man entry contains examples for creating port
mirorring entries.

Signed-off-by: Yotam Gigi <yotamg@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
8 years agotc: Add support for the matchall traffic classifier.
Yotam Gigi [Wed, 31 Aug 2016 07:28:26 +0000 (09:28 +0200)]
tc: Add support for the matchall traffic classifier.

The matchall classifier matches every packet and allows the user to apply
actions on it. In addition, it supports the skip_sw and skip_hw (as can
be found on u32 and flower filter) that direct the kernel to skip the
software/hardware processing of the actions.

This filter is very useful in usecases where every packet should be
matched. For example, packet mirroring (SPAN) can be setup very easily
using that filter.

Signed-off-by: Yotam Gigi <yotamg@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
8 years agotipc: add the ability to get UDP bearer options
Richard Alpe [Tue, 30 Aug 2016 08:37:00 +0000 (10:37 +0200)]
tipc: add the ability to get UDP bearer options

In this patch we introduce the ability to get UDP specific bearer
options such as remoteip, remoteport, localip and localport.

After some discussions on tipc-discussion on how to handle media
specific options we agreed to pass them after the media.

For media generic bearer options we already do:
$ tipc bearer get OPTION media MEDIA name|device NAME|DEVICE

For the UDP media specific bearer options we introduce in this path:
$ tipc bearer get media udp name NAME OPTION
such as
$ tipc bearer get media udp name NAME remoteip

This allows bash-completion to tab complete only appropriate options,
it makes more logical sense and it scales better. Even though it might
look a little different to the user.

In order to use the existing option parsing framework to do this we
add a flag (OPT_KEY) to the option parsing function.

If the UDP bearer has multiple remoteip addresses associated with it
(replicast) we handle the TIPC_NLA_UDP_MULTI_REMOTEIP flag and send
a TIPC_NL_UDP_GET_REMOTEIP query transparently to the user.

Signed-off-by: Richard Alpe <richard.alpe@ericsson.com>
Reviewed-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Acked-by: Jon Maloy <jon.maloy@ericsson.com>
8 years agotipc: introduce bearer add for remoteip
Richard Alpe [Tue, 30 Aug 2016 08:36:59 +0000 (10:36 +0200)]
tipc: introduce bearer add for remoteip

Introduce the ability to add remote IP addresses to an existing UDP
bearer. On the kernel side, adding a "remoteip" to an existing bearer
puts the bearer in "replicast" mode where TIPC multicast messages are
send out to each configured remoteip using unicast. This is required
for TIPC UDP bearers to work in environments where IP multicast is
disabled.

Signed-off-by: Richard Alpe <richard.alpe@ericsson.com>
Reviewed-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Acked-by: Jon Maloy <jon.maloy@ericsson.com>
8 years agoMerge branch 'master' into net-next
Stephen Hemminger [Mon, 29 Aug 2016 18:19:03 +0000 (11:19 -0700)]
Merge branch 'master' into net-next

8 years agodevlink: whitespace cleanup
Stephen Hemminger [Mon, 29 Aug 2016 18:17:38 +0000 (11:17 -0700)]
devlink: whitespace cleanup

Break long lines

8 years agodevlink: Add e-switch support
Or Gerlitz [Sun, 28 Aug 2016 13:35:21 +0000 (16:35 +0300)]
devlink: Add e-switch support

Implement kernel devlink e-switch interface. Currently we allow
to get and set the device e-switch mode.

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roi Dayan <roid@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
8 years agoupdate TIPC headers
Stephen Hemminger [Mon, 29 Aug 2016 18:06:02 +0000 (11:06 -0700)]
update TIPC headers

8 years agobridge: vlan: add support to display per-vlan statistics
Nikolay Aleksandrov [Thu, 25 Aug 2016 12:28:55 +0000 (14:28 +0200)]
bridge: vlan: add support to display per-vlan statistics

This patch adds support for the stats argument to the bridge
vlan command which will display the per-vlan statistics and the device
each vlan belongs to with its flags. The supported command filtering
options are dev and vid. Also the man page is updated to explain the new
option.
The patch uses the new RTM_GETSTATS interface with a filter_mask to dump
all bridges and ports vlans. Later we can add support for using the
per-device dump and filter it in the kernel instead.

Example:
$ bridge -s vlan show
port             vlan id
br0               1 Egress Untagged
                    RX: 2536 bytes 20 packets
                    TX: 2536 bytes 20 packets
                  101
                    RX: 43158 bytes 50 packets
                    TX: 43158 bytes 50 packets
eth1              1 Egress Untagged
                    RX: 2536 bytes 20 packets
                    TX: 2536 bytes 20 packets
                  100
                    RX: 0 bytes 0 packets
                    TX: 0 bytes 0 packets
                  101
                    RX: 43158 bytes 50 packets
                    TX: 43158 bytes 50 packets
                  102
                    RX: 16897 bytes 93 packets
                    TX: 0 bytes 0 packets

The format is the same as bridge vlan show but with stats, even though
under the hood the calls done to the kernel are different.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
8 years agoMerge branch 'master' into net-next
Stephen Hemminger [Mon, 29 Aug 2016 17:57:02 +0000 (10:57 -0700)]
Merge branch 'master' into net-next

8 years agopolice: bug fix man page
Roman Mashak [Sun, 28 Aug 2016 12:52:42 +0000 (08:52 -0400)]
police: bug fix man page

Signed-off-by: Roman Mashak <mrv@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
8 years agopolice: improve usage message
Roman Mashak [Sun, 28 Aug 2016 12:52:41 +0000 (08:52 -0400)]
police: improve usage message

Signed-off-by: Roman Mashak <mrv@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
8 years agopolice: add extra space to improve police result printing
Roman Mashak [Sun, 28 Aug 2016 12:52:40 +0000 (08:52 -0400)]
police: add extra space to improve police result printing

Signed-off-by: Roman Mashak <mrv@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>