Commit Graph

6044 Commits

Author SHA1 Message Date
Daniel Machon
3e2a96c9f4 dcb: add new pcp-prio parameter to dcb app
Add new pcp-prio parameter to the app subcommand, which can be used to
classify traffic based on PCP and DEI from the VLAN header. PCP and DEI
is specified in a combination of numerical and symbolic form, where 'de'
(drop-eligible) means DEI=1 and 'nd' (not-drop-eligible) means DEI=0.

Map PCP 1 and DEI 0 to priority 1
$ dcb app add dev eth0 pcp-prio 1nd:1

Map PCP 1 and DEI 1 to priority 1
$ dcb app add dev eth0 pcp-prio 1de:1

Internally, PCP and DEI is encoded in the protocol field of the dcb_app
struct. Each combination of PCP and DEI maps to a priority, thus needing
a range of  0-15. A well formed dcb_app entry for PCP/DEI
prioritization, could look like:

    struct dcb_app pcp = {
        .selector = DCB_APP_SEL_PCP,
	.priority = 7,
        .protocol = 15
    }

For mapping PCP=7 and DEI=1 to Prio=7.

Also, three helper functions for translating between std and non-std APP
selectors, have been added to dcb_app.c and exposed through dcb.h.

Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2022-12-08 09:22:26 -07:00
Jacob Keller
a74e7181c6 devlink: support direct region read requests
The kernel has gained support for reading from regions without needing to
create a snapshot. To use this support, the DEVLINK_ATTR_REGION_DIRECT
attribute must be added to the command.

For the "read" command, if the user did not specify a snapshot, add the new
attribute to request a direct read. The "dump" command will still require a
snapshot. While technically a dump could be performed without a snapshot it
is not guaranteed to be atomic unless the region size is no larger than
256 bytes.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2022-12-08 09:21:10 -07:00
Ido Schimmel
fa94a97921 libnetlink: Fix wrong netlink header placement
The netlink header must be first in the netlink message, so move it
there.

Fixes: fee4a56f01 ("Update kernel headers")
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2022-12-08 09:20:27 -07:00
Michal Wilczynski
2e2b534671 devlink: Add documentation for tx_prority and tx_weight
New netlink attributes tx_priority and tx_weight were added.
Update the man page for devlink-rate to account for new attributes.

Signed-off-by: Michal Wilczynski <michal.wilczynski@intel.com>
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2022-12-03 10:47:11 -07:00
Michal Wilczynski
0f71480932 devlink: Introduce new attribute 'tx_weight' to devlink-rate
To fully utilize hierarchical QoS algorithm new attribute 'tx_weight'
needs to be introduced. Weight attribute allows for usage of Weighted
Fair Queuing arbitration scheme among siblings. This arbitration
scheme can be used simultaneously with the strict priority.

Introduce ability to configure tx_weight from devlink userspace
utility. Make the new attribute optional.

Example commands:
$ devlink port function rate add pci/0000:4b:00.0/node_custom \
  tx_weight 50 parent node_0

$ devlink port function rate set pci/0000:4b:00.0/2 tx_weight 20

Signed-off-by: Michal Wilczynski <michal.wilczynski@intel.com>
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2022-12-03 10:47:06 -07:00
Michal Wilczynski
a6b9cd50e6 devlink: Introduce new attribute 'tx_priority' to devlink-rate
To fully utilize hierarchical QoS algorithm new attribute 'tx_priority'
needs to be introduced. Priority attribute allows for usage of strict
priority arbiter among siblings. This arbitration scheme attempts to
schedule nodes based on their priority as long as the nodes remain within
their bandwidth limit.

Introduce ability to configure tx_priority from devlink userspace
utility. Make the new attribute optional.

Example commands:
$ devlink port function rate add pci/0000:4b:00.0/node_custom \
  tx_priority 5 parent node_0
$ devlink port function rate set pci/0000:4b:00.0/2 tx_priority 5

Signed-off-by: Michal Wilczynski <michal.wilczynski@intel.com>
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2022-12-03 10:43:38 -07:00
David Ahern
8a1cc48311 Merge branch 'main' into next
Signed-off-by: David Ahern <dsahern@kernel.org>
2022-12-02 08:59:28 -07:00
David Ahern
fee4a56f01 Update kernel headers
Update kernel headers to commit:
    dbadae927287 ("tsnep: Rework RX buffer allocation")

