]> git.ipfire.org Git - thirdparty/iproute2.git/log
thirdparty/iproute2.git
10 years agoss: Remove checking SS_CLOSE state for packet and netlink
vadimk [Thu, 16 Oct 2014 08:19:29 +0000 (11:19 +0300)] 
ss: Remove checking SS_CLOSE state for packet and netlink

I dont see a reason that packet and netlink states will be
printed only if SS_CLOSE state is set in filter, in that case
to print states of netlink or packet sockets it is needed to run:

    ss -A netlink state close

instead of:

    ss -A netlink

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
10 years agoip netns: Identify netns for the current process
vadimk [Fri, 7 Nov 2014 16:25:30 +0000 (18:25 +0200)] 
ip netns: Identify netns for the current process

As 'ip' util will share the same netns from the caller
process then we can just look at /proc/self/.. to show
the netns of the current process by:

    ip netns id

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
10 years agotests: Move tc related tests to testsuite/tests/tc folder
vadimk [Fri, 31 Oct 2014 08:03:44 +0000 (10:03 +0200)] 
tests: Move tc related tests to testsuite/tests/tc folder

With this change the results of tc tests will be recorded under:

    testsuite/results/tc/

The ip related tests can be added under:

    testsuite/tests/ip

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
10 years agoip monitor: Allow to filter events by dev
vadimk [Mon, 20 Oct 2014 09:25:17 +0000 (12:25 +0300)] 
ip monitor: Allow to filter events by dev

Added 'dev' option to allow filtering events by device.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
10 years agoss: Identify more netlink protocol names
vadimk [Thu, 30 Oct 2014 15:33:36 +0000 (17:33 +0200)] 
ss: Identify more netlink protocol names

There were only few Netlink protocol names
which were printed on the screen:

    rtnl, fw, tcpdiag

So added the ability to identify Netlink proto name
from /etc/iproute/nl_protos or from static table.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
10 years agovxlan: Add support for enabling UDP checksums
Tom Herbert [Fri, 7 Nov 2014 16:05:34 +0000 (08:05 -0800)] 
vxlan: Add support for enabling UDP checksums

Add udpcsum option to enable transmitting UDP checksums when doing
VXLAN/IPv4. Add udp6zerocsumtx, and udp6zerocsumrx options to enable
sending zero checksums and receiving zero checksums in VXLAN/IPv6.

Signed-off-by: Tom Herbert <therbert@google.com>
10 years agoip-link: Document IPoIB link type in the man page
Or Gerlitz [Sun, 16 Nov 2014 07:43:34 +0000 (09:43 +0200)] 
ip-link: Document IPoIB link type in the man page

Add documentation on how to create devices of type IP-over-Infiniband
in the man page.

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
10 years agoutils: relax strtoX checking in get_time_rtt
Florian Westphal [Tue, 11 Nov 2014 00:38:21 +0000 (01:38 +0100)] 
utils: relax strtoX checking in get_time_rtt

ip route change dev tap0 192.168.7.0/24 rto_min 1ms
Error: argument "1ms" is wrong: "rto_min" value is invalid

get_time_rtt() checks for 's' or 'msec' and converts to milliseconds
if needed.

Fixes: 697ac63905 (utils: fix range checking for get_u32/get_u64 et all)
Signed-off-by: Florian Westphal <fw@strlen.de>
10 years agoiproute2: Man pages for fou and gue
Tom Herbert [Wed, 5 Nov 2014 18:06:28 +0000 (10:06 -0800)] 
iproute2: Man pages for fou and gue

Man pages for Foo-over-UDP and Generic UDP Encapsulation receive
port configuration. gue man page links to fou one.

Signed-off-by: Tom Herbert <therbert@google.com>
10 years agoip link gre: Add support to configure FOU and GUE
Tom Herbert [Wed, 5 Nov 2014 18:06:26 +0000 (10:06 -0800)] 
ip link gre: Add support to configure FOU and GUE

This patch adds support to configure foo-over-udp (FOU) and Generic
UDP Encapsulation for GRE tunnels. This configuration allows selection
of FOU or GUE for the tunnel, specification of the source and
destination ports for UDP tunnel, and enabling TX checksum. This
configuration only affects the transmit side of a tunnel.

