]> git.proxmox.com Git - mirror_iproute2.git/log
mirror_iproute2.git
9 years agoadd help command to bonding master
Jiri Pirko [Fri, 5 Sep 2014 13:24:16 +0000 (15:24 +0200)]
add help command to bonding master

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
9 years agoiproute2: allow to change slave options via type_slave
Nikolay Aleksandrov [Wed, 3 Sep 2014 15:57:30 +0000 (17:57 +0200)]
iproute2: allow to change slave options via type_slave

This patch adds the necessary changes to allow altering a slave device's
options via ip link set <device> type <master type>_slave specific-option.
It also adds support to set the bonding slaves' queue_id.

Example:
 ip link set eth0 type bond_slave queue_id 10

Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>
9 years agoiplink: forbid negative ifindex and modifying ifindex
WANG Cong [Fri, 5 Sep 2014 23:36:14 +0000 (16:36 -0700)]
iplink: forbid negative ifindex and modifying ifindex

Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
9 years agoip: support of usec rtt in tcp_metrics
Eric Dumazet [Fri, 5 Sep 2014 23:54:04 +0000 (16:54 -0700)]
ip: support of usec rtt in tcp_metrics

Starting from linux-3.15, kernel supports new tcp metric attributes :
TCP_METRIC_RTT_US & TCP_METRIC_RTTVAR_US

Update ip command to detect their use.

Signed-off-by: Eric Dumazet <edumazet@google.com>
9 years agoip monitor: Skip IPv6 ND user option messages
vadimk [Thu, 4 Sep 2014 20:24:22 +0000 (23:24 +0300)]
ip monitor: Skip IPv6 ND user option messages

IPv6 router sends ND messages with RDNSS option
which causes the printing of unknown message by 'ip monitor':

    Unknown message: 0000004c 00000044 00000000

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoip monitor: Dont print timestamp or banner-label for cloned routes
vadimk [Thu, 4 Sep 2014 19:48:08 +0000 (22:48 +0300)]
ip monitor: Dont print timestamp or banner-label for cloned routes

This is ugly fix but solves the case when timestamp
or banner-label is printed before the cloned route will be skipped
by iproute filter which filters out all cached routes by default.
In such case timestamp will be printed twice:

    Timestamp: Thu Sep  4 19:46:59 2014 457933 usec
    Timestamp: Thu Sep  4 19:47:07 2014 977970 usec
    10.3.5.1 dev wlp3s0 lladdr XX:XX:XX:XX:XX:XX STALE

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoupdate dsfield file values
Stephen Hemminger [Mon, 15 Sep 2014 03:40:37 +0000 (20:40 -0700)]
update dsfield file values

Update the rt_dsfield file to contain values defined in current RFC.
The days of TOS precedence are gone, even Cisco doesn't refer
to these in the documents.

9 years agoip link: Remove unnecessary device checking
vadimk [Sat, 30 Aug 2014 12:06:00 +0000 (15:06 +0300)]
ip link: Remove unnecessary device checking

The real checking is performed later in iplink_modify(..) func which
checks device existence if NLM_F_CREATE flag is set.

Also it fixes the case when impossible to add veth link which was
caused by 9a02651a87 (ip: check for missing dev arg when doing VF rate)
because these devices are not exist yet.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 years agoip man: Added short description for hsr link type
vadimk [Sat, 30 Aug 2014 22:57:48 +0000 (01:57 +0300)]
ip man: Added short description for hsr link type

For hsr link there was no short description in ip-link man page.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 years agoip netns: Show error message if mkdir failed to create /var/run/netns
vadimk [Thu, 28 Aug 2014 13:56:03 +0000 (16:56 +0300)]
ip netns: Show error message if mkdir failed to create /var/run/netns

Currently if mkdir failed with "Permission denied" error then "mount --make-shared ..."
error message will be showed because /var/run/netns does not exist.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 years agonstat: 64bit support on 32bit arches
Eric Dumazet [Mon, 25 Aug 2014 14:27:54 +0000 (07:27 -0700)]
nstat: 64bit support on 32bit arches

SNMP counters can be provided as 64bit numbers.
nstat needs to cope with this even if running in 32bit mode.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 years agoll_types: add netlink ARPHRD
Daniel Borkmann [Sat, 23 Aug 2014 15:13:29 +0000 (17:13 +0200)]
ll_types: add netlink ARPHRD

This adds ARPHRD_NETLINK to ll_types so that it can be properly
shown e.g. in `ip a`:

 8: nlmon: <NOARP,UP,LOWER_UP> mtu 3776 qdisc noqueue state UNKNOWN group default
    link/netlink

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 years agoMerge branch 'net-next'
Stephen Hemminger [Mon, 4 Aug 2014 19:58:36 +0000 (12:58 -0700)]
Merge branch 'net-next'

9 years agov3.16.0
Stephen Hemminger [Mon, 4 Aug 2014 19:43:46 +0000 (12:43 -0700)]
v3.16.0

9 years agoiproute2: allow to ipv6 set address generation mode
Jiri Pirko [Fri, 11 Jul 2014 19:11:46 +0000 (21:11 +0200)]
iproute2: allow to ipv6 set address generation mode

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
9 years agoUpdate kernel headers to net-next
Stephen Hemminger [Mon, 4 Aug 2014 19:39:49 +0000 (12:39 -0700)]
Update kernel headers to net-next

9 years agocleanup warnings
Stephen Hemminger [Mon, 4 Aug 2014 17:30:35 +0000 (10:30 -0700)]
cleanup warnings

ll_index can return -1 but was declared unsigned.
rt_addr_n2a had unused length parameter

9 years agotc/netem: loss gemodel options fixes
Jay Vosburgh [Sat, 10 May 2014 20:34:58 +0000 (13:34 -0700)]
tc/netem: loss gemodel options fixes

First, the default value for 1-k is documented as being 0, but is
currently being set to 1. (100%).  This causes all packets to be dropped
in the good state if 1-k is not explicitly specified.  Fix this by setting
the default to 0.

Second, the 1-h option is parsed correctly, however, the kernel is
expecting "h", not 1-h.  Fix this by inverting the "1-h" percentage before
sending to and after receiving from the kernel.  This does change the
behavior, but makes it consistent with the netem documentation and the
literature on the Gilbert-Elliot model, which refer to "1-h" and "1-k,"
not "h" or "k" directly.

Last, fix a minor formatting issue for the options reporting.

Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>
9 years agoiproute2 bridge: bring to above par with brctl show macs
Jamal Hadi Salim [Fri, 4 Jul 2014 12:37:10 +0000 (08:37 -0400)]
iproute2 bridge: bring to above par with brctl show macs