Signed-off-by: David Ahern <dsahern@kernel.org>
2022-12-02 08:57:25 -07:00
Leonard Crestez
acea9032e9 testsuite: Add test for ip --json neigh get
Signed-off-by: Leonard Crestez <cdleonard@gmail.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2022-12-02 08:55:24 -07:00
Leonard Crestez
94fc813b85 ip neigh: Support --json on ip neigh get
The ip neigh command supports --json for "list" but not for "get". Add
json support for the "get" command so that it's possible to fetch
information about specific neighbors without regular expressions.

Fixes: aac7f725fa ("ipneigh: add color and json support")
Signed-off-by: Leonard Crestez <cdleonard@gmail.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2022-12-02 08:54:28 -07:00
Jason Wang
a4442ce58e vdpa: allow provisioning device features
This patch allows device features to be provisioned via vdpa. This
will be useful for preserving migration compatibility between source
and destination:

# vdpa dev add name dev1 mgmtdev pci/0000:02:00.0 device_features 0x300020000
# vdpa dev config show dev1
# dev1: mac 52:54:00:12:34:56 link up link_announce false mtu 65535
      negotiated_features CTRL_VQ VERSION_1 ACCESS_PLATFORM

Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2022-12-02 08:54:01 -07:00
Tan Tee Min
43aa9d9ce7 taprio: fix wrong for loop condition in add_tc_entries()
The for loop in add_tc_entries() mistakenly included the last entry
index+1. Fix it to correctly loop the max_sdu entry between tc=0 and
num_max_sdu_entries-1.

Fixes: b10a6509c1 ("taprio: support dumping and setting per-tc max SDU")
Signed-off-by: Tan Tee Min <tee.min.tan@linux.intel.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2022-12-02 08:53:13 -07:00
Stephen Hemminger
d4b01c0f41 tc/basic: fix json output filter
The flowid and handle in basic were not using JSON routines to print.
 To reproduce the issue:

 $ tc qdisc add dev eth1 handle ffff: ingress
 $ tc filter add dev eth1 parent ffff: prio 20 protocol all u32 match ip dport 22 \
     0xffff action police conform-exceed drop/ok rate 100000 burst 15k flowid ffff:1

 $ tc filter add dev eth1 parent ffff: prio 255 protocol all basic action police \
     conform-exceed drop/ok rate 100000 burst 15k flowid ffff:3

Reported-by: Christian Pössinger <christian@poessinger.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-12-01 07:30:54 -08:00
Hangbin Liu
f38059746d ip: fix return value for rtnl_talk failures
Since my last commit "rtnetlink: add new function rtnl_echo_talk()" we
return the kernel rtnl exit code directly, which breaks some kernel
selftest checking. As there are still a lot of tests checking -2 as the
error return value, to keep backward compatibility, let's keep using
-2 for all the rtnl return values.

Reported-by: Ido Schimmel <idosch@idosch.org>
Fixes: 6c09257f1b ("rtnetlink: add new function rtnl_echo_talk()")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Tested-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-11-28 08:42:31 -08:00
Jiri Pirko
63d84b1fc9 devlink: load ifname map on demand from ifname_map_rev_lookup() as well
Commit 5cddbb274e ("devlink: load port-ifname map on demand") changed
the ifname map to be loaded on demand from ifname_map_lookup(). However,
it didn't put this on-demand loading into ifname_map_rev_lookup() which
causes ifname_map_rev_lookup() to return -ENOENT all the time.

Fix this by triggering on-demand ifname map load
from ifname_map_rev_lookup() as well.

Fixes: 5cddbb274e ("devlink: load port-ifname map on demand")
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-11-25 10:57:29 -08:00
Stephen Hemminger
067396574d tc: put size table options in json object
Missed this part from earlier change.

Fixes: 6af6f02cce ("tc: add json support to size table")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-11-25 10:48:02 -08:00
Lai Peter Jun Ann
455fa82952 tc_util: Change datatype for maj to avoid overflow issue
The return value by stroul() is unsigned long int. Hence the datatype
for maj should defined as unsigned long to avoid overflow issue.

Signed-off-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
Signed-off-by: Lai Peter Jun Ann <jun.ann.lai@intel.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-11-23 08:54:44 -08:00
Lai Peter Jun Ann
e0ecee3a33 tc_util: Fix no error return when large parent id used
This patch is to fix the issue where there is no error return
when large value of parent ID is being used. The return value by
stroul() is unsigned long int. Hence the datatype for maj and min
should defined as unsigned long to avoid overflow issue.