Example:

ip link add name tun1 type gre remote 192.168.1.1 local 192.168.1.2 \
   ttl 225 encap fou encap-sport auto encap-dport 7777 encap-csum

This would create an GRE tunnel in GUE encapsulation where the source
port is automatically selected (based on hash of inner packet) and
checksums in the encapsulating UDP header are enabled.

Signed-off-by: Tom Herbert <therbert@google.com>
10 years agoip link ipip: Add support to configure FOU and GUE
Tom Herbert [Wed, 5 Nov 2014 18:06:25 +0000 (10:06 -0800)] 
ip link ipip: Add support to configure FOU and GUE

This patch adds support to configure foo-over-udp (FOU) and Generic
UDP Encapsulation for IPIP and sit tunnels. This configuration allows
selection of FOU or GUE for the tunnel, specification of the source and
destination ports for UDP tunnel, and enabling TX checksum. This
configuration only affects the transmit side of a tunnel.

Example:

ip link add name tun1 type ipip remote 192.168.1.1 local 192.168.1.2 \
   ttl 225 encap gue encap-sport auto encap-dport 9999 encap-csum

This would create an IPIP tunnel in GUE encapsulation where the source
port is automatically selected (based on hash of inner packet) and
checksums in the encapsulating UDP header are enabled.

Signed-off-by: Tom Herbert <therbert@google.com>
10 years agoip fou: Support to configure foo-over-udp RX
Tom Herbert [Wed, 5 Nov 2014 18:06:24 +0000 (10:06 -0800)] 
ip fou: Support to configure foo-over-udp RX

Added 'ip fou...' commands to enable/disable UDP ports for doing
foo-over-udp and Generic UDP Encapsulation variant. Arguments are port
number to bind to and IP protocol to map to port (for direct FOU).

Examples:

ip fou add port 7777 gue
ip fou add port 8888 ipproto 4

The first command creates a GUE port, the second creates a direct FOU
port for IPIP (receive payload is a assumed to be an IPv4 packet).

Signed-off-by: Tom Herbert <therbert@google.com>
10 years agoman: ip-link: fix a typo
Masatake YAMATO [Thu, 6 Nov 2014 18:57:05 +0000 (03:57 +0900)] 
man: ip-link: fix a typo

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
10 years agoip-link: in human readable output use dynamic precision length
Christian Hesse [Tue, 4 Nov 2014 21:17:15 +0000 (22:17 +0100)] 
ip-link: in human readable output use dynamic precision length

10 years agodoc ip-cref: Added missing ip options
vadimk [Tue, 4 Nov 2014 16:54:30 +0000 (18:54 +0200)] 
doc ip-cref: Added missing ip options

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
10 years agoip-link: fix column alignment
Christian Hesse [Mon, 3 Nov 2014 07:21:11 +0000 (08:21 +0100)] 
ip-link: fix column alignment

Width is the maximum number of characters used for the value, excluding a
field separator. So append a single whitespace.

10 years agoip: add iec formatted option and cleanup code
Stephen Hemminger [Sun, 2 Nov 2014 20:49:19 +0000 (12:49 -0800)] 
ip: add iec formatted option and cleanup code

Add a new -iec option in addition to -human.
Cleanup code so the formatting of numbers is done in one function,
not 2 ways and 2 sizes.

10 years agoip-link: add switch to show human readable output
Christian Hesse [Fri, 31 Oct 2014 21:33:13 +0000 (22:33 +0100)] 
ip-link: add switch to show human readable output

Byte and packet count can increase to really big numbers. This adds a
switch to show human readable output.

4: wl: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000
    link/ether 00:de:ad:be:ee:ef brd ff:ff:ff:ff:ff:ff
    RX: bytes  packets  errors  dropped overrun mcast
    1523846973 3969051  0       0       0       0
    TX: bytes  packets  errors  dropped carrier collsns
    8710088361 6077735  0       0       0       0
4: wl: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000
    link/ether 00:de:ad:be:ee:ef brd ff:ff:ff:ff:ff:ff
    RX: bytes  packets  errors  dropped overrun mcast
    1.5G       3.9M     0       0       0       0
    TX: bytes  packets  errors  dropped carrier collsns
    8.7G       6.0M     0       0       0       0