root@moja-mojo:bridge# ./bridge fdb help
Usage: bridge fdb { add | append | del | replace } ADDR dev DEV {self|master} [ temp ]
              [router] [ dst IPADDR] [ vlan VID ]
              [ port PORT] [ vni VNI ] [via DEV]
       bridge fdb {show} [ br BRDEV ] [ brport DEV ]

 Lets start with two bridges each with a port...

root@moja-mojo:bridge# ./bridge link
10: sw1-p1 state DOWN : <BROADCAST,NOARP> mtu 1500 master sw1 state disabled priority 32 cost 100
11: eth1 state DOWN : <BROADCAST,NOARP> mtu 1500 master br0 state disabled priority 32 cost 100

show all...
root@moja-mojo:bridge# ./bridge fdb show
33:33:00:00:00:01 dev ifb0 self permanent
33:33:00:00:00:01 dev ifb1 self permanent
33:33:00:00:00:01 dev eth0 self permanent
01:00:5e:00:00:01 dev eth0 self permanent
33:33:ff:92:c0:60 dev eth0 self permanent
33:33:00:00:00:fb dev eth0 self permanent
01:00:5e:00:00:fb dev eth0 self permanent
01:00:5e:7f:ff:fd dev eth0 self permanent
01:00:5e:00:00:01 dev wlan0 self permanent
33:33:00:00:00:01 dev wlan0 self permanent
33:33:ff:c2:84:3b dev wlan0 self permanent
33:33:00:00:00:fb dev wlan0 self permanent
01:00:5e:00:00:01 dev virbr0 self permanent
01:00:5e:00:00:fb dev virbr0 self permanent
33:33:00:00:00:01 dev br0 self permanent
33:33:00:00:00:01 dev sw1 self permanent
33:33:00:00:00:01 dev dummy0 self permanent
5e:f4:03:44:da:9a dev sw1-p1 vlan 0 master sw1 permanent
33:33:00:00:00:01 dev sw1-p1 self permanent
b6:5e:dd:ce:d7:5e dev eth1 vlan 0 master br0 permanent
33:33:00:00:00:01 dev eth1 self permanent

Lets see a netdev that is *not* attached to a bridge

root@moja-mojo:bridge# ./bridge fdb show brport eth0
33:33:00:00:00:01 self permanent
01:00:5e:00:00:01 self permanent
33:33:ff:92:c0:60 self permanent
33:33:00:00:00:fb self permanent
01:00:5e:00:00:fb self permanent
01:00:5e:7f:ff:fd self permanent

Lets see a netdev that is bridge port
root@moja-mojo:bridge# ./bridge fdb show brport eth1
hadi@jhs-1:/media/MT1/other-gits/iproute-jul04/bridge$ ./bridge fdb show brport eth1
b6:5e:dd:ce:d7:5e vlan 0 master br0 permanent
33:33:00:00:00:01 self permanent

Specify the correct bridge and you get good stuff
root@moja-mojo:bridge# ./bridge fdb show brport eth1 br br0
6:5e:dd:ce:d7:5e vlan 0 master br0 permanent
33:33:00:00:00:01 self permanent

Specify the wrong bridge and you get good nada
root@moja-mojo:bridge# ./bridge fdb show brport eth1 br sw1

dump br0
root@moja-mojo:bridge# ./bridge fdb show br br0
33:33:00:00:00:01 dev br0 self permanent
b6:5e:dd:ce:d7:5e dev eth1 vlan 0 master br0 permanent
33:33:00:00:00:01 dev eth1 self permanent

dump sw1
root@moja-mojo:bridge# ./bridge fdb show br sw1
33:33:00:00:00:01 dev sw1 self permanent
5e:f4:03:44:da:9a dev sw1-p1 vlan 0 master sw1 permanent
33:33:00:00:00:01 dev sw1-p1 self permanent

Lets move a port from one bridge to another for shits-and-giggles
(as the New Brunswickians like to say)
root@moja-mojo:bridge# ip link set sw1-p1 master br0

Now dump again br0
root@moja-mojo:bridge# ./bridge fdb show br br0
33:33:00:00:00:01 dev br0 self permanent
5e:f4:03:44:da:9a dev sw1-p1 vlan 0 master br0 permanent
33:33:00:00:00:01 dev sw1-p1 self permanent
b6:5e:dd:ce:d7:5e dev eth1 vlan 0 master br0 permanent
33:33:00:00:00:01 dev eth1 self permanent

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
9 years agolink dump filter
Roopa Prabhu [Wed, 16 Jul 2014 14:13:25 +0000 (07:13 -0700)]
link dump filter

This patch avoids a full link wildump request when the user has specified
a single link. Uses RTM_GETLINK without the NLM_F_DUMP flag.

This helps on a system with large number of interfaces.

This patch currently only uses the link ifindex in the filter.
Hoping to provide a subsequent kernel patch to do link dump filtering on
other attributes in the kernel.

In iplink_get, to be safe, this patch currently sets the answer buffer
size to the max size that libnetlink rtnl_talk can copy. The current api
does not seem to provide a way to indicate the answer buf size.

changelog from RFC to v1:
    - incorporated comments from stephen (fixed comment and fixed if/else block)

changelog from v1 to v2:
    - fix whitespaces error

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
9 years agoiplink: macvtap: fix man page
Rami Rosen [Sat, 19 Jul 2014 09:00:25 +0000 (12:00 +0300)]
iplink: macvtap: fix man page

This patch adds description about macvtap to ip-link.8 man page.

Signed-off-by: Rami Rosen <ramirose@gmail.com>
9 years agofix ip tunnel for vti tunnels with ikey
Dmitry Popov [Fri, 6 Jun 2014 20:33:49 +0000 (00:33 +0400)]
fix ip tunnel for vti tunnels with ikey

Consider the following command:

ip tunnel add mode vti remote 12.0.0.1 local 12.0.0.3 ikey 15

i_flags will be GRE_KEY|VTI_ISVTI. So, in order to distinguish between ipip and
vti we have to check just VTI_ISVTI bit, not the equality of i_flags and
VTI_ISVTI.

* Note, that there also was a bug in ip_tunnel/ip_vti, see
commit 7c8e6b9c281(ip_vti: Fix 'ip tunnel add' with 'key' parameters),
https://lkml.org/lkml/2014/6/7/125.
Even patched iproute could be unable to create vti tunnels with non-zero keys.

1) Unpatched iproute2:
[root@vm ~]# ip tunnel show
[root@vm ~]# lsmod | egrep '(ipip|vti)'
[root@vm ~]# ip tunnel add mode vti ikey 1
[root@vm ~]# lsmod | egrep '(ipip|vti)'
ipip                    4197  0
tunnel4                 1659  1 ipip
ip_tunnel               9295  1 ipip
[root@vm ~]# ip tunnel show
tunl0: ip/ip  remote any  local any  ttl inherit
[root@vm ~]# ip tunnel add mode vti remote 1.2.3.4 ikey 2
[root@vm ~]# ip tunnel show
ipip0: ip/ip  remote 1.2.3.4  local any  ttl inherit
tunl0: ip/ip  remote any  local any  ttl inherit
[root@vm ~]# lsmod | egrep '(ipip|vti)'
ipip                    4197  0
tunnel4                 1659  1 ipip
ip_tunnel               9295  1 ipip

