summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' into net-nextnet-nextStephen Hemminger2017-12-145-4/+10
|\
| * tc: fix command "tc actions del" hang issueChris Mi2017-12-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | If command is RTM_DELACTION, a non-NULL pointer is passed to rtnl_talk(). Then flag NLM_F_ACK is not set on n->nlmsg_flags and netlink_ack() will not be called. Command tc will wait for the reply for ever. Fixes: 86bf43c7c2fd ("lib/libnetlink: update rtnl_talk to support malloc buff at run time") Reviewed-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Chris Mi <chrism@mellanox.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
| * tc: fix json array closingJiri Pirko2017-12-131-1/+1
| | | | | | | | | | Fixes: 2704bd625583 ("tc: jsonify actions core") Signed-off-by: Jiri Pirko <jiri@mellanox.com>
| * ip: add vxcan to help textOliver Hartkopp2017-12-132-2/+2
| | | | | | | | | | | | | | Add missing tag 'vxcan' inside the help text which was missing in commit efe459c76d35f ('ip: link add vxcan support'). Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
| * Show 'external' link mode in outputPhil Dibowitz2017-12-132-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recently `external` support was added to the tunnel drivers, but there is no way to introspect this from userspace. This adds support for that. Now `ip -details link` shows it: ``` 7: tunl60@NONE: <NOARP> mtu 1452 qdisc noop state DOWN mode DEFAULT group default qlen 1 link/tunnel6 :: brd :: promiscuity 0 ip6tnl external any remote :: local :: encaplimit 0 hoplimit 0 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 ``` Signed-off-by: Phil Dibowitz <phil@ipom.com>
* | gre6: add collect metadata supportWilliam Tu2017-12-142-20/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | The patch adds 'external' option to support collect metadata gre6 tunnel. The 'external' keyword is already used to set the device into collect metadata mode such as vxlan, geneve, ipip, etc. This patch extends support for ipv6 gre and gretap. Example of L3 and L2 gre device: bash:~# ip link add dev ip6gre123 type ip6gre external bash:~# ip link add dev ip6gretap123 type ip6gretap external Signed-off-by: William Tu <u9012063@gmail.com> Cc: Daniel Borkmann <daniel@iogearbox.net>
* | iplink: add definitions for GSO_MAXStephen Hemminger2017-12-141-4/+15
| | | | | | | | | | | | | | Until kernel exports these, add GSO_MAX values into iplink rather than assuming they are UINT_MAX + 1 Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* | iplink: validate maximum gso_max_sizeSolio Sarabia2017-12-142-2/+3
| | | | | | | | | | | | | | Validate the upper limit for gso_max_size, valid range is [0-65,536] inclusive. Fix minor whitespace in iplink man page. Signed-off-by: Solio Sarabia <solio.sarabia@intel.com>
* | Merge branch 'master' into net-nextStephen Hemminger2017-12-122-275/+622
|\ \ | |/
| * tc: bash-completion: add missing 'classid' keywordDavide Caratti2017-12-121-1/+1
| | | | | | | | | | | | | | | | users of 'matchall' filter can specify a value for the class id: update bash-completion accordingly. Fixes: b32c0b64fa2b ("tc: bash-completion: Add support for matchall") Signed-off-by: Davide Caratti <dcaratti@redhat.com>
| * ss: Implement automatic column width calculationStefano Brivio2017-12-121-68/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Group fitting fields into lines and space them equally using the remaining screen width for each line. If columns don't fit on one line, break them into the least possible amount of lines and keep them aligned across lines. This is done by: - recording the length of the longest item in each column during formatting and buffering (which was added in the previous patch) - fitting as many fields as possible on each line of output - distributing the remaining padding space equally between the columns Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
| * ss: Buffer raw fields first, then render them as a tableStefano Brivio2017-12-121-46/+225
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to measure the maximum field length for each column before printing fields and will permit us to apply optimal field spacing and distribution. Structure of the output buffer with chunked allocation is described in comments. Output is still unchanged, original spacing is used. Running over one million sockets with -tul options by simply modifying main() to loop 50,000 times over the *_show() functions, buffering the whole output and rendering it at the end, with 10 UDP sockets, 10 TCP sockets, while throwing output away, doesn't show significant changes in execution time on my laptop with an Intel i7-6600U CPU: - before this patch: $ time ./ss -tul > /dev/null real 0m29.899s user 0m2.017s sys 0m27.801s - after this patch: $ time ./ss -tul > /dev/null real 0m29.827s user 0m1.942s sys 0m27.812s Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
| * ss: Introduce columns lightweight abstractionStefano Brivio2017-12-121-93/+198
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of embedding spacing directly while printing contents, logically declare columns and functions to buffer their content, to print left and right spacing around fields, to flush them to screen, and to print headers. This makes it a bit easier to handle layout changes and prepares for full output buffering, needed for optimal spacing in field output layout. Columns are currently set up to retain exactly the same output as before. This needs some slight adjustments of the values previously calculated in main(), as the width value introduced here already includes the width of left delimiters and spacing is not explicitly printed anymore whenever a field is printed. These calculations will go away altogether once automatic width calculation is implemented. We can also remove explicit printing of newlines after the final content for a given line is printed, flushing the last field on a line will cause field_flush() to print newlines where appropriate. No changes in output expected here. Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
| * ss: Replace printf() calls for "main" output by calls to helperStefano Brivio2017-12-121-194/+205
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is preparation work for output buffering, which will allow us to use optimal spacing and alignment of logical "columns". The new out() function is just a re-implementation of a typical libc's printf(), except that the return value of vfprintf() is ignored as no callers use it. This implementation will be replaced in the next patches to provide column width adjustment and adequate spacing. All printf() calls that output parts of the socket list are now replaced by calls to out(). Output of summary and version is excluded from this. No functional differences here, output not affected. Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
* | Merge branch 'master' into net-nextStephen Hemminger2017-12-111-1/+0
|\ \ | |/
| * ss: remove duplicate assignmentRoman Mashak2017-12-111-1/+0
| | | | | | | | | | | | Fixes: 8250bc9ff4e5 ("ss: Unify inet sockets output") Signed-off-by: Roman Mashak <mrv@mojatatu.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* | uapi: tun add eBPF based queue selection methodStephen Hemminger2017-12-111-0/+1
| | | | | | | | | | | | | | Upstream commit 96f84061620c6325a2ca9a9a05b410e6461d03c3 tun: add eBPF based queue selection method Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* | uapi: add access to snd_cwnd and other sock_opsStephen Hemminger2017-12-111-0/+6
| | | | | | | | | | | | | | From upstream kernel commit f19397a5c65665d66e3866b42056f1f58b7a366b bpf: Add access to snd_cwnd and others in sock_ops Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* | iplink: allow configuring GSO max valuesStephen Hemminger2017-12-082-1/+31
| | | | | | | | | | | | | | | | | | | | | | This allows sending GSO maximum values when configuring a device. The values are advisory. Most devices will ignore them but for some pseudo devices such as veth pairs they can be set. Example: # ip link add dev vm1 type veth peer name vm2 gso_max_size 32768 Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
* | Merge branch 'master' into net-nextStephen Hemminger2017-12-0817-9/+26
|\ \ | |/
| * tc: util: Don't call NEXT_ARG_FWD() in __parse_action_control()Michal Privoznik2017-12-0814-7/+19
| | | | | | | | | | | | | | | | | | Not all callers want parse_action_control*() to advance the arguments. For instance act_parse_police() does the argument advancing itself. Fixes: e67aba559581 ("tc: actions: add helpers to parse and print control actions") Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
| * ss: print tcpi_rcv_ssthreshWei Wang2017-12-081-0/+4
| | | | | | | | | | | | | | | | | | tcpi_rcv_ssthresh is an important stats when debugging receive side behavior. Add it to the ss output. Signed-off-by: Wei Wang <weiwan@google.com> Signed-off-by: Eric Dumazet <edumazet@google.com>
| * update headers from 4.15-rc2Stephen Hemminger2017-12-051-0/+1
| | | | | | | | Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
| * man: tc-csum.8: Fix inconsistency in example descriptionPhil Sutter2017-11-291-2/+2
| | | | | | | | | | | | | | | | | | Commit 6bbe5e6290db5 ("man: tc-csum.8: Fix example") changed both source and destination IP addresses in example code but missed to update the example's description accordingly. Fixes: 6bbe5e6290db5 ("man: tc-csum.8: Fix example") Signed-off-by: Phil Sutter <phil@nwl.cc>
* | update bpf header from net-nextStephen Hemminger2017-11-281-7/+1
| | | | | | | | Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* | Merge branch 'master' into net-nextStephen Hemminger2017-11-28144-589/+1134
|\ \ | |/
| * man: add -json option to tc manpageJiri Pirko2017-11-281-1/+6
| | | | | | | | Signed-off-by: Jiri Pirko <jiri@mellanox.com>
| * vxlan: Make id optional when modifying a linkRobert Shearman2017-11-281-2/+3
| | | | | | | | | | | | | | | | | | Specifying the IFLA_VXLAN_LINK attribute on a vxlan link modify is optional in the kernel, so make the id argument optional for "ip link set ..." to avoid a user needing to specify it when changing another attribute. Signed-off-by: Robert Shearman <rs823p@att.com>
| * gre: Fix ttl inherit optionRobert Shearman2017-11-281-1/+2
| | | | | | | | | | | | | | | | | | Specifying "... ttl inherit" currently does nothing on a GRE link modify since the previous ttl value is retrieved up front. Fix this by explicitly setting ttl to 0 when "inherit" is specified for the option, since 0 represents the semantics of inherit. Signed-off-by: Robert Shearman <rs823p@att.com>
| * link_gre6: Detect invalid encaplimit valuesPhil Sutter2017-11-281-1/+1
| | | | | | | | | | | | | | | | Looks like a typo: get_u8() returns 0 on success and -1 on error, so the error checking here was ineffective. Fixes: a11b7b71a6eba ("link_gre6: really support encaplimit option") Signed-off-by: Phil Sutter <phil@nwl.cc>
| * m_mirred: style cleanupsStephen Hemminger2017-11-261-36/+38
| | | | | | | | | | | | Fix whitespace and long lines. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
| * m_gact: whitespace cleanupStephen Hemminger2017-11-261-7/+10
| | | | | | | | | | | | Fix whitespace errors reported by checkpatch Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
| * m_action: style cleanupStephen Hemminger2017-11-261-32/+45
| | | | | | | | | | | | Break long lines, and use bool where possible. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
| * m_vlan: style cleanupsStephen Hemminger2017-11-261-37/+34
| | | | | | | | | | | | Break long lines and make duplicated code into function. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
| * tc: jsonify vlan actionJiri Pirko2017-11-261-14/+12
| | | | | | | | | | | | Add json output to vlan action. Signed-off-by: Jiri Pirko <jiri@mellanox.com>
| * tc: jsonify mirred actionJiri Pirko2017-11-261-6/+40
| | | | | | | | | | | | Add json output to mirred action. Signed-off-by: Jiri Pirko <jiri@mellanox.com>
| * tc: jsonify gact actionJiri Pirko2017-11-261-7/+11
| | | | | | | | | | | | Add json output to gact action. Signed-off-by: Jiri Pirko <jiri@mellanox.com>
| * tc: jsonify actions coreJiri Pirko2017-11-262-17/+39
| | | | | | | | | | | | Add json output to actions core. Signed-off-by: Jiri Pirko <jiri@mellanox.com>
| * tc: jsonify matchall filterJiri Pirko2017-11-261-6/+6
| | | | | | | | | | | | Add json output to matchall filter. Signed-off-by: Jiri Pirko <jiri@mellanox.com>
| * tc: jsonify flower filterJiri Pirko2017-11-261-118/+169
| | | | | | | | | | | | Add json output to flower filter. Signed-off-by: Jiri Pirko <jiri@mellanox.com>
| * tc: jsonify filter coreJiri Pirko2017-11-261-17/+30
| | | | | | | | | | | | Add json output to filter core. Signed-off-by: Jiri Pirko <jiri@mellanox.com>
| * tc: jsonify htb qdiscJiri Pirko2017-11-261-7/+13
| | | | | | | | | | | | Add json output to htb qdisc. Signed-off-by: Jiri Pirko <jiri@mellanox.com>
| * tc: jsonify fq_codel qdiscJiri Pirko2017-11-261-9/+16
| | | | | | | | | | | | Add json output to fq_codel qdisc. Signed-off-by: Jiri Pirko <jiri@mellanox.com>
| * tc: jsonify stats2Jiri Pirko2017-11-261-9/+23
| | | | | | | | | | | | Add json output to stats2. Signed-off-by: Jiri Pirko <jiri@mellanox.com>
| * tc: jsonify qdisc coreJiri Pirko2017-11-263-21/+37
| | | | | | | | | | | | Add json output to qdisc core. Signed-off-by: Jiri Pirko <jiri@mellanox.com>
| * tc: remove action cookie len from printoutJiri Pirko2017-11-261-1/+1
| | | | | | | | | | | | | | | | Make the output same as input and avoid printout of unnecessary len. Suggested-by: Stephen Hemminger <stephen@networkplumber.org> Fixes: fd8b3d2c1b9b ("actions: Add support for user cookies") Signed-off-by: Jiri Pirko <jiri@mellanox.com>
| * tc: move action cookie print out of the stats ifJiri Pirko2017-11-261-9/+8
| | | | | | | | | | | | | | | | Cookie print was made dependent on show_stats for no good reason. Fix this bu pushing cookie print ot of the stats if. Fixes: fd8b3d2c1b9b ("actions: Add support for user cookies") Signed-off-by: Jiri Pirko <jiri@mellanox.com>
| * iplink: communicate ifindex for xdp offloadJakub Kicinski2017-11-263-6/+12
| | | | | | | | | | | | | | | | | | When xdpoffload option is used, communicate the ifindex down to the kernel to trigger device-specific load. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com> Acked-by: Daniel Borkmann <daniel@iogearbox.net>
| * f_bpf: communicate ifindex for eBPF offloadJakub Kicinski2017-11-261-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Split parsing and loading of the eBPF program and if skip_sw is set load the program for ifindex, to which the qdisc is attached. Note that the ifindex will be ignored for programs which are already loaded (e.g. when using pinned programs), but in that case we just trust the user knows what he's doing. Hopefully we will get extack soon in the driver to help debugging this case. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com> Acked-by: Daniel Borkmann <daniel@iogearbox.net>
| * tc_filter: resolve device name before parsing filterJakub Kicinski2017-11-261-26/+24
| | | | | | | | | | | | | | | | | | | | Move resolving device name into an ifindex before calling filter specific callbacks. This way if filters need the ifindex, they can read it from the request. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com> Acked-by: Daniel Borkmann <daniel@iogearbox.net>