10 years agoiproute2: ip6_tunnel mode bugfixes: any,vti6
Alexey Andriyanov [Wed, 29 Oct 2014 06:19:30 +0000 (09:19 +0300)] 
iproute2: ip6_tunnel mode bugfixes: any,vti6

- any ipv6 tunnel mode (proto == 0) could not be set
due to incomplete set of cases in do_add, do_del.
- vti6 logic was inverted: it was using "ip6_vti0" basedev
UNLESS mode is set to vti6.

We don't need a switch by p.proto in do_add()/do_del(): it
already exists in parse_args(). So if parse_args() call
was successful, no need to check tunnel mode again.

Signed-off-by: Alexey Andriyanov <alan@al-an.info>
10 years agoman: update doc after support of ESN and anti-replay window
Nicolas Dichtel [Thu, 30 Oct 2014 08:18:48 +0000 (01:18 -0700)] 
man: update doc after support of ESN and anti-replay window

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
10 years agoMerge branch 'net-next'
Stephen Hemminger [Thu, 30 Oct 2014 16:38:56 +0000 (09:38 -0700)] 
Merge branch 'net-next'

Conflicts:
include/linux/if_tunnel.h

10 years agoxfrm: add support of ESN and anti-replay window
dingzhi [Mon, 20 Oct 2014 09:23:04 +0000 (11:23 +0200)] 
xfrm: add support of ESN and anti-replay window

This patch allows to configure ESN and anti-replay window.

Signed-off-by: dingzhi <zhi.ding@6wind.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
10 years agonetlink: extend buffers to 16K
Eric Dumazet [Sat, 11 Oct 2014 16:43:13 +0000 (09:43 -0700)] 
netlink: extend buffers to 16K