# ipip tunnels are created instead of vti

2) Patched iproute2:
[root@vm ~]# ip tunnel show
[root@vm ~]# lsmod | egrep '(ipip|vti)'
[root@vm ~]# ip tunnel add mode vti ikey 1
[root@vm ~]# lsmod | egrep '(ipip|vti)'
ip_vti                  5258  0
ip_tunnel               9295  1 ip_vti
[root@vm ~]# ip tunnel show
vti0: ip/ip  remote any  local any  ttl inherit  ikey 1  okey 0
ip_vti0: ip/ip  remote any  local any  ttl inherit  nopmtudisc key 0
[root@vm ~]# ip tunnel add mode vti remote 1.2.3.4 ikey 2
[root@vm ~]# ip tunnel show
vti0: ip/ip  remote any  local any  ttl inherit  ikey 1  okey 0
vti1: ip/ip  remote 1.2.3.4  local any  ttl inherit  ikey 2  okey 0
ip_vti0: ip/ip  remote any  local any  ttl inherit  nopmtudisc key 0

# Vti tunnels are created as expected
# * If you have unpatched kernel your vti tunnels will have ikey == okey == 0

Same story exists with ip tunnel show/del with non-zero [io]key: requests are
routed to tunl0 instead of ip_vti0.

Signed-off-by: Dmitry Popov <ixaphire@qrator.net>
9 years agoipnetns: fixed typo "seting" -> "setTing"
Vasily Averin [Sun, 22 Jun 2014 19:11:28 +0000 (23:11 +0400)]
ipnetns: fixed typo "seting" -> "setTing"

Signed-off-by: Vasily Averin <vvs@openvz.org>
9 years agoman: token: fix couple of typos
Daniel Borkmann [Wed, 18 Jun 2014 07:40:42 +0000 (09:40 +0200)]
man: token: fix couple of typos

Not sure how these typos slipped in back then, I suspect
too much coffee. ;) So lets fix them up properly.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
9 years agoip: Added missing usage for netconf object
vadimk [Mon, 30 Jun 2014 14:37:50 +0000 (17:37 +0300)]
ip: Added missing usage for netconf object

9 years agoip: add nlmon as a device type to help message
Masatake YAMATO [Wed, 11 Jun 2014 19:08:38 +0000 (04:08 +0900)]
ip: add nlmon as a device type to help message

Though nlmon device can be added, it was not listed
in the output of "ip link help".

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Acked-by: Daniel Borkmann <dborkman@redhat.com>
9 years agoip: check for missing dev arg when doing VF rate
Stephen Hemminger [Mon, 14 Jul 2014 19:08:05 +0000 (12:08 -0700)]
ip: check for missing dev arg when doing VF rate

New VF rate code was not handling case where device not specified.
Caught by GCC warning about uninitialized variable.

9 years agoip: add paren to silence warning
Stephen Hemminger [Mon, 14 Jul 2014 19:06:52 +0000 (12:06 -0700)]
ip: add paren to silence warning

Gcc doesn't like mixed || and && in same conditional.

9 years agoUpdate kernel headers to 3.16-rc5
Stephen Hemminger [Mon, 14 Jul 2014 18:56:33 +0000 (11:56 -0700)]
Update kernel headers to 3.16-rc5

10 years agoMerge branch 'net-next'
Stephen Hemminger [Tue, 10 Jun 2014 17:38:00 +0000 (10:38 -0700)]
Merge branch 'net-next'

10 years agov3.15.0
Stephen Hemminger [Tue, 10 Jun 2014 16:39:14 +0000 (09:39 -0700)]
v3.15.0

10 years agobridge: Add master device name to bridge fdb show
Roopa Prabhu [Sun, 8 Jun 2014 05:23:42 +0000 (22:23 -0700)]
bridge: Add master device name to bridge fdb show

This patch adds master dev name from NDA_MASTER netlink attribute
 to bridge fdb show output

current iproute2 tries to print 'master' in the output if NTF_MASTER
is present. But, kernel today does not set NTF_MASTER during dump
requests. Which means I have not seen iproute2 bridge cmd print 'master' atall.
This patch overrides the NTF_MASTER flag if NDA_MASTER attribute is present.

Example output:

before this patch:
# bridge fdb show
44:38:39:00:27:ba dev bond2.2003 permanent
44:38:39:00:27:bb dev bond4.2003 permanent
44:38:39:00:27:bc dev bond2.2004 permanent

After this patch:
# bridge fdb show
44:38:39:00:27:ba dev bond2.2003 master br-2003 permanent
44:38:39:00:27:bb dev bond4.2003 master br-2003 permanent
44:38:39:00:27:bc dev bond2.2004 master br-2004 permanent

For comparision with the above, below is the output for NTF_SELF today,
# bridge fdb show
33:33:00:00:00:01 dev eth0 self permanent
01:00:5e:00:00:01 dev eth0 self permanent
33:33:ff:00:01:cc dev eth0 self permanent

If change in output is a concern, 'master' can be put at the end of the fdb
output line or made optional with -d[etails] option.

change from v1 to v2:
    use 'bridge' instead of 'master' in fdb show output

change from v2 to v3:
    use 'master' instead of 'bridge' in fdb show output
    (master could also be a vxlan device)

Signed-off-by: Wilson Kok <wkok@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
10 years agoAdd support to configure SR-IOV VF minimum and maximum Tx rate through ip tool
Sucheta Chakraborty [Thu, 22 May 2014 13:59:37 +0000 (09:59 -0400)]
Add support to configure SR-IOV VF minimum and maximum Tx rate through ip tool

o "min_tx_rate" option has been added for minimum Tx rate. Hence, for
  consistent naming, "max_tx_rate" option has been introduced for maximum
  Tx rate.

o Change in v2: "rate" can be used along with "max_tx_rate".
  When both are specified, "max_tx_rate" should override.

o Change in v3:
  * IFLA_VF_RATE: When IFLA_VF_RATE is used, and user has given only one of
    min_tx_rate or max_tx_rate, reading of previous rate limits is done in
    userspace instead of in kernel space before ndo_set_vf_rate.

  * IFLA_VF_TX_RATE: When IFLA_VF_TX_RATE is used, min_tx_rate is always read
    in kernel space. This takes care of below scenarios:
    (1) when old tool sends "rate" but kernel is new (expects min and max)
    (2) when new tool sends only "rate" but kernel is old (expects only "rate")