Signed-off-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
Signed-off-by: Lai Peter Jun Ann <jun.ann.lai@intel.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-11-23 08:54:37 -08:00
Stephen Hemminger
6af6f02cce tc: add json support to size table
Fix the JSON output if size addaption table is used.

Example:
[ {
        "kind": "fq_codel",
        "handle": "1:",
        "dev": "enp2s0",
        "root": true,
        "refcnt": 2,
        "options": {
            "limit": 10240,
            "flows": 1024,
            "quantum": 1514,
            "target": 4999,
            "interval": 99999,
            "memory_limit": 33554432,
            "ecn": true,
            "drop_batch": 64
        },
        "stab": {
            "overhead": 30,
            "mpu": 68,
            "mtu": 2047,
            "tsize": 512
        }
    } ]

Remove fixed prefix arg and no longer needed fp arg.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-11-22 20:46:57 -08:00
Stephen Hemminger
a04a01a594 remove #if 0 code
Let's not keep unused code. The YAGNI means that this dead
code doesn't work now, and if it did it would have to change.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-11-22 19:01:23 -08:00
Stephen Hemminger
7cd5c98343 uapi: update for in.h and ip.h
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-11-22 11:33:49 -08:00
Stephen Hemminger
d88020af30 tc_stab: remove dead code
This code to print the STAB table is not supportable,
not converting to JSON.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-11-21 11:04:53 -08:00
Benjamin Poirier
2ed09c3bf8 bridge: Remove unused function argument
print_vnifilter_rtm() was probably modeled on print_vlan_rtm() but the
'monitor' argument is unused in the vnifilter case.

Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2022-11-16 16:55:23 -07:00
David Ahern
bdfd292c31 Merge branch 'main' into next
Conflicts:
	include/uapi/linux/bpf.h

Signed-off-by: David Ahern <dsahern@kernel.org>
2022-11-13 19:29:25 -07:00
Ido Schimmel
34c4cb13a0 man: bridge: Reword description of "locked" bridge port option
Adjust the description to mention the "no_linklocal_learn" bridge option
and make sure it is consistent between both the bridge(8) and ip-link(8)
man pages.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2022-11-07 08:48:52 -07:00
Hans Schultz
05f1164fe8 bridge: link: Add MAC Authentication Bypass (MAB) support
Add MAB support in bridge(8) and ip(8), allowing these utilities to
enable / disable MAB and display its current status.

Signed-off-by: Hans Schultz <netdev@kapio-technology.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2022-11-07 08:48:32 -07:00
Hans Schultz
fa24597472 bridge: fdb: Add support for locked FDB entries
Print the "locked" FDB flag when it is set in the 'NDA_FLAGS_EXT'
attribute. Example output:

 # bridge fdb get 00:11:22:33:44:55 br br0
 00:11:22:33:44:55 dev swp1 locked master br0

 # bridge -j -p fdb get 00:11:22:33:44:55 br br0
 [ {
         "mac": "00:11:22:33:44:55",
         "ifname": "swp1",
         "flags": [ "locked" ],
         "master": "br0",
         "state": ""
     } ]

Signed-off-by: Hans Schultz <netdev@kapio-technology.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2022-11-07 08:48:07 -07:00
David Ahern
e77c118d68 Update kernel headers
Update kernel headers to commit:
    bf46390f39c6 ("Merge branch 'genetlink-per-op-type-policies'")

Signed-off-by: David Ahern <dsahern@kernel.org>
2022-11-07 08:47:16 -07:00
Andrea Claudi
49c63bc775 json: do not escape single quotes
ECMA-404 standard does not include single quote character among the json
escape sequences. This means single quotes does not need to be escaped.

Indeed the single quote escape produces an invalid json output:

$ ip link add "john's" type dummy
$ ip link show "john's"
9: john's: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether c6:8e:53:f6:a3:4b brd ff:ff:ff:ff:ff:ff
$ ip -j link | jq .
parse error: Invalid escape at line 1, column 765

This can be fixed removing the single quote escape in jsonw_puts.
With this patch in place:

$ ip -j link | jq .[].ifname
"lo"
"john's"

