summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* iproute: Set flags and attributes on dump to get IPv6 cached routes to be ↵devlink-prStefano Brivio2019-06-261-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | flushed With a current (5.1) kernel version, IPv6 exception routes can't be listed (ip -6 route list cache) or flushed (ip -6 route flush cache). Kernel support for this is being added back. Relevant net-next commits: 564c91f7e563 fib_frontend, ip6_fib: Select routes or exceptions dump from RTM_F_CLONED ef11209d4219 Revert "net/ipv6: Bail early if user only wants cloned entries" 3401bfb1638e ipv6/route: Don't match on fc_nh_id if not set in ip6_route_del() bf9a8a061ddc ipv6/route: Change return code of rt6_dump_route() for partial node dumps 1e47b4837f3b ipv6: Dump route exceptions if requested 40cb35d5dc04 ip6_fib: Don't discard nodes with valid routing information in fib6_locate_1() However, to allow the kernel to filter routes based on the RTM_F_CLONED flag, we need to make sure this flag is always passed when we want cached routes to be dumped, and we can also pass table and output interface attributes to have the kernel filtering on them, if requested by the user. Use the existing iproute_dump_filter() as a filter for the dump request in iproute_flush(). This way, 'ip -6 route flush cache' works again. v2: Instead of creating a separate 'filter' function dealing with RTM_F_CACHED only, use the existing iproute_dump_filter() and get table and oif kernel filtering for free. Suggested by David Ahern. Fixes: aba5acdfdb34 ("(Logical change 1.3)") Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* ip/iptoken: fix dump error when ipv6 disabledHangbin Liu2019-06-261-2/+2
| | | | | | | | | | | | | | | When we disable IPv6 from the start up (ipv6.disable=1), there will be no IPv6 route info in the dump message. If we return -1 when ifi->ifi_family != AF_INET6, we will get error like $ ip token list Dump terminated which will make user feel confused. There is no need to return -1 if the dump message not match. Return 0 is enough. Signed-off-by: Hangbin Liu <liuhangbin@gmail.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* devlink: replace print macros with functionsStephen Hemminger2019-06-261-20/+42
| | | | | | | Using functions is safer, and printing is not performance critical. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* tc: adjust xtables_match and xtables_target to changes in recent iptablesEyal Birger2019-06-241-0/+30
| | | | | | | | | | | | iptables commit 933400b37d09 ("nft: xtables: add the infrastructure to translate from iptables to nft") added an additional member to struct xtables_match and struct xtables_target. This change is available for libxtables12 and up. Add these members conditionally to support both newer and older versions. Fixes: dd29621578d2 ("tc: add em_ipt ematch for calling xtables matches from tc matching context") Signed-off-by: Eyal Birger <eyal.birger@gmail.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* ip monitor: display interfaces from all groupsNicolas Dichtel2019-06-211-1/+1
| | | | | | | | | | | Only interface from group 0 were displayed. ip monitor calls ipaddr_reset_filter() and there is no reason to not reset the filter group in this function. Fixes: c4fdf75d3def ("ip link: fix display of interface groups") Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* netns: make netns_{save,restore} staticMatteo Croce2019-06-204-34/+31
| | | | | | | | | The netns_{save,restore} functions are only used in ipnetns.c now, since the restore is not needed anymore after the netns exec command. Move them in ipnetns.c, and make them static. Signed-off-by: Matteo Croce <mcroce@redhat.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* ip vrf: use hook to change VRF in the childMatteo Croce2019-06-201-4/+8
| | | | | | | | | On vrf exec, reset the VRF associations in the child process, via the new hook added to cmd_exec(). In this way, the parent doesn't have to reset the VRF associations before spawning other processes. Signed-off-by: Matteo Croce <mcroce@redhat.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* netns: switch netns in the child when executing commandsMatteo Croce2019-06-205-47/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'ip netns exec' changes the current netns just before executing a child process, and restores it after forking. This is needed if we're running in batch or do_all mode. Some cleanups must be done both in the parent and in the child: the parent must restore the previous netns, while the child must reset any VRF association. Unfortunately, if do_all is set, the VRF are not reset in the child, and the spawned processes are started with the wrong VRF context. This can be triggered with this script: # ip -b - <<-'EOF' link add type vrf table 100 link set vrf0 up link add type dummy link set dummy0 vrf vrf0 up netns add ns1 EOF # ip -all -b - <<-'EOF' vrf exec vrf0 true netns exec setsid -f sleep 1h EOF # ip vrf pids vrf0 314 sleep # ps 314 PID TTY STAT TIME COMMAND 314 ? Ss 0:00 sleep 1h Refactor cmd_exec() and pass to it a function pointer which is called in the child before the final exec. In the netns exec case the function just resets the VRF and switches netns. Doing it in the child is less error prone and safer, because the parent environment is always kept unaltered. After this refactor some utility functions became unused, so remove them. Signed-off-by: Matteo Croce <mcroce@redhat.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* Add support for configuring MACsec gcm-aes-256 cipher type.Pete Morici2019-06-182-10/+20
| | | | | Signed-off-by: Pete Morici <pmorici@dev295.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* Makefile: use make -CAndrea Claudi2019-06-183-7/+8
| | | | | | | | | | | | | | make provides a handy -C option to change directory before reading the makefiles or doing anything else. Use that instead of the "cd dir && make && cd .." pattern, thus simplifying sintax for some makefiles. Changes from v1: - Drop an obviously wrong leftover on testsuite/iproute2/Makefile Signed-off-by: Andrea Claudi <aclaudi@redhat.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* uapi: update headers and add if_link.h and if_infiniband.hStephen Hemminger2019-06-183-2/+35
| | | | Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* ipmroute: Prevent overlapping storage of `filter` globalMichael Forney2019-06-181-1/+1
| | | | | | | | | | | | | This variable has the same name as `struct xfrm_filter filter` in ip/ipxfrm.c, but overrides that definition since `struct rtfilter` is larger. This is visible when built with -Wl,--warn-common in LDFLAGS: /usr/bin/ld: ipxfrm.o: warning: common of `filter' overridden by larger common from ipmroute.o Signed-off-by: Michael Forney <mforney@mforney.org> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* testsuite: intent if/else in MakefileStephen Hemminger2019-06-122-4/+4
| | | | | | Indent both arms of if/else equally. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* devlink: mnlg: Catch returned error value of dumpit commandsMoshe Shemesh2019-06-123-2/+10
| | | | | | | | | | | | | | | Devlink commands which implements the dumpit callback may return error. The netlink function netlink_dump() sends the errno value as the payload of the message, while answering user space with NLMSG_DONE. To enable receiving errno value for dumpit commands we have to check for it in the message. If it is a negative value then the dump returned an error so we should set errno accordingly and check for ext_ack in case it was set. Fixes: 049c58539f5d ("devlink: mnlg: Add support for extended ack") Signed-off-by: Moshe Shemesh <moshe@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* ip6tunnel: fix 'ip -6 {show|change} dev <name>' cmdsMahesh Bandewar2019-06-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | Inclusion of 'dev' is allowed by the syntax but not handled correctly by the command. It produces no output for show command and falsely successful for change command but does not make any changes. can be verified with the following steps # ip -6 tunnel add ip6tnl1 mode ip6gre local fd::1 remote fd::2 tos inherit ttl 127 encaplimit none # ip -6 tunnel show ip6tnl1 <correct output> # ip -6 tunnel show dev ip6tnl1 <no output but correct output after this change> # ip -6 tunnel change dev ip6tnl1 local 2001:1234::1 remote 2001:1234::2 encaplimit none ttl 127 tos inherit allow-localremote # echo $? 0 # ip -6 tunnel show ip6tnl1 <no changes applied, but changes are correctly applied after this change> Signed-off-by: Mahesh Bandewar <maheshb@google.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* ip: reset netns after each command in batch modeMatteo Croce2019-06-104-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When creating a new netns or executing a program into an existing one, the unshare() or setns() calls will change the current netns. In batch mode, this can run commands on the wrong interfaces, as the ifindex value is meaningful only in the current netns. For example, this command fails because veth-c doesn't exists in the init netns: # ip -b - <<-'EOF' netns add client link add name veth-c type veth peer veth-s netns client addr add 192.168.2.1/24 dev veth-c EOF Cannot find device "veth-c" Command failed -:7 But if there are two devices with the same name in the init and new netns, ip will build a wrong ll_map with indexes belonging to the new netns, and will execute actions in the init netns using this wrong mapping. This script will flush all eth0 addresses and bring it down, as it has the same ifindex of veth0 in the new netns: # ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff inet 192.168.122.76/24 brd 192.168.122.255 scope global dynamic eth0 valid_lft 3598sec preferred_lft 3598sec # ip -b - <<-'EOF' netns add client link add name veth0 type veth peer name veth1 link add name veth-ns type veth peer name veth0 netns client link set veth0 down address flush veth0 EOF # ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000 link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff 3: veth1@veth0: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether c2:db:d0:34:13:4a brd ff:ff:ff:ff:ff:ff 4: veth0@veth1: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether ca:9d:6b:5f:5f:8f brd ff:ff:ff:ff:ff:ff 5: veth-ns@if2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether 32:ef:22:df:51:0a brd ff:ff:ff:ff:ff:ff link-netns client The same issue can be triggered by the netns exec subcommand with a sligthy different script: # ip netns add client # ip -b - <<-'EOF' netns exec client true link add name veth0 type veth peer name veth1 link add name veth-ns type veth peer name veth0 netns client link set veth0 down address flush veth0 EOF Fix this by adding two netns_{save,reset} functions, which are used to get a file descriptor for the init netns, and restore it after each batch command. netns_save() is called before the unshare() or setns(), while netns_restore() is called after each command. Fixes: 0dc34c7713bb ("iproute2: Add processless network namespace support") Reviewed-and-tested-by: Andrea Claudi <aclaudi@redhat.com> Signed-off-by: Matteo Croce <mcroce@redhat.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* tc: simple: don't hardcode the control actionDavide Caratti2019-06-061-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the following TDC test case: b776 - Replace simple action with invalid goto chain control checks if the kernel correctly validates the 'goto chain' control action, when it is specified in 'act_simple' rules. The test systematically fails because the control action is hardcoded in parse_simple(), i.e. it is not parsed by command line arguments, so its value is constantly TC_ACT_PIPE. Because of that, the following command: # tc action add action simple sdata "test" drop index 7 installs an 'act_simple' rule that never drops packets, and whose 'index' is the first IDR available, plus an 'act_gact' rule with 'index' equal to 7, that drops packets. Use parse_action_control_dflt(), like we did on many other TC actions, to make the control action configurable also with 'act_simple'. The expected results of test b776 are summarized below: iproute2 v kernel->| 5.1-rc2 (and previous) | 5.1-rc3 (and subsequent) ------------------+-------------------------+------------------------- 5.1.0 | FAIL (bad IDR) | FAIL (bad IDR) 5.1.0(patched) | FAIL (no rule/bad sdata)| PASS Changes since v1: - reword commit message, thanks Stephen Hemminger Fixes: 087f46ee4ebd ("tc: introduce simple action") CC: Andrea Claudi <aclaudi@redhat.com> CC: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: Davide Caratti <dcaratti@redhat.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* tc: Fix binding of gact action by index.Roman Mashak2019-06-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following operation fails: % sudo tc actions add action pipe index 1 % sudo tc filter add dev lo parent ffff: \ protocol ip pref 10 u32 match ip src 127.0.0.2 \ flowid 1:10 action gact index 1 Bad action type index Usage: ... gact <ACTION> [RAND] [INDEX] Where: ACTION := reclassify | drop | continue | pass | pipe | goto chain <CHAIN_INDEX> | jump <JUMP_COUNT> RAND := random <RANDTYPE> <ACTION> <VAL> RANDTYPE := netrand | determ VAL : = value not exceeding 10000 JUMP_COUNT := Absolute jump from start of action list INDEX := index value used However, passing a control action of gact rule during filter binding works: % sudo tc filter add dev lo parent ffff: \ protocol ip pref 10 u32 match ip src 127.0.0.2 \ flowid 1:10 action gact pipe index 1 Binding by reference, i.e. by index, has to consistently work with any tc action. Since tc is sensitive to the order of keywords passed on the command line, we can teach gact to skip parsing arguments as soon as it sees 'gact' followed by 'index' keyword. Signed-off-by: Roman Mashak <mrv@mojatatu.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* devlink: Increase bus, device buffer size to 64 bytesParav Pandit2019-06-061-2/+2
| | | | | | | | | | | | | Device name on mdev bus is 36 characters long which follow standard uuid RFC 4122. This is probably the longest name that a kernel will return for a device. Hence increase the buffer size to 64 bytes. Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Parav Pandit <parav@mellanox.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* man: tc-skbedit.8: document 'inheritdsfield'Davide Caratti2019-06-041-3/+10
| | | | | | | | | while at it, fix missing square bracket near 'ptype' and a typo in the action description (it's -> its). Signed-off-by: Davide Caratti <dcaratti@redhat.com> Acked-by: Andrea Claudi <aclaudi@redhat.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* iplink: don't try to get ll addr len when creating an ifaceNicolas Dichtel2019-05-301-1/+2
| | | | | | | | | It will obviously fail. This is a follow up of the commit 757837230a65 ("lib: suppress error msg when filling the cache"). Suggested-by: David Ahern <dsahern@gmail.com> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* bridge: mdb: restore text output formatNikolay Aleksandrov2019-05-301-6/+6
| | | | | | | | | | | | | | | | | | | While I fixed the mdb json output, I did overlook the text output. This patch returns the original text output format: dev <bridge> port <port> grp <mcast group> <temp|permanent> <flags> <timer> Example (old format, restored by this patch): dev br0 port eth8 grp 239.1.1.11 temp Example (changed format after the commit below): 23: br0 eth8 239.1.1.11 temp We had some reports of failing scripts which were parsing the output. Also the old format matches the bridge mdb command syntax which makes it easier to build commands out of the output. Fixes: c7c1a1ef51ae ("bridge: colorize output and use JSON print library") Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* tc: flower: fix port value truncationLukasz Czapnik2019-05-281-12/+36
| | | | | | | | | | | | | | | | | | | | sscanf truncates read port values silently without any error. As sscanf man says: (...) sscanf() conform to C89 and C99 and POSIX.1-2001. These standards do not specify the ERANGE error. Replace sscanf with safer get_be16 that returns error when value is out of range. Example: tc filter add dev eth0 protocol ip parent ffff: prio 1 flower ip_proto tcp dst_port 70000 hw_tc 1 Would result in filter for port 4464 without any warning. Fixes: 8930840e678b ("tc: flower: Classify packets based port ranges") Signed-off-by: Lukasz Czapnik <lukasz.czapnik@intel.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* lib: suppress error msg when filling the cacheNicolas Dichtel2019-05-281-1/+1
| | | | | | | | | | | | | | | | Before the patch: $ ip netns add foo $ ip link add name veth1 address 2a:a5:5c:b9:52:89 type veth peer name veth2 address 2a:a5:5c:b9:53:90 netns foo RTNETLINK answers: No such device RTNETLINK answers: No such device But the command was successful. This may break script. Let's remove those error messages. Fixes: 55870dfe7f8b ("Improve batch and dump times by caching link lookups") Reported-by: Philippe Guibert <philippe.guibert@6wind.com> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* uapi: minor upstream btf.h header changeStephen Hemminger2019-05-241-1/+1
| | | | Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* m_mirred: don't bail if the control action is missingPaolo Abeni2019-05-221-1/+2
| | | | | | | | | | | | | | The mirred act admits an optional control action, defaulting to TC_ACT_PIPE. The parsing code currently emits an error message if the control action is not provided on the command line, even if the command itself completes with no error. This change shuts down the error message, using the appropriate parsing helper. Fixes: e67aba559581 ("tc: actions: add helpers to parse and print control actions") Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* man: fix macaddr section of ip-linkStephen Hemminger2019-05-211-4/+9
| | | | | | | The formatting of setting mac address was confusing. Break lines and fix highlighting. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* rdma: update uapi headersStephen Hemminger2019-05-181-12/+19
| | | | | Based on 5.2-rc Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* rdma: Update node type stringsGal Pressman2019-05-181-1/+2
| | | | | | | | Fix typo in usnic_udp node type and add a string for the unspecified node type. Signed-off-by: Gal Pressman <galpress@amazon.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* uapi: merge bpf.h from 5.2Stephen Hemminger2019-05-151-70/+75
| | | | | | Upstream commit to fix spelling errors. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* uapi: add sockios.hStephen Hemminger2019-05-151-0/+14
| | | | | | Forgot to add this to earlier commit. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* mailmap: map David's mail addressStephen Hemminger2019-05-151-0/+2
| | | | | | Cleans up multiple mail addresses in shortlog output. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* mailmap: add myselfStephen Hemminger2019-05-151-0/+12
| | | | | | Put entries in for past commit mail addresses Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* uapi: update headers to import asm-generic/sockios.hStephen Hemminger2019-05-131-4/+0
| | | | | | | | import asm-generic/sockios.h to fix the compile errors from the movement of timestamp macros. Signed-off-by: David Ahern <dsahern@gmail.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* uapi: add include/linux/net.hStephen Hemminger2019-05-131-0/+58
| | | | | | | All kernel headers must come from this repo, and ss is including linux/net.h Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* uapi: update to elf-em headerStephen Hemminger2019-05-101-0/+6
| | | | Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* Merge ../iproute2-nextStephen Hemminger2019-05-1034-62/+1218
|\
| * taprio: Add support for cycle_time and cycle_time_extensionVinicius Costa Gomes2019-05-041-11/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows a cycle-time and a cycle-time-extension to be specified. Specifying a cycle-time will truncate that cycle, so when that instant is reached, the cycle will start from its beginning. A cycle-time-extension may cause the last entry of a cycle, just before the start of a new schedule (the base-time of the "admin" schedule) to be extended by at maximum "cycle-time-extension" nanoseconds. The idea of this feauture, as described by the IEEE 802.1Q, is too avoid too narrow gate states. Example: tc qdisc change dev IFACE parent root handle 100 taprio \ sched-entry S 0x1 1000000 \ sched-entry S 0x0 2000000 \ sched-entry S 0x1 3000000 \ sched-entry S 0x0 4000000 \ cycle-time-extension 100000 \ cycle-time 9000000 \ base-time 12345678900000000 Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com> Signed-off-by: David Ahern <dsahern@gmail.com>
| * taprio: Add support for changing schedulesVinicius Costa Gomes2019-05-041-9/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows for a new schedule to be specified during runtime, without removing the current one. For that, the semantics of the 'tc qdisc change' operation in the context of taprio is that if "change" is called and there is a running schedule, a new schedule is created and the base-time (let's call it X) of this new schedule is used so at instant X, it becomes the "current" schedule. So, in short, "change" doesn't change the current schedule, it creates a new one and sets it up to it becomes the current one at some point. In IEEE 802.1Q terms, it means that we have support for the "Oper" (current and read-only) and "Admin" (future and mutable) schedules. Example of creating the first schedule, then adding a new one: (1) tc qdisc add dev IFACE parent root handle 100 taprio \ num_tc 1 \ map 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \ queues 1@0 \ sched-entry S 0x1 1000000 \ sched-entry S 0x0 2000000 \ sched-entry S 0x1 3000000 \ sched-entry S 0x0 4000000 \ base-time 100000000 \ clockid CLOCK_TAI (2) tc qdisc change dev IFACE parent root handle 100 taprio \ base-time 7500000000000 \ sched-entry S 0x0 5000000 \ sched-entry S 0x1 5000000 \ It was necessary to fix a bug, so the clockid doesn't need to be specified when changing the schedule. Most of the changes are related to make it easier to reuse the same function for printing the "admin" and "oper" schedules. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com> Signed-off-by: David Ahern <dsahern@gmail.com>
| * tc: add support for plug qdiscPaolo Abeni2019-05-042-0/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | sch_plug can be used to perform functional qdisc unit tests controlling explicitly the queuing behaviour from user-space. Plug support lacks since its introduction in 2012. This change introduces basic support, to control the tc status. v1 -> v2: - use the SPDX identifier Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: David Ahern <dsahern@gmail.com>
| * Update kernel headersDavid Ahern2019-05-043-1/+58
| | | | | | | | | | | | | | Update kernel headers to commit a734d1f4c2fc ("net: openvswitch: return an error instead of doing BUG_ON()") Signed-off-by: David Ahern <dsahern@gmail.com>
| * uapi: wrap SIOCGSTAMP and SIOCGSTAMPNS in ifndefDavid Ahern2019-05-031-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These warnings: ../include/uapi/linux/sockios.h:42:0: warning: "SIOCGSTAMP" redefined ../include/uapi/linux/sockios.h:43:0: warning: "SIOCGSTAMPNS" redefined are from kernel commit 0768e17073dc5 ("net: socket: implement 64-bit timestamps"). This commit moved the definitions of SIOCGSTAMP and SIOCGSTAMPNS from include/asm-generic/sockios.h to include/uapi/linux/sockios.h. Older OS'es already define them in /usr/include/asm-generic/sockios.h resulting in ugly compile errors now: In file included from ll_types.c:24:0: ../include/uapi/linux/sockios.h:42:0: warning: "SIOCGSTAMP" redefined #define SIOCGSTAMP SIOCGSTAMP_OLD In file included from /usr/include/x86_64-linux-gnu/asm/sockios.h:1:0, from /usr/include/asm-generic/socket.h:5, from /usr/include/x86_64-linux-gnu/asm/socket.h:1, from /usr/include/x86_64-linux-gnu/bits/socket.h:368, from /usr/include/x86_64-linux-gnu/sys/socket.h:38, from ll_types.c:17: /usr/include/asm-generic/sockios.h:11:0: note: this is the location of the previous definition #define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ so wrap them in #ifndef. Signed-off-by: David Ahern <dsahern@gmail.com>
| * ss: add option to print socket information on one lineJosh Hunt2019-05-022-10/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Multi-line output in ss makes it difficult to search for things with grep. This new option will make it easier to find sockets matching certain criteria with simple grep commands. Example without option: $ ss -emoitn State Recv-Q Send-Q Local Address:Port Peer Address:Port ESTAB 0 0 127.0.0.1:13265 127.0.0.1:36743 uid:1974 ino:48271 sk:1 <-> skmem:(r0,rb2227595,t0,tb2626560,f0,w0,o0,bl0,d0) ts sack reno wscale:7,7 rto:211 rtt:10.245/16.616 ato:40 mss:65483 cwnd:10 bytes_acked:41865496 bytes_received:21580440 segs_out:242496 segs_in:351446 data_segs_out:242495 data_segs_in:242495 send 511.3Mbps lastsnd:2383 lastrcv:2383 lastack:2342 pacing_rate 1022.6Mbps rcv_rtt:92427.6 rcv_space:43725 minrtt:0.007 Example with new option: $ ss -emoitnO State Recv-Q Send-Q Local Address:Port Peer Address:Port ESTAB 0 0 127.0.0.1:13265 127.0.0.1:36743 uid:1974 ino:48271 sk:1 <-> skmem:(r0,rb2227595,t0,tb2626560,f0,w0,o0,bl0,d0) ts sack reno wscale:7,7 rto:211 rtt:10.067/16.429 ato:40 mss:65483 pmtu:65535 rcvmss:536 advmss:65483 cwnd:10 bytes_sent:41868244 bytes_acked:41868244 bytes_received:21581866 segs_out:242512 segs_in:351469 data_segs_out:242511 data_segs_in:242511 send 520.4Mbps lastsnd:14355 lastrcv:14355 lastack:14314 pacing_rate 1040.7Mbps delivery_rate 74837.7Mbps delivered:242512 app_limited busy:1861946ms rcv_rtt:92427.6 rcv_space:43725 rcv_ssthresh:43690 minrtt:0.007 Signed-off-by: Josh Hunt <johunt@akamai.com> Signed-off-by: David Ahern <dsahern@gmail.com>
| * devlink: Increase column size for larger shared buffersIdo Schimmel2019-04-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With current number of spaces the output is mangled if the shared buffer is congested. Before: # devlink sb occupancy show swp25 swp25: pool: 0: 33384960/39344256 1: 0/0 2: 0/0 3: 0/0 4: 0/720 5: 0/0 6: 0/0 7: 0/0 8: 0/288 9: 0/0 10: 0/0 itc: 0(0): 33272064/39344256 1(0): 0/0 2(0): 0/0 3(0): 0/0 4(0): 0/0 5(0): 0/0 6(0): 0/0 7(0): 0/0 etc: 0(4): 0/720 1(4): 0/0 2(4): 0/0 3(4): 0/0 4(4): 0/0 5(4): 0/0 6(4): 0/0 7(4): 0/0 8(8): 0/288 9(8): 0/0 10(8): 0/0 11(8): 0/0 12(8): 0/0 13(8): 0/0 14(8): 0/0 15(8): 0/0 After: # devlink sb occupancy show swp25 swp25: pool: 0: 39070080/39344256 1: 0/0 2: 0/0 3: 0/0 4: 0/720 5: 0/0 6: 0/0 7: 0/0 8: 0/288 9: 0/0 10: 0/0 itc: 0(0): 39062016/39344256 1(0): 0/0 2(0): 0/0 3(0): 0/0 4(0): 0/0 5(0): 0/0 6(0): 0/0 7(0): 0/0 etc: 0(4): 0/720 1(4): 0/0 2(4): 0/0 3(4): 0/0 4(4): 0/0 5(4): 0/0 6(4): 0/0 7(4): 0/0 8(8): 0/288 9(8): 0/0 10(8): 0/0 11(8): 0/0 12(8): 0/0 13(8): 0/0 14(8): 0/0 15(8): 0/0 v2: * Increase number of spaces to make the change more future-proof Signed-off-by: Ido Schimmel <idosch@mellanox.com> Reported-by: Alex Kushnarov <alexanderk@mellanox.com> Signed-off-by: David Ahern <dsahern@gmail.com>
| * Update tc-bpf.8 man page examplesLucas Siba 2019-04-20 11:40 UTC2019-04-261-1/+11
| | | | | | | | | | | | | | | | | | | | | | This patch updates the tc-bpf.8 example application for changes to the struct bpf_elf_map definition. In it's current form, things compile, but the resulting object file is rejected by the verifier when attempting to load it through tc. Signed-off-by: Lucas Siba <lucas.siba@gmail.com> Signed-off-by: David Ahern <dsahern@gmail.com> [ dropped the unnecessary flags initialization on commit ]
| * Merge branch 'iproute2-master' into nextDavid Ahern2019-04-2612-81/+139
| |\ | | | | | | | | | Signed-off-by: David Ahern <dsahern@gmail.com>
| * | iplink_vlan: add support for VLAN bridge binding flagMike Manning2019-04-262-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the VLAN bridge binding flag that is provided in net-next kernel by the series merged by 1ab839281cf7 ("net-support-binding-vlan-dev-link-state-to-vlan-member-bridge-ports") Signed-off-by: Mike Manning <mmanning@vyatta.att-mail.com> Signed-off-by: David Ahern <dsahern@gmail.com>
| * | Update kernel headersDavid Ahern2019-04-265-9/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update kernel headers to commit 148f025d41a8 ("Merge branch 'hns3-next'") Note, these warnings: ../include/uapi/linux/sockios.h:42:0: warning: "SIOCGSTAMP" redefined ../include/uapi/linux/sockios.h:43:0: warning: "SIOCGSTAMPNS" redefined are due to kernel commit 0768e17073dc5 ("net: socket: implement 64-bit timestamps") which moved the definitions from include/asm-generic/sockios.h to include/uapi/linux/sockios.h Signed-off-by: David Ahern <dsahern@gmail.com>
| * | ip fou: Support binding FOU portsKristian Evensen2019-04-222-9/+175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for binding FOU ports using iproute2. Kernel-support was added in 1713cb37bf67 ("fou: Support binding FoU socket"). The parse function now handles new arguments for setting the binding-related attributes, while the print function writes the new attributes if they are set. Also, the man page has been updated. v2->v3: * Remove redundant ll_init_map()-calls (thanks David Ahern). v1->v2 (all changes suggested by David Ahern): * Fix reverse Christmas tree ordering. * Remove redundant peer_port_set-variable, it is enough to check peer_port. * Add proper error handling of invalid local/peer addresses. * Use interface name and not index. * Remove updating fou-header file, it is already done. Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com> Signed-off-by: David Ahern <dsahern@gmail.com>
| * | iplink: bridge: add support for vlan_stats_per_portNikolay Aleksandrov2019-04-212-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for manipulating and showing the vlan_stats_per_port bridge option which can be toggled only when there are no port VLANs configured. Also update the man page with the new option. Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: David Ahern <dsahern@gmail.com>