o Change in v4 as suggested by Stephen Hemminger:
  * As per iproute policy, input and output formats should match. Changing display
    of max_tx_rate and min_tx_rate options accordingly.
./ip/ip link show p3p1
8: p3p1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT qlen 1000
        link/ether 00:0e:1e:16:ce:40 brd ff:ff:ff:ff:ff:ff
        vf 0 MAC 2a:18:8f:4d:3d:d4, tx rate 700 (Mbps), max_tx_rate 700Mbps, min_tx_rate 200Mbps
        vf 1 MAC 72:dc:ba:f9:df:fd

Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
10 years agoUpdate to current net-next kernel headers
Stephen Hemminger [Mon, 9 Jun 2014 19:50:30 +0000 (12:50 -0700)]
Update to current net-next kernel headers

Update sanitized headers

10 years agoiproute2: utils: change hexstring_n2a and hexstring_a2n to do not work with ":"
Jiri Pirko [Thu, 15 May 2014 13:10:21 +0000 (15:10 +0200)]
iproute2: utils: change hexstring_n2a and hexstring_a2n to do not work with ":"

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
10 years agoiproute2: arpd: use ll_addr_a2n and ll_addr_n2a
Jiri Pirko [Thu, 15 May 2014 13:10:20 +0000 (15:10 +0200)]
iproute2: arpd: use ll_addr_a2n and ll_addr_n2a

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
10 years agofq: allow options of fair queue set to ~0U
Yang Yingliang [Thu, 29 May 2014 04:04:34 +0000 (12:04 +0800)]
fq: allow options of fair queue set to ~0U

Some options of fair queue cannot be (~0U). It leads to maxrate
cannot be reset to unlimited because it cannot be (~0U). Allow
the options being ~0U.

Tested by the following command:
 # tc qdisc add dev eth4 root handle 1: fq limit 2000 flow_limit 200 maxrate 100mbit quantum 2000 initial_quantum 1600
 # tc -s -d qdisc show
qdisc fq 1: dev eth4 root refcnt 2 limit 2000p flow_limit 200p buckets 1024 quantum 2000 initial_quantum 1600 maxrate 100Mbit
 Sent 1492 bytes 10 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
  1 flows (0 inactive, 0 throttled)
  0 gc, 0 highprio, 0 throttled

 # tc qdisc change dev eth4 root handle 1: fq limit 4294967295 flow_limit 4294967295 maxrate 34359738360 quantum 4294967295 initial_quantum 4294967295
 # tc -s -d qdisc show
qdisc fq 1: dev eth4 root refcnt 2 limit 4294967295p flow_limit 4294967295p buckets 1024 quantum 4294967295 initial_quantum 4294967295
 Sent 38372 bytes 216 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
  2 flows (1 inactive, 0 throttled)
  0 gc, 2 highprio, 7 throttled

Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
10 years agobridge: Make filter_index match in signedness
Andreas Henriksson [Wed, 4 Jun 2014 17:40:37 +0000 (19:40 +0200)]
bridge: Make filter_index match in signedness

Michael Tautschnig wrote:

During a rebuild [...]. Please note that we use our research
compiler tool-chain (using tools from the cbmc package), which permits extended
reporting on type inconsistencies at link time.

[...]
gcc   bridge.o fdb.o monitor.o link.o mdb.o vlan.o ../lib/libnetlink.a ../lib/libutil.a  ../lib/libnetlink.a ../lib/libutil.a -o bridge
file link.c line 18: error: conflicting types for variable "filter_index"
old definition in module fdb file fdb.c line 29
signed int
new definition in module link file link.c line 18
unsigned int
<builtin>: recipe for target 'bridge' failed
make[3]: *** [bridge] Error 64
make[3]: Leaving directory '/srv/jenkins-slave/workspace/sid-goto-cc-iproute2/iproute2-3.14.0/bridge'
Makefile:45: recipe for target 'all' failed

While practical constraints may limit the value of filter_index to remain within
the bounds of a positive signed int, there is certainly no such guarantee here.
Also, a plain majority vote suggests that this really just a wrong declaration
in link.c as several declarations of filter_index as signed int exist.

[...]

My followup on this was:

I think the majority is wrong.

filter_index is assigned exclusively from if_nametoindex or ll_name_to_index
which both return unsigned int.

Changing it to unsigned everywhere seems better.

This has been minimally tested by using the bridge tool
to add vids and showing available vids on different devices.

Reported-by: Michael Tautschnig <mt@debian.org>
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
10 years agodo not exit silently when link is not found
Cong Wang [Tue, 3 Jun 2014 23:06:45 +0000 (16:06 -0700)]
do not exit silently when link is not found

When we create a tunnel on top of a link and the link specified
in cmdline doesn't exist, an error message should be shown.

Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
10 years agoss: display pacing_rate/max_pacing_rate
Eric Dumazet [Thu, 5 Jun 2014 13:47:37 +0000 (06:47 -0700)]
ss: display pacing_rate/max_pacing_rate

Since linux-3.15, kernel exports tcpi_pacing_rate and
tcpi_max_pacing_rate in tcp_info

Add TCP pacing_rate information on ss -i output :

lpaa23:~# ./ss -ti dst 10.246.7.151
State      Recv-Q Send-Q   Local Address:Port       Peer Address:Port
ESTAB      0      325800    10.246.7.151:57614
10.246.7.152:46811
 cubic wscale:7,7 rto:201 rtt:0.081/0.006 mss:1448 cwnd:90 ssthresh:63
send 12871.1Mbps pacing_rate 15397.8Mbps unacked:90 retrans:0/305
rcv_space:29200

If SO_MAX_PACING_RATE is set on the socket, we add /max_pacing_rate as
in :

... pacing_rate 1570.5Mbps/2.0Gbps ...

Signed-off-by: Eric Dumazet <edumazet@google.com>
10 years agoFix non-literal string format warnings
Stephen Hemminger [Thu, 29 May 2014 17:49:55 +0000 (10:49 -0700)]
Fix non-literal string format warnings

The lnstat program was building a format string, then using it.
This was safe, but simpler to just use format character * to
get width.

10 years agofix format warnings
Stephen Hemminger [Thu, 29 May 2014 17:31:30 +0000 (10:31 -0700)]
fix format warnings

Enable format security, and fix the warning caused by printing
with string for format.

10 years agobridge: Add learning and flood support
Vlad Yasevich [Wed, 21 May 2014 13:53:43 +0000 (09:53 -0400)]
bridge: Add learning and flood support

Add ability to control learning and flood flags on bridge
ports.

Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
10 years agoFixed 'tc qdisc show' for tbf when latency<0
Sergey V. Lobanov [Sat, 10 May 2014 23:01:14 +0000 (03:01 +0400)]
Fixed 'tc qdisc show' for tbf when latency<0