Fixes: fcc16c2287 ("provide common json output formatter")
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
2022-11-03 11:30:20 -07:00
Vladimir Oltean
b10a6509c1 taprio: support dumping and setting per-tc max SDU
The 802.1Q queueMaxSDU table is technically implemented in Linux as
the TCA_TAPRIO_TC_ENTRY_MAX_SDU attribute of the TCA_TAPRIO_ATTR_TC_ENTRY
nest. Multiple TCA_TAPRIO_ATTR_TC_ENTRY nests may appear in the netlink
message, one per traffic class. Other configuration items that are per
traffic class are also supposed to go there.

This is done for future extensibility of the netlink interface (I have
the feeling that the struct tc_mqprio_qopt passed through
TCA_TAPRIO_ATTR_PRIOMAP is not exactly extensible, which kind of defeats
the purpose of using netlink). But otherwise, the max-sdu is parsed from
the user, and printed, just like any other fixed-size 16 element array.

I've modified the example for a fully offloaded configuration (flags 2)
to also show a max-sdu use case. The gate intervals were 0x80 (for TC 7),
0xa0 (for TCs 7 and 5) and 0xdf (for TCs 7, 6, 4, 3, 2, 1, 0).
I modified the last gate to exclude TC 7 (df -> 5f), so that TC 7 now
only interferes with TC 5.

Output after running the full offload command from the man page example
(the new attribute is "max-sdu"):

$ tc qdisc show dev swp0 root
qdisc taprio 8002: root tc 8 map 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0
queues offset 0 count 1 offset 1 count 1 offset 2 count 1 offset 3 count 1 offset 4 count 1 offset 5 count 1 offset 6 count 1 offset 7 count 1
 flags 0x2      base-time 200 cycle-time 100000 cycle-time-extension 0
        index 0 cmd S gatemask 0x80 interval 20000
        index 1 cmd S gatemask 0xa0 interval 20000
        index 2 cmd S gatemask 0x5f interval 60000
max-sdu 0 0 0 0 0 200 0 0 0 0 0 0 0 0 0 0

