Joachim Wiberg [Wed, 9 Mar 2022 19:23:13 +0000 (20:23 +0100)]
ip: iplink_bridge_slave: support for broadcast flooding
Add per-port support for controlling flooding of broadcast traffic.
Similar to unicast and multcast flooding that already exist.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com> Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org> Signed-off-by: David Ahern <dsahern@kernel.org>
Joachim Wiberg [Wed, 9 Mar 2022 19:23:12 +0000 (20:23 +0100)]
man: bridge: add missing closing " in bridge show mdb
Signed-off-by: Joachim Wiberg <troglobit@gmail.com> Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org> Signed-off-by: David Ahern <dsahern@kernel.org>
Joachim Wiberg [Wed, 9 Mar 2022 19:23:11 +0000 (20:23 +0100)]
man: bridge: document new bcast_flood flag for bridge ports
The bridge link options are not alphabetically sorted, so placing
bcast_flood right before mcast_flood for now.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com> Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org> Signed-off-by: David Ahern <dsahern@kernel.org>
Joachim Wiberg [Wed, 9 Mar 2022 19:23:10 +0000 (20:23 +0100)]
bridge: support for controlling flooding of broadcast per port
Add per-port support for controlling flooding of broadcast traffic.
Similar to unicast and multcast flooding that already exist.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com> Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org> Signed-off-by: David Ahern <dsahern@kernel.org>
Nicolas Escande [Fri, 4 Mar 2022 10:33:54 +0000 (11:33 +0100)]
ip/batadv: allow to specify RA when creating link
This patch adds the possibility to specify batadv specific options when
creating a new batman link. The only option available on link creation
is IFLA_BATADV_ALGO_NAME which specifies the routing algorithm.
Note there is no batadv specific attr to be handled on link dump.
Signed-off-by: Nicolas Escande <nico.escande@gmail.com> Signed-off-by: David Ahern <dsahern@kernel.org>
Baowen Zheng [Fri, 4 Mar 2022 02:01:40 +0000 (10:01 +0800)]
tc: separate action print for filter and action dump
We need to separate action print for filter and action dump since
in action dump, we need to print hardware status and flags. But in
filter dump, we do not need to print action hardware status and
hardware related flags.
In filter dump, actions hardware status should be same with filter.
so we will not print action hardware status in this case.
David Ahern [Mon, 7 Feb 2022 01:00:32 +0000 (18:00 -0700)]
bpf: Remove use of bpf_create_map_xattr
bpf_create_map_xattr is deprecated in v0.7 in favor of bpf_map_create.
bpf_map_create and its bpf_map_create_opts are not available across the
range of v0.1 and up versions of libbpf, so change create_map to use
the bpf syscall directly.
David Ahern [Mon, 7 Feb 2022 00:32:43 +0000 (17:32 -0700)]
bpf_glue: Remove use of bpf_load_program from libbpf
bpf_load_program is deprecated starting in v0.7. The preferred
bpf_prog_load requires bpf_prog_load_opts from v0.6. This creates an
ugly scenario for iproute2 to work across libbpf versions from v0.1
and up.
Since bpf_program_load is only used to load the builtin vrf program,
just remove the libbpf call and use the legacy code.
David Ahern [Fri, 4 Mar 2022 16:18:24 +0000 (09:18 -0700)]
Merge branch '802.1X-locked-bridge-ports' into next
Hans Schultz says:
====================
This patch set is to complement the kernel locked port patches, such
that iproute2 can be used to lock/unlock a port and check if a port
is locked or not. To lock or unlock a port use the command:
bridge link set dev DEV locked {on | off}
To show the detailed setting of a port, including if the locked flag is
enabled for the port(s), use the command:
Geliang Tang [Wed, 23 Feb 2022 06:50:39 +0000 (14:50 +0800)]
mptcp: add port support for setting flags
This patch updated the port keyword check for the setting flags, allow
to use the port keyword with the non-signal flags. Don't allow to use
the port keyword with the id number.
With this patch, we can use setting flags in two forms, using the address
and port number directly or the id number of the address:
ip mptcp endpoint change id 1 fullmesh
ip mptcp endpoint change 10.0.2.1 fullmesh
ip mptcp endpoint change 10.0.2.1 port 10100 fullmesh
Acked-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: Geliang Tang <geliang.tang@suse.com> Signed-off-by: David Ahern <dsahern@kernel.org>
Geliang Tang [Wed, 23 Feb 2022 06:50:38 +0000 (14:50 +0800)]
mptcp: add fullmesh support for setting flags
A pair of new flags, fullmesh and nofullmesh, had been added in the
setting flags of MPTCP PM netlink in kernel space recently by the commit 73c762c1f07d ("mptcp: set fullmesh flag in pm_netlink").
This patch added the corresponding logic to pass these two flags to the
netlink in user space.
These new flags can be used like this:
ip mptcp endpoint change id 1 fullmesh
ip mptcp endpoint change id 1 nofullmesh
ip mptcp endpoint change id 1 backup fullmesh
ip mptcp endpoint change id 1 nobackup nofullmesh
Here's an example of setting fullmesh flags:
> sudo ip mptcp endpoint add 10.0.2.1 subflow
> sudo ip mptcp endpoint show
10.0.2.1 id 1 subflow
> sudo ip mptcp endpoint change id 1 fullmesh
> sudo ip mptcp endpoint show
10.0.2.1 id 1 subflow fullmesh
> sudo ip mptcp endpoint change id 1 nofullmesh
> sudo ip mptcp endpoint show
10.0.2.1 id 1 subflow
It can be seen that 'ip mptcp endpoint show' already supports showing
the fullmesh flag.
Acked-by: Paolo Abeni <pabeni@redhat.com> Acked-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: Geliang Tang <geliang.tang@suse.com> Signed-off-by: David Ahern <dsahern@kernel.org>
Wojciech Drewek [Thu, 10 Feb 2022 12:57:15 +0000 (13:57 +0100)]
f_flower: fix indentation for enc_key_id and u32
Commit b2450e46b7b2 ("flower: fix clang warnings") caused enc_key_id
and u32 to be printed without indentation. Fix this by printing two
spaces before calling print_uint_name_value.
Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com> Signed-off-by: David Ahern <dsahern@kernel.org>
Benjamin Poirier [Mon, 14 Feb 2022 01:44:46 +0000 (10:44 +0900)]
bridge: Remove vlan listing from `bridge link`
vlan listing from `bridge link -d` was broken by commit f32e4977dcb0 ("bridge:
add json support for link command"). print_vlan_info() expects to be passed a
IFLA_AF_SPEC attribute (as is done in print_vlan()) but that commit changed
the call in link.c to pass a IFLA_BRIDGE_VLAN_INFO attribute instead. As a
result, a struct bridge_vlan_info is mistakenly parsed as a struct rtattr and
print_vlan_info() usually exits early in this callpath.
The output style of print_vlan_info() (one line per vlan) is different from
the output style of `bridge link` (multiple attributes per line). The json
output is also unsuitable for `bridge link`. Since vlan listing is available
from `bridge vlan`, remove it from `bridge link` instead of trying to change
print_vlan_info().
Note that previously, bridge master devices would be included in the output
when specifying '-d' (and only in that case) but they are no longer
included because there is no detailed information to show for master
devices if we are not printing a vlan listing:
$ bridge link
4: vxlan0: <BROADCAST,MULTICAST> mtu 1500 master br0 state disabled priority 32 cost 100
$ bridge -d link
3: br0: <BROADCAST,MULTICAST> mtu 1500 master br0
4: vxlan0: <BROADCAST,MULTICAST> mtu 1500 master br0 state disabled priority 32 cost 100
hairpin off guard off root_block off fastleave off learning on flood on mcast_flood on mcast_to_unicast off neigh_suppress off vlan_tunnel on isolated off
$ ./bridge/bridge -d link
4: vxlan0: <BROADCAST,MULTICAST> mtu 1500 master br0 state disabled priority 32 cost 100
hairpin off guard off root_block off fastleave off learning on flood on mcast_flood on mcast_to_unicast off neigh_suppress off vlan_tunnel on isolated off
Fixes: f32e4977dcb0 ("bridge: add json support for link command") Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Benjamin Poirier [Mon, 14 Feb 2022 01:44:45 +0000 (10:44 +0900)]
bridge: Fix error string typo
Fixes: fab9a18a2e52 ("bridge: request vlans along with link information") Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Maxim Petrov [Tue, 15 Feb 2022 20:53:47 +0000 (23:53 +0300)]
lnstat: fix strdup leak in -w argument parsing
'tmp' string is used for safe tokenizing, but it is not required after
getting all the widths in -w option. As 'tmp' string is obtained by strdup
call, the caller has to deallocate it to avoid memory leak.
Signed-off-by: Maxim Petrov <mmrmaximuzz@gmail.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
The can help menu misses three spaces for the TDCV, TDCO and TDCF
parameters, making the closing curly bracket unaligned.
For reference, before this patch:
| $ ip link help can
| Usage: ip link set DEVICE type can
| [ bitrate BITRATE [ sample-point SAMPLE-POINT] ] |
| [ tq TQ prop-seg PROP_SEG phase-seg1 PHASE-SEG1
| phase-seg2 PHASE-SEG2 [ sjw SJW ] ]
|
| [ dbitrate BITRATE [ dsample-point SAMPLE-POINT] ] |
| [ dtq TQ dprop-seg PROP_SEG dphase-seg1 PHASE-SEG1
| dphase-seg2 PHASE-SEG2 [ dsjw SJW ] ]
| [ tdcv TDCV tdco TDCO tdcf TDCF ]
|
| [ loopback { on | off } ]
| [ listen-only { on | off } ]
| [ triple-sampling { on | off } ]
| [ one-shot { on | off } ]
| [ berr-reporting { on | off } ]
| [ fd { on | off } ]
| [ fd-non-iso { on | off } ]
| [ presume-ack { on | off } ]
| [ cc-len8-dlc { on | off } ]
| [ tdc-mode { auto | manual | off } ]
|
| [ restart-ms TIME-MS ]
| [ restart ]
|
| [ termination { 0..65535 } ]
|
| Where: BITRATE := { NUMBER in bps }
| SAMPLE-POINT := { 0.000..0.999 }
| TQ := { NUMBER in ns }
| PROP-SEG := { NUMBER in tq }
| PHASE-SEG1 := { NUMBER in tq }
| PHASE-SEG2 := { NUMBER in tq }
| SJW := { NUMBER in tq }
| TDCV := { NUMBER in tc}
| TDCO := { NUMBER in tc}
| TDCF := { NUMBER in tc}
| RESTART-MS := { 0 | NUMBER in ms }
... and after this patch:
| $ ip link help can
| Usage: ip link set DEVICE type can
| [ bitrate BITRATE [ sample-point SAMPLE-POINT] ] |
| [ tq TQ prop-seg PROP_SEG phase-seg1 PHASE-SEG1
| phase-seg2 PHASE-SEG2 [ sjw SJW ] ]
|
| [ dbitrate BITRATE [ dsample-point SAMPLE-POINT] ] |
| [ dtq TQ dprop-seg PROP_SEG dphase-seg1 PHASE-SEG1
| dphase-seg2 PHASE-SEG2 [ dsjw SJW ] ]
| [ tdcv TDCV tdco TDCO tdcf TDCF ]
|
| [ loopback { on | off } ]
| [ listen-only { on | off } ]
| [ triple-sampling { on | off } ]
| [ one-shot { on | off } ]
| [ berr-reporting { on | off } ]
| [ fd { on | off } ]
| [ fd-non-iso { on | off } ]
| [ presume-ack { on | off } ]
| [ cc-len8-dlc { on | off } ]
| [ tdc-mode { auto | manual | off } ]
|
| [ restart-ms TIME-MS ]
| [ restart ]
|
| [ termination { 0..65535 } ]
|
| Where: BITRATE := { NUMBER in bps }
| SAMPLE-POINT := { 0.000..0.999 }
| TQ := { NUMBER in ns }
| PROP-SEG := { NUMBER in tq }
| PHASE-SEG1 := { NUMBER in tq }
| PHASE-SEG2 := { NUMBER in tq }
| SJW := { NUMBER in tq }
| TDCV := { NUMBER in tc }
| TDCO := { NUMBER in tc }
| TDCF := { NUMBER in tc }
| RESTART-MS := { 0 | NUMBER in ms }
Fixes: 0c263d7c36ff ("iplink_can: add new CAN FD bittiming parameters:
Transmitter Delay Compensat ion (TDC)") Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Acked-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Petr Machata [Wed, 9 Feb 2022 14:41:40 +0000 (15:41 +0100)]
dcb: Fix error reporting when accessing "dcb app"
Currently dcb decodes the response from "dcb app add" and "del" by
interpreting the returned attribute as u8. But the value stored there is
actually a negative errno value.
Additionally, "dcb app" currently shows two sets of messages, one in
dcb_set_attribute_attr_cb() where the issue is detected, and another as a
result of error return from that function.
The current state is as follows:
# dcb app add dev swp36 dscp-prio 20:2
Error when attempting to set attribute: Unknown error 239
Attribute write: No such file or directory
Fix the "unknown error" issue by correctly decoding the attribute as i8 and
negating it. Furthermore, set errno to that value, and let the top-level
"attribute write" error message show the correct message.
Initialize errno to 0 before the dcb_talk() dispatch, and make the error
print conditional on errno != 0. This way the few error messages that are
worth describing in the place where they are detected will not cause the
second error message to be printed.
Maxim Petrov [Tue, 8 Feb 2022 17:20:45 +0000 (20:20 +0300)]
libnetlink: fix socket leak in rtnl_open_byproto()
rtnl_open_byproto() does not close the opened socket in case of
errors, and the socket is returned to the caller in the `fd` field of
the struct. However, none of the callers care about the socket, so
close it in the function immediately to avoid any potential resource
leaks.
Signed-off-by: Maxim Petrov <mmrmaximuzz@gmail.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Roi Dayan [Thu, 3 Feb 2022 12:20:46 +0000 (14:20 +0200)]
tc_util: Fix parsing action control with space and slash
For action police there is an conform-exceed action control
which can be for example "jump 2 / pipe".
The current parsing loop is doing one more iteration than necessary
and results in ok var being 3.
Example filter:
tc filter add dev enp8s0f0_0 ingress protocol ip prio 2 flower \
verbose action police rate 100mbit burst 12m \
conform-exceed jump 1 / pipe mirred egress redirect dev enp8s0f0_1 action drop
Before this change the command will fail.
Trying to add another "pipe" before mirred as a workaround for the stopping the loop
in ok var 3 resulting in result2 not being saved and wrong filter.
... conform-exceed jump 1 / pipe pipe mirred ...
Example dump of the action part:
... action order 1: police 0x1 rate 100Mbit burst 12Mb mtu 2Kb action jump 1 overhead 0b ...
Fix the behavior by removing redundant case 2 handling, either argc is over or breaking.
Example dump of the action part with the fix:
... action order 1: police 0x1 rate 100Mbit burst 12Mb mtu 2Kb action jump 1/pipe overhead 0b ...
Signed-off-by: Roi Dayan <roid@nvidia.com> Reviewed-by: Maor Dickman <maord@nvidia.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
David Ahern [Thu, 10 Feb 2022 17:54:51 +0000 (09:54 -0800)]
Merge branch 'ioam-insert-freq' into next
Justin Iurman says:
====================
The insertion frequency is represented as "k/n", meaning IOAM will be
added to "k" packets over "n" packets, with 0 < k <= n <= 1000000.
Therefore, it provides the following range of insertion frequencies:
[0.0001% ... 100%].
Default frequency is "1/1" (i.e., applied to all packets) for backward
compatibility.
Previous command:
ip -6 ro ad fc00::1/128 encap ioam6 mode ...
New command:
ip -6 ro ad fc00::1/128 encap ioam6 [ freq k/n ] mode ...
Justin Iurman [Sat, 5 Feb 2022 15:52:07 +0000 (16:52 +0100)]
Add support for the IOAM insertion frequency
This patch adds support for the IOAM insertion frequency by introducing
a new parameter "freq". The expected value is "k/n", see the patchset
description for more details.
Signed-off-by: Justin Iurman <justin.iurman@uliege.be> Signed-off-by: David Ahern <dsahern@kernel.org>
Coco Li [Thu, 3 Feb 2022 04:45:58 +0000 (20:45 -0800)]
iplink: add gro_max_size attribute handling
Add the ability to display or change the gro_max_size attribute.
ip link set dev eth1 gro_max_size 60000
ip -d link show eth1
5: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 9198 qdisc mq master eth0 state UP mode DEFAULT group default qlen 1000
link/ether bc:ae:c5:39:69:66 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 46 maxmtu 9600
<...> gro_max_size 60000
Signed-off-by: Coco Li <lixiaoyan@google.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David Ahern <dsahern@kernel.org>
Guillaume Nault [Mon, 31 Jan 2022 11:02:13 +0000 (12:02 +0100)]
iprule: Allow option dsfield in 'ip rule show'
When the dsfield option was added to ip rule, it only worked for add
and delete operations. For consistency, allow it when dumping rules
too.
Fixes: dec01609dc62 ("iproute2: Add dsfield as alias for tos for ip rules") Signed-off-by: Guillaume Nault <gnault@redhat.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Andrea Claudi [Fri, 28 Jan 2022 10:53:58 +0000 (11:53 +0100)]
ss: use freecon() instead of free() when appropriate
According to SELinux API, when resources are allocated using getpidcon()
of getfilecon(), they should be freed using freecon().
This commit makes ss use freecon() where appropriate, defining a stub
function executing a free() useful when iproute2 is compiled without
SELinux support.
Signed-off-by: Andrea Claudi <aclaudi@redhat.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Clang complains about using non-format string in print_color_tv.
The ideal fix would be to put format attribute on all the print_XXX functions
in json_print.h. But that leads to furthur complications because the existing
code may pass a NULL as format if the format is unused since the print
is being done only for JSON output.
The comprimise is to just disable the warning for the one place
it shows up.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David Ahern <dsahern@kernel.org>
Clang complains about passing a non-format string but the code here.
The old code was doing extra work the JSON case. JSON ignores one line mode.
This also fixes output format in oneline mode.
Fixes: 04b215015ba8 ("tc_util: introduce a function to print JSON/non-JSON masked numbers") Cc: elibr@mellanox.com Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David Ahern <dsahern@kernel.org>
Geliang Tang [Sat, 15 Jan 2022 16:04:33 +0000 (00:04 +0800)]
mptcp: add id check for deleting address
This patch added the id check for deleting address in mptcp_parse_opt().
The ADDRESS argument is invalid for the non-zero id address, only needed
for the id 0 address.
# ip mptcp endpoint delete id 1
# ip mptcp endpoint delete id 0 10.0.1.1
Signed-off-by: Geliang Tang <geliang.tang@suse.com> Acked-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Petr Machata [Tue, 18 Jan 2022 11:09:30 +0000 (12:09 +0100)]
dcb: Rewrite array-formatting code to not cause warnings with Clang
Some installation of Clang are unhappy about the use of a hand-rolled
formatting strings, and emit warnings such as this one:
dcb.c:334:31: warning: format string is not a string literal
[-Wformat-nonliteral]
Rewrite the impacted code so that it always uses literal format strings.
Reported-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Petr Machata <petrm@nvidia.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Kevin Bracey [Thu, 6 Jan 2022 11:16:04 +0000 (13:16 +0200)]
q_cake: allow changing to diffserv3
A diffserv3 option (enum value 0) was never sent to the kernel, so it
was not possible to use "tc qdisc change" to select it.
This also meant that were also relying on the kernel's default being
diffserv3 when adding. If the default were to change, we wouldn't have
been able to request diffserv3 explicitly.
Signed-off-by: Kevin Bracey <kevin@bracey.fi> Acked-by: Toke Høiland-Jørgensen <toke@toke.dk> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Vincent Mailhol [Sun, 9 Jan 2022 15:30:40 +0000 (00:30 +0900)]
iplink_can: add ctrlmode_{supported,_static} to the "--details --json" output
This patch is the userland counterpart of [1]. Indeed, [1] enables the
can netlink interface to report the CAN controller capabilities.
Previously, only the options which were switched on were reported
(i.e. can_priv::ctrlmode). Here, we add two additional pieces of
information to the json report:
- ctrlmode_supported: the options that can be modified by netlink
- ctrlmode_static: option which are statically enabled by the driver
(i.e. can not be turned off)
For your information, we borrowed the naming convention from struct
can_priv [2].
Contrary to the ctrlmode, the ctrlmode_{supported,_static} are only
reported in the json context. The reason is that this newly added
information can quickly become very verbose and we do not want to
overload the default output. You can think of the "ip --details link
show canX" output as the verbose mode and the "ip --details --json
link show canX" output as the *very* verbose mode.
*Example:*
This is how the output would look like for a dummy driver which would
have:
- CAN_CTRLMODE_LOOPBACK, CAN_CTRLMODE_LISTENONLY,
CAN_CTRLMODE_3_SAMPLES, CAN_CTRLMODE_FD, CAN_CTRLMODE_CC_LEN8_DLC
and TDC-AUTO supported by the driver
- CAN_CTRLMODE_CC_LEN8_DLC turned on by the user
- CAN_CTRLMODE_FD_NON_ISO statically enabled by the driver
Leon Romanovsky [Sun, 9 Jan 2022 18:41:39 +0000 (20:41 +0200)]
rdma: Don't allocate sparse array
The addition of driver QP type with index 0xFF caused to the following
clang compilation error:
res.c:152:10: warning: result of comparison of constant 256 with expression of type 'uint8_t' (aka 'unsigned char') is always true [-Wtautological-constant-out-of-range-compare]
if (idx < ARRAY_SIZE(qp_types_str) && qp_types_str[idx])
~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~
Instead of allocating very sparse array, simply create separate check
for the driver QP type.
Fixes: 39307384cea7 ("rdma: Add driver QP type string") Reported-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: David Ahern <dsahern@kernel.org>
Leon Romanovsky [Sun, 9 Jan 2022 18:41:38 +0000 (20:41 +0200)]
rdma: Limit copy data by the destination size
The strncat() function will copy upto n bytes supplied as third
argument. The n bytes shouldn't be no more than destination and
not the source.
This change fixes the following clang compilation warnings:
res-srq.c:75:25: warning: size argument in 'strncat' call appears to be size of the source [-Wstrncat-size]
strncat(qp_str, tmp, sizeof(tmp) - 1);
^~~~~~~~~~~~~~~
res-srq.c:99:23: warning: size argument in 'strncat' call appears to be size of the source [-Wstrncat-size]
strncat(qp_str, tmp, sizeof(tmp) - 1);
^~~~~~~~~~~~~~~
res-srq.c:142:25: warning: size argument in 'strncat' call appears to be size of the source [-Wstrncat-size]
strncat(qp_str, tmp, sizeof(tmp) - 1);
^~~~~~~~~~~~~~~
Fixes: 9b272e138d23 ("rdma: Add SRQ resource tracking information") Reported-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: David Ahern <dsahern@kernel.org>
Andrea Claudi [Mon, 3 Jan 2022 18:00:22 +0000 (19:00 +0100)]
testsuite: Fix tc/vlan.t test
Following commit 8323b20f1d76 ("net/sched: act_vlan: No dump for unset
priority"), the kernel no longer dump vlan priority if not explicitly
set before.
When modifying a vlan, tc/vlan.t test expects to find priority set to 0
without setting it explicitly. Thus, after 8323b20f1d76 this test fails.
Fix this simply removing the check on priority.
Signed-off-by: Andrea Claudi <aclaudi@redhat.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Davide Caratti [Thu, 16 Dec 2021 14:29:59 +0000 (15:29 +0100)]
mptcp: add support for changing the backup flag
Linux supports 'MPTCP_PM_CMD_SET_FLAGS' since v5.12, and this control has
recently been extended to allow setting flags for a given endpoint id.
Although there is no use for changing 'signal' or 'subflow' flags, it can
be helpful to set/clear the backup bit on existing endpoints: add the 'ip
mptcp endpoint change <...>' command for this purpose.
Paul Chaignon [Thu, 16 Dec 2021 15:33:36 +0000 (16:33 +0100)]
lib/bpf: fix verbose flag when using libbpf
Since commit 6d61a2b55799 ("lib: add libbpf support"), passing the
verbose flag to tc filter doesn't dump the verifier logs anymore in case
of successful loading.
This commit fixes it by setting the log_level attribute before loading.
To that end, we need to call bpf_object__load_xattr directly instead of
relying on bpf_object__load.
Fixes: 6d61a2b55799 ("lib: add libbpf support") Signed-off-by: Paul Chaignon <paul@isovalent.com> Acked-by: Hangbin Liu <haliu@redhat.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
tc: Add support for ce_threshold_value/mask in fq_codel
Commit dfcb63ce1de6 ("fq_codel: generalise ce_threshold marking for subset
of traffic") added support in fq_codel for setting a value and mask that
will be applied to the diffserv/ECN byte to turn on the ce_threshold
feature for a subset of traffic.
This adds support to iproute for setting these values. The parameter is
called ce_threshold_selector and takes a value followed by a
slash-separated mask. Some examples:
# apply ce_threshold to ECT(1) traffic
tc qdisc replace dev eth0 root fq_codel ce_threshold 1ms ce_threshold_selector 0x1/0x3
# apply ce_threshold to ECN-capable traffic marked as diffserv AF22
tc qdisc replace dev eth0 root fq_codel ce_threshold 1ms ce_threshold_selector 0x50/0xfc
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com> Signed-off-by: David Ahern <dsahern@kernel.org>