When limit<burst latency becomes <0, for example:
 # tc qdisc add dev eth0 root handle 1: tbf limit 100K burst 256K rate 256kbit
 # tc qdisc show
 qdisc tbf 1: dev eth0 root refcnt 2 rate 256Kbit burst 256Kb lat 4290.0s

If latency<0 there is no reason to show it. Limit will be printed instead of
latency when latency<0:
 # tc qdisc show
 qdisc tbf 1: dev eth0 root refcnt 2 rate 256Kbit burst 256Kb limit 100Kb

Signed-off-by: Sergey V. Lobanov <sergey@lobanov.in>
10 years agoiplink: can: fix help text and man page
Oliver Hartkopp [Thu, 15 May 2014 17:52:19 +0000 (19:52 +0200)]
iplink: can: fix help text and man page

Controller Area Network (CAN) interfaces are physical network interfaces.
They can't be 'created' like software devices by 'ip link add type can'.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
10 years agoiproute2: ipa: show port id
Jiri Pirko [Thu, 15 May 2014 13:10:22 +0000 (15:10 +0200)]
iproute2: ipa: show port id

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
10 years agoactions: correctly report the number of actions flushed
Jamal Hadi Salim [Sat, 24 May 2014 13:13:35 +0000 (09:13 -0400)]
actions: correctly report the number of actions flushed

This also fixes a long standing bug of not sanely reporting the
action chain ordering

Sample scenario test

on window 1(event window):
run "tc monitor" and observe events

on window 2:
sudo tc actions add action drop index 10
sudo tc actions add action ok index 12
sudo tc actions ls action gact
sudo tc actions flush action gact

See the event window reporting two entries
(doing another listing should show empty generic actions)

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
10 years agoactions: keyword flowid or classid terminates action pipeline
Jamal Hadi Salim [Sat, 24 May 2014 12:48:41 +0000 (08:48 -0400)]
actions: keyword flowid or classid terminates action pipeline

scenario testcase:

TC="sudo ./tc/tc"
DEV="dev eth0"
$TC qdisc del $DEV ingress
$TC qdisc add $DEV ingress
$TC filter add $DEV parent ffff: protocol ip u32 match ip src 10.0.0.0/24 action police rate 6Mbit burst 6Mbit drop flowid :1
$TC filter add $DEV parent ffff: protocol ip u32 match ip dst 10.0.0.0/24 action police rate 1Gbit burst 1Gbit pass flowid :1
$TC -s filter ls $DEV parent ffff: protocol ip
$TC qdisc del $DEV ingress
$TC qdisc add $DEV ingress
$TC filter add $DEV parent ffff: protocol ip u32 match ip src 10.0.0.0/24 flowid 1:1 action police rate 6Mbit burst 6Mbit drop
$TC filter add $DEV parent ffff: protocol ip u32 match ip dst 10.0.0.0/24 flowid 1:2 action police rate 1Gbit burst 1Gbit pass

$TC -s filter ls $DEV parent ffff: protocol ip
$TC qdisc del $DEV ingress
$TC qdisc add $DEV ingress
$TC filter add $DEV parent ffff: protocol ip pref 10 \
u32 match ip protocol 1 0xff \
flowid 1:10 \
action skbedit mark 11 \
action police rate 10kbit burst 10k pipe index 1 \
action skbedit mark 12 \
action police rate 20kbit burst 20k pipe index 2 \
action mirred egress mirror dev dummy0

$TC -s filter ls $DEV parent ffff: protocol ip
$TC qdisc del $DEV ingress
$TC qdisc add $DEV ingress
$TC filter add $DEV parent ffff: protocol ip pref 10 \
u32 match ip protocol 1 0xff \
action skbedit mark 11 \
action police rate 10kbit burst 10k pipe index 1 \
action skbedit mark 12 \
action police rate 20kbit burst 20k pipe index 2 \
action mirred egress mirror dev dummy0 \
flowid 1:10

$TC -s filter ls $DEV parent ffff: protocol ip

Reported-by: Seann Herdejurgen <seann@herdejurgen.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
10 years agoRemove unnecessary debug statement
Jamal Hadi Salim [Sat, 24 May 2014 11:46:08 +0000 (07:46 -0400)]
Remove unnecessary debug statement

Reported-by: Seann Herdejurgen <seann@herdejurgen.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
10 years agoiproute2: various header include fixes for compiling with musl libc
Natanael Copa [Tue, 27 May 2014 07:40:10 +0000 (07:40 +0000)]
iproute2: various header include fixes for compiling with musl libc

We need limits.h for LONG_MIN and LONG_MAX, sys/param.h for MIN and
sys/select for struct timeval.

This fixes the following compile errors with musl libc:

f_bpf.c: In function 'bpf_parse_opt':
f_bpf.c:181:12: error: 'LONG_MIN' undeclared (first use in this function)
   if (h == LONG_MIN || h == LONG_MAX) {
            ^
...

tc_util.o: In function `print_tcstats2_attr':
tc_util.c:(.text+0x13fe): undefined reference to `MIN'
tc_util.c:(.text+0x1465): undefined reference to `MIN'
tc_util.c:(.text+0x14ce): undefined reference to `MIN'
tc_util.c:(.text+0x154c): undefined reference to `MIN'
tc_util.c:(.text+0x160a): undefined reference to `MIN'
tc_util.o:tc_util.c:(.text+0x174e): more undefined references to `MIN' follow
...

tc_stab.o: In function `print_size_table':
tc_stab.c:(.text+0x40f): undefined reference to `MIN'
...

fdb.c:247:30: error: 'ULONG_MAX' undeclared (first use in this function)
        (vni >> 24) || vni == ULONG_MAX)
                              ^

lnstat.h:28:17: error: field 'last_read' has incomplete type
  struct timeval last_read;  /* last time of read */
                 ^

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
10 years agofix print_ipt: segfault if more then one filter with action -j MARK.
Andreas Greve [Sat, 10 May 2014 09:19:18 +0000 (11:19 +0200)]
fix print_ipt: segfault if more then one filter with action -j MARK.

BUG: tc filter show ... produce a segmentation fault if more than one
filter rule with action -j MARK exists.

Reason: In print_ipt(...) xtables will be initialzed with a
pointer to the static struct tcipt_globals at xtables_init_all().
Later on the fields .opts and .options_offset of tcipt_globals are
modified. The call of xtables_free_opts(1) at the end of print(...)
does not restore the original values of tcipt_globals for the
modified fields. It only frees some allocated memory and sets
.opts to NULL. This leads to a segmentation fault when print_ipt()
is called for the next filter rule with action -j MARK.

Fix: Cloneing tcipt_globals on the stack as tmp_tcipt_globals and
use it instead of tcipt_globals, so tcipt_globals will be not
modified.

Signed-off-by: Andreas Greve <andreas.greve@a-greve.de>
10 years agoDocument VF link state control in the ip-link man page
Or Gerlitz [Sun, 11 May 2014 06:22:19 +0000 (09:22 +0300)]
Document VF link state control in the ip-link man page

Document the support added by commit 07fa9c1 "Add VF link state
control" in the ip-link man page.

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
10 years agoipnetns: fix misprint in an error message
Mike Rapoport [Sun, 11 May 2014 09:21:26 +0000 (12:21 +0300)]
ipnetns: fix misprint in an error message

Signed-off-by: Mike Rapoport <mike.rapoport@ravellosystems.com>
10 years agoTBF man page fix (tbf is not classless)
Sergey V. Lobanov [Fri, 9 May 2014 18:12:54 +0000 (22:12 +0400)]
TBF man page fix (tbf is not classless)

TBF is not classless qdisc. man page corrected, added example
describing the use of inner qdisc

Signed-off-by: Sergey V. Lobanov <sergey@lobanov.in>
10 years agoFix Linux priority and band for TOS==0x2 (man 8 tc-prio)
Sergey V. Lobanov [Fri, 9 May 2014 19:22:42 +0000 (23:22 +0400)]
Fix Linux priority and band for TOS==0x2 (man 8 tc-prio)

Due to commit 4a2b9c3(in Linux kernel) Linux priority(skb->priority)
changed for TOS==0x2

Signed-off-by: Sergey V. Lobanov <sergey@lobanov.in>
10 years agoWhitespace and indentation cleanup
Stephen Hemminger [Fri, 9 May 2014 19:36:46 +0000 (12:36 -0700)]
Whitespace and indentation cleanup

Need to go over whole source and scrub..

10 years agoiproute2: show counter of carrier on<->off transitions
david decotigny [Tue, 6 May 2014 03:38:18 +0000 (20:38 -0700)]
iproute2: show counter of carrier on<->off transitions

This patch allows to display the current counter of carrier on<->off
transitions (IFLA_CARRIER_CHANGES, see kernel commit "expose number of
carrier on/off changes"):

  ip -s -s link show dev eth0
  32: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 ...
    link/ether ................. brd ff:ff:ff:ff:ff:ff
    RX: bytes  packets  errors  dropped overrun mcast
    125552461  258881   0       0       0       10150
    RX errors: length  crc     frame   fifo    missed
               0        0       0       0       0
    TX: bytes  packets  errors  dropped carrier collsns
    40426119   224444   0       0       0       0
    TX errors: aborted fifo    window  heartbeat transns
               0        0       0       0        3

Tested:
  - kernel with patch "net-sysfs: expose number of carrier on/off
    changes": see "transns" column above
  - kernel wthout the patch: "transns" not displayed (as expected)

Signed-off-by: David Decotigny <decot@googlers.com>
10 years agosupport for Heavy Hitter Filter (HHF) qdisc
Terry Lam [Fri, 9 May 2014 19:10:47 +0000 (12:10 -0700)]
support for Heavy Hitter Filter (HHF) qdisc

$tc qdisc add dev eth0 hhf help
Usage: ... hhf [ limit PACKETS ] [ quantum BYTES]
               [ hh_limit NUMBER ]
               [ reset_timeout TIME ]
               [ admit_bytes BYTES ]
               [ evict_timeout TIME ]
               [ non_hh_weight NUMBER ]

$tc -s -d qdisc show dev eth0
qdisc hhf 8005: root refcnt 32 limit 1000p quantum 1514 hh_limit 2048
reset_timeout 40.0ms admit_bytes 131072 evict_timeout 1.0s non_hh_weight 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
  backlog 0b 0p requeues 0
    drop_overlimit 0 hh_overlimit 0 tot_hh 0 cur_hh 0

HHF qdisc parameters:
- limit: max number of packets in qdisc (default 1000)
- quantum: max deficit per RR round (default 1 MTU)
- hh_limit: max number of HHs to keep states (default 2048)
- reset_timeout: time to reset HHF counters (default 40ms)
- admit_bytes: counter thresh to classify as HH (default 128KB)
- evict_timeout: threshold to evict idle HHs (default 1s)
- non_hh_weight:  DRR weight for mice (default 2)

Signed-off-by: Terry Lam <vtlam@google.com>
10 years agotc/netem: fix loss state display and p14 parsing
Jay Vosburgh [Fri, 9 May 2014 02:02:20 +0000 (19:02 -0700)]
tc/netem: fix loss state display and p14 parsing

The display of the entire netem loss state is shown as if it
were gemodel state, as the loss state information is assigned to the
wrong pointer.  Correct this by assigning the loss state to the correct
pointer.

Additionally, attempting to set netem loss state will result in
random values in the p14 state probability because the option value
passed to the kernel by tc netem is not parsed or initialized.  Fix this
by supplying a default value of 0 for p14 and parsing the p14 value if
one is supplied.

Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>
10 years agoiproute2: can: support CAN FD control interface
Oliver Hartkopp [Wed, 23 Apr 2014 17:27:27 +0000 (19:27 +0200)]
iproute2: can: support CAN FD control interface

For CAN FD a new set of bittiming configuration and enabling functions for the
data section is provided by the CAN driver infrastructure.

This patch allows to configure the newly introduced CAN FD properties.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
10 years agoiproute2: can: fix indention white spaces
Oliver Hartkopp [Wed, 23 Apr 2014 17:27:26 +0000 (19:27 +0200)]
iproute2: can: fix indention white spaces

When preparing a patch for CAN FD support these white space issues showed up.
Fix it in the current code to be able to provide a proper follow up patch.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
10 years agoUpdate to 3.15-rc2 headers
Stephen Hemminger [Mon, 21 Apr 2014 15:26:44 +0000 (08:26 -0700)]
Update to 3.15-rc2 headers

10 years agoMerge branch 'net-next'
Stephen Hemminger [Sat, 12 Apr 2014 01:06:13 +0000 (18:06 -0700)]
Merge branch 'net-next'

10 years agov3.14.0
Stephen Hemminger [Sat, 12 Apr 2014 00:48:41 +0000 (17:48 -0700)]
v3.14.0

10 years agoip: officially support flag mngtmpaddr also for "ip addr del"
Heiner Kallweit [Thu, 10 Apr 2014 19:16:45 +0000 (21:16 +0200)]
ip: officially support flag mngtmpaddr also for "ip addr del"

Kernel is being extended to support flag IFA_F_MANAGETEMPADDR also for
deletion of addresses. This will allow a userspace application to indicate
that for a global address the kernel should delete all related temporary
addresses as well.

"ip addr del" internally calls ipaddr_modify which silently accepts
any flag provided on the command line already, independent of the
actual command.
Therefore only the usage documentation needs to be extended.

Signed-off-by: Heiner Kallweit <heiner.kallweit@web.de>
10 years agoipaddress: do not add IFA_FLAGS when not necessary
WANG Cong [Fri, 4 Apr 2014 17:07:20 +0000 (10:07 -0700)]
ipaddress: do not add IFA_FLAGS when not necessary

commit 37c9b94ed21d5779acc23d89a4 (add support for extended ifa_flags)
introduced a regression:

        # ./ip/ip addr add 192.168.0.1/24 dev eth0
        RTNETLINK answers: Invalid argument

This is due to old kernels don't support IFA_FLAGS flag, we should not
use it if we don't use the flags beyond old .ifa_flags.

Cc: Jiri Pirko <jiri@resnulli.us>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
10 years agoveth: Handle flags correctry
Kusanagi Kouichi [Tue, 1 Apr 2014 16:09:18 +0000 (01:09 +0900)]
veth: Handle flags correctry

Flags for a peer override flags for the other and not used for the
peer.

before:
# ip link add up type veth peer down multicast off
# ip link
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: veth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 2e:5c:cd:f5:63:d2 brd ff:ff:ff:ff:ff:ff
3: veth1: <BROADCAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 72:b0:fa:1e:76:7a brd ff:ff:ff:ff:ff:ff

after:
# ip link add up type veth peer down multicast off
# ip link
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: veth0: <BROADCAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 6e:db:03:b3:bd:ff brd ff:ff:ff:ff:ff:ff
3: veth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
    link/ether a6:62:d9:84:f0:73 brd ff:ff:ff:ff:ff:ff

Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
10 years agofix indentation of ip neighbour man page
Stephen Hemminger [Tue, 1 Apr 2014 03:23:40 +0000 (20:23 -0700)]
fix indentation of ip neighbour man page

Formatting was awful and unclear on ip neighbour

10 years agoipxfrm: allow to setup filter when dumping SA
Nicolas Dichtel [Fri, 21 Mar 2014 10:02:43 +0000 (11:02 +0100)]
ipxfrm: allow to setup filter when dumping SA

It's now possible to filter SA directly into the kernel by specifying
XFRMA_PROTO and/or XFRMA_ADDRESS_FILTER.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
10 years agoMerge branch 'master' into net-next
Stephen Hemminger [Fri, 21 Mar 2014 21:24:22 +0000 (14:24 -0700)]
Merge branch 'master' into net-next

10 years agobridge: fix reporting of IPv6 addresses
Mike Rapoport [Thu, 20 Mar 2014 11:06:10 +0000 (13:06 +0200)]
bridge: fix reporting of IPv6 addresses

Signed-off-by: Mike Rapoport <mike.rapoport@ravellosystems.com>
10 years agoiproute: Show default type, table, proto and scope of route
Masatake YAMATO [Wed, 12 Mar 2014 03:46:53 +0000 (12:46 +0900)]
iproute: Show default type, table, proto and scope of route

In "ip route show" output unicast type, main table, boot protocol and
universe scope are hidden as default labels.

Sometimes it is helpful to show the hidden label for people not enough
familiar with routing subsystem to map the output of "ip route show" and
kernel source code.

With this patch "ip route show" with -d option shows the default labels.

Example of difference of output with -d option:

    $ ./ip/ip -4   route show table all dev virbr1
    ...
    192.168.121.0/28  proto kernel  scope link  src 192.168.121.1
    ...
    $ ./ip/ip -4 -d  route show table all dev virbr1
    ...
    unicast 192.168.121.0/28  table main  proto kernel  scope link  src 192.168.121.1
    ...

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
10 years agohtb: Move direct_qlen code part to htb_parse_opt().
Hiroaki SHIMODA [Sat, 8 Mar 2014 13:10:03 +0000 (22:10 +0900)]
htb: Move direct_qlen code part to htb_parse_opt().

The direct_qlen command option is used with qdisc operation.
It happened to be implemented in htb_parse_class_opt() which is called
with class operation.

Signed-off-by: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
10 years agoUpdate headers to net-next
Stephen Hemminger [Fri, 21 Mar 2014 21:16:17 +0000 (14:16 -0700)]
Update headers to net-next

10 years agoss: Add support for retrieving SELinux contexts
Richard Haines [Fri, 7 Mar 2014 10:36:52 +0000 (10:36 +0000)]
ss: Add support for retrieving SELinux contexts

The process SELinux contexts can be added to the output using the -Z
option. Using the -z option will show the process and socket contexts (see
the man page for details).
For netlink sockets: if valid process show process context, if pid = 0
show kernel initial context, if unknown show "unavailable".

Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
10 years agoiproute2: use named constants instead of number literals to fill rtnl_rttable_hash
Masatake YAMATO [Fri, 7 Mar 2014 10:21:37 +0000 (19:21 +0900)]
iproute2: use named constants instead of number literals to fill rtnl_rttable_hash

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
10 years agoiproute2: use named constants instead of number literals to fill rtnl_rtscope_tab
Masatake YAMATO [Fri, 7 Mar 2014 10:21:36 +0000 (19:21 +0900)]
iproute2: use named constants instead of number literals to fill rtnl_rtscope_tab

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
10 years agoiproute2: add man page for mqprio
John Fastabend [Mon, 3 Mar 2014 17:38:20 +0000 (09:38 -0800)]
iproute2: add man page for mqprio

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
10 years agoiplink_bond_slave: show mii_status only once
Michal Kubeček [Fri, 28 Feb 2014 13:58:15 +0000 (14:58 +0100)]
iplink_bond_slave: show mii_status only once

With "ip -d link show", bonding slave mii status is displayed
twice, once as a number and once as a name.

Fixes: 730d3f61 ("iplink: add support for bonding slave")
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
10 years agoiplink_bond: fix parameter value matching
Michal Kubeček [Thu, 13 Feb 2014 16:31:59 +0000 (17:31 +0100)]
iplink_bond: fix parameter value matching

Lookup function get_index() compares argument with table entries
only up to the length of the table entry so that if an entry
with lower index is a substring of a later one, earlier entry is
used even if the argument is equal to the other. For example,

  ip link set bond0 type bond xmit_hash_policy layer2+3

sets xmit_hash_policy to 0 (layer2) as this is found before
"layer2+3" can be checked.

Use strcmp() to compare whole strings instead.

v2: look for an exact match only

Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
10 years agokill spaces before tabs
Stephen Hemminger [Mon, 17 Feb 2014 18:56:31 +0000 (10:56 -0800)]
kill spaces before tabs

10 years agoRemove trailing whitespace
Stephen Hemminger [Mon, 17 Feb 2014 18:55:31 +0000 (10:55 -0800)]
Remove trailing whitespace

10 years agoiplink: add support for bonding slave
Jiri Pirko [Thu, 23 Jan 2014 16:52:54 +0000 (17:52 +0100)]
iplink: add support for bonding slave

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
10 years agointroduce support for slave info data
Jiri Pirko [Thu, 23 Jan 2014 16:52:53 +0000 (17:52 +0100)]
introduce support for slave info data

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
10 years agoiplink_bond: fix arp_all_targets parameter name in output
Michal Kubeček [Thu, 6 Feb 2014 11:47:33 +0000 (12:47 +0100)]
iplink_bond: fix arp_all_targets parameter name in output

Name of arp_all_targets parameter in output of "ip -d link show"
is missing trailing "s".

Fixes: 63d127b0 ("iproute2: finish support for bonding attributes")
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
10 years agoss: display interface name as zone index when needed
FX Le Bail [Tue, 11 Feb 2014 09:06:23 +0000 (10:06 +0100)]
ss: display interface name as zone index when needed

This change enable the ss command to display the interface name as zone index
for local addresses when needed.

For this enhanced display *_diag stuff is needed.

It is based on a first version by Bernd Eckenfels.

example:
Netid  State   Recv-Q Send-Q                 Local Address:Port    Peer Address:Port
udp    UNCONN  0      0      fe80::20c:29ff:fe1f:7406%eth1:9999              :::*
udp    UNCONN  0      0                                 :::domain            :::*
tcp    LISTEN  0      3                                 :::domain            :::*
tcp    LISTEN  0      5      fe80::20c:29ff:fe1f:7410%eth2:99                :::*

Signed-off-by: Francois-Xavier Le Bail <fx.lebail@yahoo.com>
10 years agoiproute: Fix Netid value for multi-families output
Pavel Emelyanov [Tue, 28 Jan 2014 06:24:15 +0000 (10:24 +0400)]
iproute: Fix Netid value for multi-families output

When requesting simultaneous output of TCP and UDP sockets
the netid field shows "tcp" always.

[root@xemvm1 iproute2]# ./misc/ss -a -tu
Netid State      Recv-Q Send-Q                            Local Address:Port                                Peer Address:Port
tcp   UNCONN     0      0                                             *:32713                                          *:*
tcp   UNCONN     0      0                                             *:bootpc                                         *:*
tcp   UNCONN     0      0                                            :::57879                                         :::*
tcp   LISTEN     0      128                                           *:ssh                                            *:*
tcp   ESTAB      0      48                                      1.2.3.5:ssh                                      1.2.3.4:45826
tcp   ESTAB      0      0                                       1.2.3.5:ssh                                      1.2.3.4:45814
tcp   LISTEN     0      128                                          :::ssh                                           :::*

While the 1st 3 sockets are UDP ones:

[root@xemvm1 iproute2]# ./misc/ss -a -u
State       Recv-Q Send-Q                              Local Address:Port                                  Peer Address:Port
UNCONN      0      0                                               *:32713                                            *:*
UNCONN      0      0                                               *:bootpc                                           *:*
UNCONN      0      0                                              :::57879                                           :::*

Reported-by: François-Xavier Le Bail <fx.lebail@yahoo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Tested-by: François-Xavier Le Bail <fx.lebail@yahoo.com>
10 years agotcp_metrics: Allow removal based on the source-IP
Christoph Paasch [Thu, 6 Feb 2014 22:15:04 +0000 (23:15 +0100)]
tcp_metrics: Allow removal based on the source-IP

This patch allows adding the source-IP attribute to the netlink-command.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
10 years agotcp_metrics: Display source-address
Christoph Paasch [Thu, 6 Feb 2014 22:15:03 +0000 (23:15 +0100)]
tcp_metrics: Display source-address

This patch allows to display the source-IP.
stype will be used in the next patch that allows to remove based on the
source-IP.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
10 years agotcp_metrics: Rename addr to daddr and add local variable
Christoph Paasch [Thu, 6 Feb 2014 22:15:02 +0000 (23:15 +0100)]
tcp_metrics: Rename addr to daddr and add local variable

Renaming addr to daddr, because we will introduce saddr later.

The local variable is necessary to store RTA_PAYLOAD(a) temporarily.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
10 years agopedit: do not print debugging information by default
WANG Cong [Wed, 29 Jan 2014 23:12:59 +0000 (15:12 -0800)]
pedit: do not print debugging information by default

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
10 years agogenl: fix a typo in help message of ctrl
Masatake YAMATO [Wed, 29 Jan 2014 11:30:15 +0000 (20:30 +0900)]
genl: fix a typo in help message of ctrl

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
10 years agoUpdate kernel headers to 3.13-rc2
Stephen Hemminger [Mon, 10 Feb 2014 22:40:33 +0000 (14:40 -0800)]
Update kernel headers to 3.13-rc2

10 years agoMerge branch 'net-next-for-3.13'
Stephen Hemminger [Mon, 10 Feb 2014 22:39:20 +0000 (14:39 -0800)]
Merge branch 'net-next-for-3.13'

10 years agoPIE: Add man page
Mythili Prabhu [Fri, 17 Jan 2014 03:39:52 +0000 (19:39 -0800)]
PIE: Add man page

This adds the manpage for  PIE: Proportional Integral controller Enhanced AQM
scheme.

Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com>
Signed-off-by: Vijay Subramanian <vijaynsu@cisco.com>
CC: Dave Taht <dave.taht@bufferbloat.net>
10 years agonetem: add 64bit rates support
Yang Yingliang [Thu, 16 Jan 2014 03:09:14 +0000 (11:09 +0800)]
netem: add 64bit rates support

netem support 64bit rates start from linux-3.13.
Add 64bit rates support in tc tools.

tc qdisc show dev eth0
qdisc netem 1: dev eth4 root refcnt 2 limit 1000 rate 35Gbit

Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Acked-by: Eric Dumazet <edumazet@google.com>
10 years agotbf: support sending burst/mtu to kernel directly
Yang Yingliang [Thu, 16 Jan 2014 03:09:13 +0000 (11:09 +0800)]
tbf: support sending burst/mtu to kernel directly

To avoid loss when transforming burst to buffer in userspace, send
burst/mtu to kernel directly.

Kernel commit 2e04ad424b("sch_tbf: add TBF_BURST/TBF_PBURST attribute")
make it can handle burst/mtu.

Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
10 years agoadd support for IFA_F_NOPREFIXROUTE
Thomas Haller [Tue, 7 Jan 2014 20:46:28 +0000 (21:46 +0100)]
add support for IFA_F_NOPREFIXROUTE

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoadd support for IFA_F_MANAGETEMPADDR
Jiri Pirko [Mon, 6 Jan 2014 09:17:10 +0000 (10:17 +0100)]
add support for IFA_F_MANAGETEMPADDR

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
10 years agoUpdate headers files from net-next
Stephen Hemminger [Mon, 20 Jan 2014 20:28:42 +0000 (12:28 -0800)]
Update headers files from net-next