Starting from linux-3.15 (commit 9063e21fb026, "netlink: autosize skb
lengths"), kernel is able to send up to 16K in netlink replies.

This change enables iproute2 commands to get bigger chunks,
without breaking compatibility with old kernels.

Signed-off-by: Eric Dumazet <edumazet@google.com>
10 years agoss: output dctcp diag information
Daniel Borkmann [Mon, 29 Sep 2014 08:47:32 +0000 (10:47 +0200)] 
ss: output dctcp diag information

Dump useful DCTCP state/debug information gathered from diag.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
10 years agoUpdate kernel headers to 3.18-rc2
Stephen Hemminger [Thu, 30 Oct 2014 05:32:02 +0000 (22:32 -0700)] 
Update kernel headers to 3.18-rc2

10 years agotests: Allow to run tests recursively
vadimk [Fri, 10 Oct 2014 06:27:19 +0000 (09:27 +0300)] 
tests: Allow to run tests recursively

Such approach allows to run *.t scripts from any
tests/ subdirectories.

One point is that tests from tests/cls/*.t (which are needed
by tests/cls-testbed.t but does not exist yet) will also
be ran aside with tests/cls-testbed.t which is not good
because in such case they will be ran twice, so renamed these
tests path to tests/cls/*.c in tests/cls-testbed.t

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
10 years agotests: Skip cls-testbed.t if tests/cls dir does not exist
vadimk [Thu, 9 Oct 2014 15:51:24 +0000 (18:51 +0300)] 
tests: Skip cls-testbed.t if tests/cls dir does not exist

Curently tests/cls-testbed.t tries to run any *.t in
tests/cls/ folder but such folder does not exist.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
10 years agoman ip: Add missing '-details' option
vadimk [Mon, 27 Oct 2014 15:22:58 +0000 (17:22 +0200)] 
man ip: Add missing '-details' option

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
10 years agogitignore: Ignore 'doc' files generated at runtime
vadimk [Sun, 26 Oct 2014 10:18:56 +0000 (12:18 +0200)] 
gitignore: Ignore 'doc' files generated at runtime

The list is based on doc/Makefile 'clean' target

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
10 years agodoc make: Add *.pdf files to the 'clean' target
vadimk [Sun, 26 Oct 2014 09:52:03 +0000 (11:52 +0200)] 
doc make: Add *.pdf files to the 'clean' target

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
10 years agoman ip-link: Fixed missing 'up' option in 'ip link show' synopsis
vadimk [Tue, 14 Oct 2014 15:01:34 +0000 (18:01 +0300)] 
man ip-link: Fixed missing 'up' option in 'ip link show' synopsis

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
10 years agov3.17.0 v3.17.0
Stephen Hemminger [Thu, 9 Oct 2014 15:40:14 +0000 (08:40 -0700)] 
v3.17.0

10 years agoemp: fix warning on deprecated bison directive
Stephen Hemminger [Thu, 9 Oct 2014 15:31:10 +0000 (08:31 -0700)] 
emp: fix warning on deprecated bison directive

emp_ematch.y:12.1-13: warning: deprecated directive, use ‘%name-prefix’ [-Wdeprecated]
 %name-prefix="ematch_"
 ^^^^^^^^^^^^^

10 years agoip link: Shortify printing the usage of link type
vadimk [Tue, 30 Sep 2014 05:17:31 +0000 (08:17 +0300)] 
ip link: Shortify printing the usage of link type

Allow to print particular link type usage by:

    ip link help [TYPE]

Currently to print usage for some link type it is needed
to use the following way:

    ip link { add | del | set } type TYPE help

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
10 years agotests: Check existing of /proc/config.gz before use it
vadimk [Tue, 30 Sep 2014 06:15:10 +0000 (09:15 +0300)] 
tests: Check existing of /proc/config.gz before use it

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
10 years agodiscourage use of direct policer interface
Jamal Hadi Salim [Mon, 6 Oct 2014 11:41:21 +0000 (07:41 -0400)] 
discourage use of direct policer interface

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
10 years agoroute classifier support for multiple actions
Jamal Hadi Salim [Mon, 6 Oct 2014 11:30:17 +0000 (07:30 -0400)] 
route classifier support for multiple actions

route can now use the action syntax

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
10 years agotcindex classifier support for multiple actions
Jamal Hadi Salim [Mon, 6 Oct 2014 11:30:16 +0000 (07:30 -0400)] 
tcindex classifier support for multiple actions

tcindex can now use the action syntax

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
10 years agoip tunnel: fix 'ip -oneline tunnel show' for some GRE tunnels
Dmitry Popov [Sat, 4 Oct 2014 15:00:25 +0000 (19:00 +0400)] 
ip tunnel: fix 'ip -oneline tunnel show' for some GRE tunnels

'ip -oneline tunnel show' was not "oneline" for GRE tunnels with iseq:
# ip tun add gre_test remote 1.1.1.1 local 2.2.2.2 mode gre iseq oseq
# ip -oneline tun show gre_test | wc -l
2

The problem existed because of a typo: '\n' was printed when it shouldn't be.
Fixed.

Signed-off-by: Dmitry Popov <ixaphire@qrator.net>
10 years agoip address: print stats with -s
Jiri Benc [Fri, 3 Oct 2014 13:25:02 +0000 (15:25 +0200)] 
ip address: print stats with -s

Make ip address show accept the -s option similarly to ip link. This creates
an one command replacement for "ifconfig -a" useful for people who still
stay with ifconfig because of this feature.

Print the stats as the last thing for the interface. This requires some code
shuffling.

Signed-off-by: Jiri Benc <jbenc@redhat.com>
10 years agoss: add more tcp socket diagnostics
Eric Dumazet [Wed, 1 Oct 2014 11:17:18 +0000 (04:17 -0700)] 
ss: add more tcp socket diagnostics

Display 4 additional tcp socket info fields :

backoff : exponential backoff
lastsnd : time in milli second since last send
lastrcv : time in milli second since last receive
lastack : time in milli second since last acknowledgement

$ ss -ti dst :22
State       Recv-Q Send-Q                  Local Address:Port
Peer Address:Port
ESTAB       0      0                        172.16.5.1:58470
172.17.131.143:ssh
 cubic wscale:7,7 rto:228 rtt:30/20 ato:40 mss:1256 cwnd:6 ssthresh:4
send 2.0Mbps lastsnd:3480 lastrcv:3464 lastack:3464 rcv_rtt:81.5
rcv_space:87812

Signed-off-by: Eric Dumazet <edumazet@google.com>
10 years agoiplink: do not require assigning negative ifindex at link creation
Atzm Watanabe [Wed, 1 Oct 2014 05:47:50 +0000 (14:47 +0900)] 
iplink: do not require assigning negative ifindex at link creation

Since commit 3c682146aeff, iplink requires assigning negative
ifindex (-1) to the kernel when creating interface without
specifying index.

v2: checking whether index is -1, suggested by Cong Wang.

Cc: Cong Wang <cwang@twopensource.com>
Signed-off-by: Atzm Watanabe <atzm@stratosphere.co.jp>
Acked-by: Cong Wang <cwang@twopensource.com>
10 years agotests: Allow policer test to be ran
vadimk [Mon, 29 Sep 2014 22:22:22 +0000 (01:22 +0300)] 
tests: Allow policer test to be ran

Renamed testsuite/tests/policer to testsuite/tests/policer.t

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
10 years agotests: Add runtime generated files to .gitignore
vadimk [Mon, 29 Sep 2014 20:35:38 +0000 (23:35 +0300)] 
tests: Add runtime generated files to .gitignore

When make tests then 2 folders are generated:

    testsuite/results
    testsuite/iproute2/iproute2-this

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
10 years agoip monitor: Changed 'Unknown message' format to be more informative
vadimk [Mon, 29 Sep 2014 20:07:57 +0000 (23:07 +0300)] 
ip monitor: Changed 'Unknown message' format to be more informative

In case if unknown message was handled then it will be displayed as:

    Unknown message: type=0x00000044(68) flags=0x00000000(0) len=0x0000004c(76)

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
10 years agoadd missing underscore to man page and example nf_mark ematch
Andy Furniss [Mon, 29 Sep 2014 19:43:01 +0000 (20:43 +0100)] 
add missing underscore to man page and example nf_mark ematch

The man page and the "fail" example are missing an underscore in the
nf_mark ematch.

eg.

tc filter add dev eth0 parent ffff:  basic match 'meta(nfmark gt 24)'
classid 2:4

meta: unknown meta id

... >>meta(nfmark gt 24)<< ...
... meta(>>nfmark<< gt 24)...
Usage: meta(OBJECT { eq | lt | gt } OBJECT)
where: OBJECT  := { META_ID | VALUE }
        META_ID := id [ shift SHIFT ] [ mask MASK ]

Example: meta(nfmark gt 24)
          meta(indev shift 1 eq "ppp")
          meta(tcindex mask 0xf0 eq 0xf0)

For a list of meta identifiers, use meta(list).
Illegal "ematch"

meta(list) does correctly show nf_mark and the above test works with
nf_mark.

Signed-off-by: Andy Furniss adf.lists@gmail.com
10 years agoip netns: Create /var/run/netns dir when do 'ip netns monitor'
vadimk [Sun, 31 Aug 2014 19:45:29 +0000 (22:45 +0300)] 
ip netns: Create /var/run/netns dir when do 'ip netns monitor'

netns monitor fails when there is no /var/run/netns dir
which might be created later while monitoring.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
10 years agotests: Fix problem with test running
vadimk [Sat, 6 Sep 2014 10:27:07 +0000 (13:27 +0300)] 
tests: Fix problem with test running

Tests were not allowed to be ran, the following
issues were fixed:
    - creating the results folder before test running
    - sudo $PREFIX moved before variables definition which
        allow to pass them through the sudo to test script.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
10 years agorsvp classifier support for multiple actions
Jamal Hadi Salim [Sun, 28 Sep 2014 16:49:53 +0000 (12:49 -0400)] 
rsvp classifier support for multiple actions

Example setup:

sudo tc qdisc del dev eth0 root handle 1:0 prio
sudo tc qdisc add dev eth0 root handle 1:0 prio

sudo tc filter add dev eth0 pref 10 proto ip parent 1:0 \
rsvp session 10.0.0.1 ipproto icmp \
classid 1:1  \
action police rate 1kbit burst 90k pipe \
action ok

tc -s filter show dev eth0 parent 1:0

filter protocol ip pref 10 rsvp
filter protocol ip pref 10 rsvp fh 0x0001100a flowid 1:1 session
10.0.0.1 ipproto icmp
        action order 1:  police 0x5 rate 1Kbit burst 23440b mtu 2Kb
action pipe overhead 0b
ref 1 bind 1
        Action statistics:
        Sent 98000 bytes 1000 pkt (dropped 0, overlimits 761 requeues 0)
        backlog 0b 0p requeues 0

        action order 2: gact action pass
         random type none pass val 0
         index 2 ref 1 bind 1 installed 60 sec used 3 sec
        Action statistics:
        Sent 74578 bytes 761 pkt (dropped 0, overlimits 0 requeues 0)
        backlog 0b 0p requeues 0

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Tested-by: John Fastabend <john.r.fastabend@intel.com>
10 years agoactions: BugFix action stats to display with -s
Jamal Hadi Salim [Sun, 21 Sep 2014 16:29:14 +0000 (12:29 -0400)] 
actions: BugFix action stats to display with -s

Was broken by commit 288abf513f5d11b98f09c6977d2019097afb7e9f
Lets not be too clever and have a separate call to print flushed
actions info.

Broken looks like:
root@moja-1:~# tc actions add  action drop index 4
root@moja-1:~# tc -s actions ls action gact

    action order 0: gact action drop
     random type none pass val 0
     index 4 ref 1 bind 0 installed 9 sec used 4 sec

The fixed version looks like:
    action order 0: gact action drop
     random type none pass val 0
     index 4 ref 1 bind 0 installed 9 sec used 4 sec
         Sent 108948 bytes 1297 pkts (dropped 1297, overlimits 0)

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
10 years agoadd bridge master device support
Jiri Pirko [Sun, 28 Sep 2014 23:33:29 +0000 (16:33 -0700)] 
add bridge master device support

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
10 years agoadd bridge_slave device support
Jiri Pirko [Sun, 28 Sep 2014 23:31:04 +0000 (16:31 -0700)] 
add bridge_slave device support

Note this depends on "iproute2: allow to change slave options via
type_slave"

10 years agoupdate headers to 3.17.0 net-next
Stephen Hemminger [Sun, 28 Sep 2014 23:28:00 +0000 (16:28 -0700)] 
update headers to 3.17.0 net-next

10 years agoiproute2: VTI6 support for ip -6 link command.
Steffen Klassert [Fri, 26 Sep 2014 07:11:37 +0000 (09:11 +0200)] 
iproute2: VTI6 support for ip -6 link command.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
10 years agoiproute2: Add support for IPv6 VTI tunnels to ip6tunnel
Steffen Klassert [Fri, 26 Sep 2014 07:10:56 +0000 (09:10 +0200)] 
iproute2: Add support for IPv6 VTI tunnels to ip6tunnel

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
10 years agoip tuntap: Added missing commands in usage
vadimk [Tue, 16 Sep 2014 21:24:11 +0000 (00:24 +0300)] 
ip tuntap: Added missing commands in usage

show, list, lst and help commands were not printed in usage.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
10 years agoip tuntap: Add checking if tun/tap mode was set by default
vadimk [Tue, 16 Sep 2014 20:54:34 +0000 (23:54 +0300)] 
ip tuntap: Add checking if tun/tap mode was set by default

This checking was performed only when adding interface but
it is needed also when deleting, otherwise the error will be:

    ioctl(TUNSETIFF): Invalid argument

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
10 years agoip/vxlan: fix display of maxaddress option
Nicolas Dichtel [Tue, 9 Sep 2014 14:55:11 +0000 (16:55 +0200)] 
ip/vxlan: fix display of maxaddress option

Parenthesis are required else maxaddr value is a bool and thus output is always
1 when the option is set.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
10 years agoip/vxlan: add a help for ageing and maxaddress options
Nicolas Dichtel [Tue, 9 Sep 2014 14:55:10 +0000 (16:55 +0200)] 
ip/vxlan: add a help for ageing and maxaddress options

These options were missing in usage and man pages.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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.

10 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>
10 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>
10 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>
10 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>
10 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>
11 years agoMerge branch 'net-next'
Stephen Hemminger [Mon, 4 Aug 2014 19:58:36 +0000 (12:58 -0700)] 
Merge branch 'net-next'

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

11 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>
11 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

11 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

11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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

11 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>
11 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.

11 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.

11 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

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

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

11 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>
11 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>
11 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

11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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.