$ tc -j -p qdisc show dev eno0 root
[ {
        "kind": "taprio",
        "handle": "8002:",
        "root": true,
        "options": {
            "tc": 8,
            "map": [ 0,1,2,3,4,5,6,7,0,0,0,0,0,0,0,0 ],
            "queues": [ {
                    "offset": 0,
                    "count": 1
                },{
                    "offset": 1,
                    "count": 1
                },{
                    "offset": 2,
                    "count": 1
                },{
                    "offset": 3,
                    "count": 1
                },{
                    "offset": 4,
                    "count": 1
                },{
                    "offset": 5,
                    "count": 1
                },{
                    "offset": 6,
                    "count": 1
                },{
                    "offset": 7,
                    "count": 1
                } ],
            "flags": "0x2",
            "base_time": 200,
            "cycle_time": 100000,
            "cycle_time_extension": 0,
            "schedule": [ {
                    "index": 0,
                    "cmd": "S",
                    "gatemask": "0x80",
                    "interval": 20000
                },{
                    "index": 1,
                    "cmd": "S",
                    "gatemask": "0xa0",
                    "interval": 20000
                },{
                    "index": 2,
                    "cmd": "S",
                    "gatemask": "0x5f",
                    "interval": 60000
                } ],
            "max-sdu": [ 0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0 ]
        }
    } ]

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2022-10-31 07:11:28 -06:00
Benjamin Poirier
683a8b8d64 ip-monitor: Do not error out when RTNLGRP_STATS is not available
Following commit 4e8a9914c4 ("ip-monitor: Include stats events in default
and "all" cases"), `ip monitor` fails to start on kernels which do not
contain linux.git commit 5fd0b838efac ("net: rtnetlink: Add UAPI toggle for
IFLA_OFFLOAD_XSTATS_L3_STATS") because the netlink group RTNLGRP_STATS
doesn't exist:

 $ ip monitor
 Failed to add stats group to list

When "stats" is not explicitly requested, ignore the error so that `ip
monitor` and `ip monitor all` continue to work on older kernels.

Note that the same change is not done for RTNLGRP_NEXTHOP because its value
is 32 and group numbers <= 32 are always supported; see the comment above
netlink_change_ngroups() in the kernel source. Therefore
NETLINK_ADD_MEMBERSHIP 32 does not error out even on kernels which do not
support RTNLGRP_NEXTHOP.

v2:
* Silently ignore a failure to implicitly add the stats group, instead of
  printing a warning.

Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Fixes: 4e8a9914c4 ("ip-monitor: Include stats events in default and "all" cases")
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-10-26 08:53:24 -07:00
Andrea Claudi
dc2a4c024f genl: remove unused vars in Makefile
Both GENLLIB and LIBUTIL are not used in genl Makefile, let's get rid of
them.

Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-10-26 08:53:02 -07:00
Andrea Claudi
6d68d7f85d testsuite: fix build failure
After commit 6c09257f1b ("rtnetlink: add new function
rtnl_echo_talk()") "make check" results in:

$ make check

make -C testsuite
make -C iproute2 configure
make -C testsuite alltests
make -C tools
    CC       generate_nlmsg
/usr/bin/ld: /tmp/cc6YaGBM.o: in function `rtnl_echo_talk':
libnetlink.c:(.text+0x25bd): undefined reference to `new_json_obj'
/usr/bin/ld: libnetlink.c:(.text+0x25c7): undefined reference to `open_json_object'
/usr/bin/ld: libnetlink.c:(.text+0x25e3): undefined reference to `close_json_object'
/usr/bin/ld: libnetlink.c:(.text+0x25e8): undefined reference to `delete_json_obj'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:6: generate_nlmsg] Error 1
make[1]: *** [Makefile:40: generate_nlmsg] Error 2
make: *** [Makefile:130: check] Error 2

This is due to json function calls included in libutil and not in
libnetlink. Fix this adding libutil.a to the tools Makefile, and linking
against libcap as required by libutil itself.

Fixes: 6c09257f1b ("rtnetlink: add new function rtnl_echo_talk()")
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
Acked-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-10-26 08:52:02 -07:00
Matthieu Baerts
9b1e0201c6 ss: re-add TIPC query support
TIPC support has been introduced in 'iproute-master' (not -next) in
commit 5caf79a0 ("ss: Add support for TIPC socket diag in ss tool"), at
the same time a refactoring introducing filter_db_parse() was done, see
commit 67d5fd55 ("ss: Put filter DB parsing into a separate function")
from iproute2-next.

When the two commits got merged, the support for TIPC has been
apparently accidentally dropped.

This simply adds the missing entry for TIPC.

Fixes: 2c62a64d ("Merge branch 'iproute2-master' into iproute2-next")
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-10-20 15:59:57 -07:00
Matthieu Baerts
213af7b56b ss: usage: add missing parameters
These query entries were in the man page but not in 'ss -h':

- packet_raw
- packet_dgram
- dccp
- sctp
- xdp (+ the --xdp option)

I only created one commit with all: this fixes multiple commits but all
on the same line.

The only exception is with '--xdp' parameter which is linked to
commit 2abc3d76 ("ss: add AF_XDP support").

Fixes: aba5acdf ("(Logical change 1.3)") # packet raw/dgram
Fixes: 351efcde ("Update header files to 2.6.14") # dccp
Fixes: f89d46ad ("ss: Add support for SCTP protocol") # sctp
Fixes: 2abc3d76 ("ss: add AF_XDP support") # xdp
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-10-20 15:59:57 -07:00
Matthieu Baerts
75ac5c1588 ss: man: add missing entries for TIPC
'ss -h' was mentioning TIPC but not the man page.

Fixes: 5caf79a0 ("ss: Add support for TIPC socket diag in ss tool")
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-10-20 15:59:57 -07:00
Matthieu Baerts
6e42ee9900 ss: man: add missing entries for MPTCP
'ss -h' was mentioning MPTCP but not the man page.

While at it, also add the missing '.' at the end of the list, before the
new sentence.

Fixes: 9c3be2c0 ("ss: mptcp: add msk diag interface support")
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-10-20 15:59:57 -07:00
Junxin Chen
84c0369726 dcb: unblock mnl_socket_recvfrom if not message received
Currently, the dcb command sinks to the kernel through the netlink
to obtain information. However, if the kernel fails to obtain infor-
mation or is not processed, the dcb command is suspended.

For example, if we don't implement dcbnl_ops->ieee_getpfc in the
kernel, the command "dcb pfc show dev eth1" will be stuck and subsequent
commands cannot be executed.

This patch adds the NLM_F_ACK flag to the netlink in mnlu_msg_prepare
to ensure that the kernel responds to user requests.

After the problem is solved, the execution result is as follows:
$ dcb pfc show dev eth1
Attribute not found: Success

Fixes: 67033d1c1c ("Add skeleton of a new tool, dcb")
Signed-off-by: Junxin Chen <chenjunxin1@huawei.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-10-20 15:55:44 -07:00
Vincent Mailhol
3ab6d5d02f iplink_can: add missing `]' of the bitrate, dbitrate and termination arrays
The command "ip --details link show canX" misses the closing bracket
`]' of the bitrate, the dbitrate and the termination arrays. The --json
output is not impacted.

Change the first argument of close_json_array() from PRINT_JSON to
PRINT_ANY to fix the problem. The second argument was already set
correctly.

Fixes: 67f3c7a5cc ("iplink_can: use PRINT_ANY to factorize code and fix signedness")
Reported-by: Marc Kleine-Budde <mkl@pengutronix.de>
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-10-17 20:25:12 -07:00
Stephen Hemminger
1ff227545c u32: fix json formatting of flowid
The code to print json was not done for the flow id.
This would lead to incorrect JSON format output.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-10-13 08:30:34 -07:00
Stephen Hemminger
cb2c7ff007 uapi: update from 6.1 pre rc1
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-10-11 07:17:52 -07:00
Stephen Hemminger
c43a935311 Merge branch 'merge' of ../iproute2-next 2022-10-11 07:14:19 -07:00
Wojciech Drewek
9313ba541f f_flower: Introduce L2TPv3 support
Add support for matching on L2TPv3 session ID.
Session ID can be specified only when ip proto was
set to IPPROTO_L2TP.

L2TPv3 might be transported over IP or over UDP,
this implementation is only about L2TPv3 over IP.
IPv6 is also supported, in this case next header
is set to IPPROTO_L2TP.

Example filter:
  # tc filter add dev eth0 ingress prio 1 protocol ip \
      flower \
        ip_proto l2tp \
        l2tpv3_sid 1234 \
        skip_sw \
      action drop

Reviewed-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2022-10-09 13:54:37 -06:00
Vladimir Oltean
a23a6eff9c taprio: don't print the clockid if invalid
The clockid will not be reported by the kernel if the qdisc is fully
offloaded, since it is implicitly the PTP Hardware Clock of the device.

Currently "tc qdisc show" points us to a "clockid invalid" for a qdisc
created with "flags 0x2", let's hide that attribute instead.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2022-10-09 13:41:57 -06:00
Andrea Claudi
e0bbdb08de man: ss.8: fix a typo
Fixes: f76ad635f2 ("man: break long lines in man page sources")
Reported-by: Prijesh Patel <prpatel@redhat.com>
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
2022-10-05 13:05:07 -07:00
Stephen Hemminger
86ae36a70d v6.0.0 2022-10-04 08:17:15 -07:00
Stephen Hemminger
4b50a646d8 ss: fix duplicate include
No need to include rt_names.h twice.

Fixes: 31f45088c9 ("build: fix build failure with -fno-common")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-10-04 08:11:01 -07:00
David Ahern
bd0935e19c Merge remote-tracking branch 'main/main' into next
Signed-off-by: David Ahern <dsahern@kernel.org>
2022-10-03 08:51:23 -06:00
Eyal Birger
75776cf247 ip: xfrm: support adding xfrm metadata as lwtunnel info in routes
Support for xfrm metadata as lwtunnel metadata was added in kernel commit
2c2493b9da91 ("xfrm: lwtunnel: add lwtunnel support for xfrm interfaces in collect_md mode")

This commit adds the respective support in lwt routes.

Example use (consider ipsec1 as an xfrm interface in "external" mode):

ip route add 10.1.0.0/24 dev ipsec1 encap xfrm if_id 1

Or in the context of vrf, one can also specify the "link" property:

ip route add 10.1.0.0/24 dev ipsec1 encap xfrm if_id 1 link_dev eth15

Signed-off-by: Eyal Birger <eyal.birger@gmail.com>
Reviewed-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2022-10-03 08:49:04 -06:00
Eyal Birger
51a63279f0 ip: xfrm: support "external" (collect_md) mode in xfrm interfaces
Support for collect metadata mode was introduced in kernel commit
abc340b38ba2 ("xfrm: interface: support collect metadata mode")

This commit adds support for creating xfrm interfaces in this
mode.

Example use:

ip link add ipsec1 type xfrm external

Signed-off-by: Eyal Birger <eyal.birger@gmail.com>
Reviewed-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2022-10-03 08:49:03 -06:00