Andrea Claudi [Thu, 12 Mar 2026 18:35:47 +0000 (19:35 +0100)]
dpll: Fix missing notifications in monitor mode
When running dpll monitor with output redirected to a file, notifications
could be lost because stdout is fully buffered for file redirection instead
of line-buffered like in interactive mode. If the program is killed or
crashes, buffered data is lost before reaching the file.
Fix by calling fflush(stdout) after each notification to ensure immediate
writes to the log file.
Fixes: 656cfc3ce05b ("dpll: Add dpll command") Signed-off-by: Andrea Claudi <aclaudi@redhat.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Petr Oros [Tue, 24 Feb 2026 09:12:40 +0000 (10:12 +0100)]
dpll: fix pin id-get type filter parsing
dpll_parse_attr_enum() expects the keyword to be already consumed,
but cmd_pin_id_get() used dpll_argv_match() which does not advance
the argument pointer. This caused the parser to read the keyword
"type" as the enum value instead of the actual type (e.g. "gnss").
Use dpll_argv_match_inc() to properly consume the keyword before
parsing the value.
Fixes: 656cfc3ce05b ("dpll: Add dpll command") Signed-off-by: Petr Oros <poros@redhat.com>
Since commit 962692356a1c ("Makefile: use /usr/share/iproute2 for config
files") the path was moved to /usr/share in Makefile; but there
were leftover references.
Reported-by: Yedaya Katsman <yedaya.ka@gmail.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Daniel Schulte [Wed, 25 Feb 2026 19:39:03 +0000 (20:39 +0100)]
ss: Remove trailing whitespace when output is not a TTY
Sometimes a value in the last column might be very long.
When grepping ss output the matched lines are also padded to the longest value.
In some cases this can result in multiple lines of the terminal getting filled
with spaces.
Don't print right padding in last visible column when ss can't determine the
screen width.
Signed-off-by: Daniel Schulte <trilader@schroedingers-bit.net>
ss: suppress netlink errors for unsupported protocols
Error messages from sock_diag were only suppressed for extended
protocols (> 255). Protocols like SCTP and DCCP also get EINVAL
when their kernel modules are not loaded. Remove the conditional
so all protocols suppress the error.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Daniel Zahka [Fri, 6 Feb 2026 21:11:30 +0000 (13:11 -0800)]
devlink: support displaying and resetting to default params
Add devlink cli support for default param values.
For param-get, any default values provided by the kernel will be
displayed next to the current value. For param-set,
DEVLINK_ATTR_PARAM_RESET_DEFAULT can be included in the request to
request that the parameter be reset to its default value.
Default values of type bool are encoded with a u8 by the kernel to
distinguish "false" from "not present".
Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com> Signed-off-by: David Ahern <dsahern@kernel.org>
Daniel Zahka [Fri, 6 Feb 2026 21:11:29 +0000 (13:11 -0800)]
devlink: Pull the value printing logic out of pr_out_param_value()
Split the type demux and value print out of pr_out_param_value() into
a new function pr_out_param_value_print(). This new function can be
re-used for printing additional kinds of values e.g., a default value
reported by the kernel.
Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com> Signed-off-by: David Ahern <dsahern@kernel.org>
There are two mounts (6443 and 6444) related to the "xxx" netns created
above.
This redundancy occurs because systemd changed the default system mount
propagation to "shared" since commit b3ac5f8cb987 ("mount-setup: change
system mount propagation to shared by default"). Consequently, mount
propagation of `/run` is shared.
To prevent this, `/run/netns` should be placed in a new peer group. This
can be achieved by reconfiguring `/run/netns` to MS_PRIVATE first, and
then to MS_SHARED again.
With this patch applied, the redundant mount is no longer present, and
`/run/netns` is in a new peer group (917):
Ivan Vecera [Tue, 3 Feb 2026 10:14:21 +0000 (11:14 +0100)]
dpll: add support for fractional frequency offset in ppt
Add support for the DPLL_A_PIN_FRACTIONAL_FREQUENCY_OFFSET_PPT attribute
to the pin print attributes.
The logic ensures that in standard (human-readable) output, the legacy
fractional-frequency-offset is hidden if the new ppt (parts per trillion)
value is present, preventing redundant information.
However, the legacy attribute is still printed if:
1. The output format is JSON (to maintain full data availability).
2. The new PPT attribute is missing (backward compatibility with older
kernels).
Human-readable output example:
==============================
[root@host iproute2-next]# ./dpll/dpll pin show id 5
pin id 5:
module-name: zl3073x
clock-id: 5855731461854439600
board-label: TCX0
package-label: REF4P
type: ext
frequency: 20000000 Hz
frequency-supported: 20000000 Hz
capabilities: 0x6 state-can-change priority-can-change
phase-adjust-min: -2147483648
phase-adjust-max: 2147483647
phase-adjust: 0
fractional-frequency-offset-ppt: 3003980
esync-frequency: 0 Hz
esync-pulse: 0
parent-device:
id 0 direction input prio 14 state disconnected phase-offset 0
id 1 direction input prio 14 state disconnected phase-offset 0
ss: fix grammar, articles, and phrasing in man page
This patch addresses grammatical errors, awkward phrasing, missing
articles, and singular/plural agreement issues throughout the ss
man page documentation.
Main corrections:
Grammar and agreement (10 instances):
- Fix singular/plural: "connection" -> "connections"
- Fix "five kind" -> "five kinds"
- Fix "packet" -> "packets" (7 instances throughout memory descriptions)
- Fix "the retransmission occurred" -> "retransmissions have occurred"
- Fix "process using socket" -> "processes using sockets"
- Fix "thread using socket" -> "threads using sockets"
- Fix "socket option" -> "socket options"
Article corrections:
- Fix "an uuid" -> "a uuid" (use "a" before consonant sounds)
- Fix "construct arbitrary set" -> "construct an arbitrary set"
- Fix "these information" -> "this information" (uncountable noun)
- Add "instead of human-readable values" (complete phrase)
Awkward phrasing (4 instances):
- Fix "how long time the timer will expire" -> "how long until the timer will expire"
- Fix "how long time since" -> "how long it has been since" (3 instances for lastsnd, lastrcv, lastack)
Additional grammar fixes:
- Add relative pronoun: "memory can be allocated" -> "memory that can be allocated" (2 instances)
- Fix conditional: "If need memory" -> "If memory is needed"
- Fix gerund: "before allocate" -> "before allocating"
- Fix sentence fragment: "Following normal arithmetic rules." -> "following normal arithmetic rules"
- Add missing period to back_log description
Formatting:
- Remove duplicate .TP markup between --tipc and --vsock options
No functional changes. All technical content remains accurate.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: David Ahern <dsahern@kernel.org>
David Ahern [Sat, 31 Jan 2026 19:07:48 +0000 (12:07 -0700)]
Merge branch 'man-page-fixups' into next
Stephen Hemminger says:
====================
AI does a great job of finding and fixing manual pages.
This patch series is the result of editorial review and correction of
subsystem man pages, addressing grammatical errors, style inconsistencies, and
clarity issues throughout the documentation.
The corrections cover the following subsystems:
- DCB (Data Center Bridging)
- devlink
- Statistics tools (lnstat, rtacct, nstat)
- netshaper
- TIPC
- vdpa
- RDMA
Common patterns corrected across all man pages:
- Subject-verb agreement and singular/plural consistency
- Missing or incorrect articles (a, an, the)
- Inconsistent verb tenses in command descriptions
- Missing terminal punctuation in examples and descriptions
- Overly long section headers (split into concise headers + body text)
- Awkward or non-idiomatic English phrasing
- Copy-paste errors (e.g., incorrect titles from template files)
- Formatting issues (duplicate markup, missing commas in cross-references)
All corrections are purely editorial. No functional changes have been made, and
all technical content remains accurate. The documentation now maintains consistent
style and proper grammar while preserving the original technical information.
Total corrections: approximately 100+ individual fixes across 40+ man page files.
rdma: fix grammar, formatting, and style in man pages
This patch addresses grammatical errors, overly long section headers,
missing punctuation, and style inconsistencies across all RDMA man
page documentation.
Changes by file:
rdma.8:
- Fix hyphenation: "non zero" -> "non-zero"
- Remove article: "a pretty JSON" -> "pretty JSON"
- Capitalize option description: "output" -> "Output"
- Add missing period after "monitor"
rdma-dev.8:
- Split overly long section headers into concise titles + body text
- Fix semicolon to period and add missing articles
- Fix possessive: "it's parent" -> "its parent"
- Add missing article: "specified" -> "the specified"
- Fix tense: "is previously created" -> "was previously created"
- Add article: "iproute2 ip command" -> "the iproute2 ip command"
- Fix verb tense in examples: "Add" -> "Adds", "Delete" -> "Deletes"
rdma-link.8:
- Split overly long section header
- Add missing article: "specified" -> "the specified"
- Add missing periods (2 instances)
rdma-monitor.8:
- Split awkward section header and reword
- Add missing period
rdma-resource.8:
- Add missing article: "specified" -> "the specified"
- Add missing periods (4 instances)
rdma-statistic.8:
- Split overly long section header
- Fix verb form: "are bind" -> "are bound"
- Add missing periods (7 instances)
- Fix grammar: "does not exists" -> "it does not exist"
- Fix plural verb: "that was enabled" -> "that were enabled"
The most significant improvements are splitting overly long section
headers across multiple files, fixing missing punctuation in examples,
and correcting various grammatical errors.
No functional changes. All technical content remains accurate.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David Ahern <dsahern@kernel.org>
The title corrections in vdpa-dev.8 and vdpa-mgmtdev.8 fix critical
copy-paste errors that would cause man page indexing problems and
confusion about which command is being documented.
No functional changes. All technical content remains accurate.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David Ahern <dsahern@kernel.org>
netshaper: fix grammar and style issues in man page
This patch addresses grammatical errors and style inconsistencies in
the netshaper man page documentation.
Changes:
- Improve clarity of set command description by restructuring
awkward parenthetical about id parameter
- Fix punctuation consistency in scope list formatting
- Capitalize "ID" in example heading for proper title case
- Add missing article "the" in color option description (3 instances)
- Make example descriptions consistent by using present tense
third person ("Displays", "Removes") to match Example 1
No functional changes. All technical content remains accurate.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David Ahern <dsahern@kernel.org>
fix grammar and style issues in man pages for stat related pages
This patch addresses grammatical errors and style inconsistencies in
the ifstat, lnstat, and rtacct man pages documentation.
lnstat Changes:
- Capitalize "Linux" as proper noun in NAME and DESCRIPTION sections
- Add missing period to -j/--json option description
- Fix passive voice: "is being used" -> "is used"
- Fix word form: "can not" -> "cannot"
rtacct Changes:
- Fix date format: remove comma in "27 June, 2007" -> "27 June 2007"
- Remove period from NAME section per man page convention
- Capitalize SNMP acronym (2 instances)
- Add missing periods to -h and -V option descriptions
- Improve clarity of -s/--noupdate description
- Add missing article in -d/--scan description
No functional changes. All technical content remains accurate.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David Ahern <dsahern@kernel.org>
devlink: fix grammar and style issues in man pages
This patch addresses various grammatical errors, style inconsistencies,
and clarity issues across the devlink man page documentation.
Changes by file:
devlink.8:
- Add missing article "The" in -b option description
- Add missing periods in object descriptions (region, health, trap)
- Update synopsis to include all objects (rate, lc, dpipe)
- Add descriptions for rate, lc, and dpipe objects
- Add complete cross-references in SEE ALSO section
This patch addresses various grammatical errors, style inconsistencies,
and clarity issues across the DCB man page documentation.
Changes by file:
dcb.8:
- Capitalize first word of -n option description
- Add missing article "The" in -b option description
- Fix verb form "shown" -> "show" in -s option description
- Add missing dcb-dcbx(8) reference in SEE ALSO section
dcb-app.8:
- Add missing article "the" before "APP table"
- Fix singular/plural: "value" -> "values"
- Improve phrasing: "priority of both 1 and 2" -> "priorities 1 and 2"
- Make command descriptions consistent (present tense)
- Simplify relative clause construction in default-prio description
- Fix PCP/DEI description formatting and punctuation
dcb-apptrust.8:
- Remove inappropriate period in NAME section
- Improve clarity by removing unnecessary commas and redundant phrasing
- Use present tense instead of future in DESCRIPTION
- Make command descriptions consistent with proper articles
dcb-buffer.8:
- Remove unnecessary "be" in DESCRIPTION
- Add missing comma in prio-buffer parameter description
dcb-dcbx.8:
- Capitalize first word of static parameter description
dcb-ets.8:
- Add missing commas after introductory phrases in prio-tc and
tc-tsa parameter descriptions
dcb-rewr.8:
- Capitalize month name in TH date
- Fix subject-verb agreement and plural forms in DESCRIPTION
- Make command descriptions consistent (present tense)
- Fix PCP/DEI description formatting and punctuation
- Add missing commas in SEE ALSO section
- Fix spacing in REPORTING BUGS section
No functional changes. All technical content remains accurate.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David Ahern <dsahern@kernel.org>
Petr Oros [Thu, 29 Jan 2026 11:28:49 +0000 (12:28 +0100)]
dpll: add mode setting support
Add ability to set DPLL device operating mode (automatic/manual)
through "dpll device set id ID mode MODE" command.
In automatic mode, the DPLL autonomously selects the best input
source based on priority and quality. In manual mode, the input
source must be explicitly configured.
The implementation adds dpll_mode_map for string-to-enum conversion,
str_to_dpll_mode() and dpll_parse_mode() functions, and refactors
dpll_mode_name() to use str_map_lookup_uint() for consistency.
Man page and bash completion updated accordingly.
Signed-off-by: Petr Oros <poros@redhat.com> Tested-by: Ivan Vecera <ivecera@redhat.com> Signed-off-by: David Ahern <dsahern@kernel.org>
man: Add cake_mq documentation to the tc-cake man page
Add documentation for the cake_mq qdisc to the tc-cake man page,
including a section describing the differences between the single-queue
and multi-queue CAKE variants.
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com> Signed-off-by: David Ahern <dsahern@kernel.org>
Ido Schimmel [Thu, 15 Jan 2026 11:50:04 +0000 (13:50 +0200)]
devlink: Fix resource show output
When the user asks to show device resources, devlink first queries the
device's dpipe tables so that it will be able to show the association
between resources and dpipe tables.
In this flow, 'ctx->resources' is always NULL as resources have yet to
be retrieved. As a result, the dpipe tables are not associated with a
resource identifier and the resource show command does not show any
dpipe tables:
$ devlink resource show pci/0000:03:00.0
pci/0000:03:00.0:
name kvd size 258048 unit entry dpipe_tables none
resources:
name linear size 98304 occ 1 unit entry size_min 0 size_max 159744 size_gran 128 dpipe_tables none
resources:
name singles size 16384 occ 1 unit entry size_min 0 size_max 159744 size_gran 1 dpipe_tables none
name chunks size 49152 occ 0 unit entry size_min 0 size_max 159744 size_gran 32 dpipe_tables none
name large_chunks size 32768 occ 0 unit entry size_min 0 size_max 159744 size_gran 512 dpipe_tables none
name hash_double size 65408 unit entry size_min 32768 size_max 192512 size_gran 128 dpipe_tables none
name hash_single size 94336 unit entry size_min 65536 size_max 225280 size_gran 128 dpipe_tables none
name span_agents size 3 occ 0 unit entry dpipe_tables none
name counters size 32766 occ 4 unit entry dpipe_tables none
resources:
name rif size 8192 occ 0 unit entry dpipe_tables none
name flow size 24574 occ 4 unit entry dpipe_tables none
name global_policers size 1000 unit entry dpipe_tables none
resources:
name single_rate_policers size 968 occ 0 unit entry dpipe_tables none
name rif_mac_profiles size 1 occ 0 unit entry dpipe_tables none
name rifs size 1000 occ 1 unit entry dpipe_tables none
name port_range_registers size 16 occ 0 unit entry dpipe_tables none
name physical_ports size 64 occ 32 unit entry dpipe_tables none
Fix by moving the check against 'ctx->resources' to the place where it
is actually used. Output after the fix:
$ devlink resource show pci/0000:03:00.0
pci/0000:03:00.0:
name kvd size 258048 unit entry dpipe_tables none
resources:
name linear size 98304 occ 1 unit entry size_min 0 size_max 159744 size_gran 128
dpipe_tables:
table_name mlxsw_adj
resources:
name singles size 16384 occ 1 unit entry size_min 0 size_max 159744 size_gran 1 dpipe_tables none
name chunks size 49152 occ 0 unit entry size_min 0 size_max 159744 size_gran 32 dpipe_tables none
name large_chunks size 32768 occ 0 unit entry size_min 0 size_max 159744 size_gran 512 dpipe_tables none
name hash_double size 65408 unit entry size_min 32768 size_max 192512 size_gran 128
dpipe_tables:
table_name mlxsw_host6
name hash_single size 94336 unit entry size_min 65536 size_max 225280 size_gran 128
dpipe_tables:
table_name mlxsw_host4
name span_agents size 3 occ 0 unit entry dpipe_tables none
name counters size 32766 occ 4 unit entry dpipe_tables none
resources:
name rif size 8192 occ 0 unit entry dpipe_tables none
name flow size 24574 occ 4 unit entry dpipe_tables none
name global_policers size 1000 unit entry dpipe_tables none
resources:
name single_rate_policers size 968 occ 0 unit entry dpipe_tables none
name rif_mac_profiles size 1 occ 0 unit entry dpipe_tables none
name rifs size 1000 occ 1 unit entry dpipe_tables none
name port_range_registers size 16 occ 0 unit entry dpipe_tables none
name physical_ports size 64 occ 32 unit entry dpipe_tables none
Fixes: 0e7e1819453c ("devlink: relax dpipe table show dependency on resources") Reviewed-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: Ido Schimmel <idosch@nvidia.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Jan Vaclav [Tue, 13 Jan 2026 11:41:27 +0000 (12:41 +0100)]
ip/iplink: fix off-by-one KIND length in modify()
The expected size for IFLA_INFO_KIND in kernel is strlen(kind) + 1.
See `size` in rtnl_link_get_size() in net/core/rtnetlink.c.
Fixes: 1d93483985f0 ("iplink: use netlink for link configuration") Reported-by: Gris Ge <fge@redhat.com> Signed-off-by: Jan Vaclav <jvaclav@redhat.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Vincent Mailhol [Wed, 3 Dec 2025 18:24:34 +0000 (19:24 +0100)]
iplink_can: add CAN XL TMS PWM configuration support
This is the iproute2 counterpart of Linux kernel's commit 46552323fa67
("can: netlink: add PWM netlink interface").
When the TMS is switched on, the node uses PWM (Pulse Width Modulation)
during the data phase instead of the classic NRZ (Non Return to Zero)
encoding.
PWM is configured by three parameters:
- PWMS: Pulse Width Modulation Short phase
- PWML: Pulse Width Modulation Long phase
- PWMO: Pulse Width Modulation Offset time
For each of these parameters, the CAN netlink interface defines three IFLA
symbols:
- IFLA_CAN_PWM_PWM*_MIN: the minimum allowed value.
- IFLA_CAN_PWM_PWM*_MAX: the maximum allowed value.
- IFLA_CAN_PWM_PWM*: the runtime value.
This results in a total of nine IFLA symbols which are all nested in a
parent IFLA_CAN_XL_PWM symbol.
Add the "pwms", "pwml" and "pwmo" options to iplink_can which controls the
IFLA_CAN_PWM_PWM* runtime values.
Add the logic to query and print all those IFLA values. Update
print_usage() accordingly.
Vincent Mailhol [Wed, 3 Dec 2025 18:24:33 +0000 (19:24 +0100)]
iplink_can: add CAN XL transceiver mode setting (TMS) support
This is the iproute2 counterpart of Linux kernel's commit 233134af2086
("can: netlink: add CAN_CTRLMODE_XL_TMS flag").
The Transceiver Mode Switching (TMS) indicates whether the CAN XL
controller shall use the PWM or NRZ encoding during the data phase.
The term "transceiver mode switching" is used in both ISO 11898-1 and CiA
612-2 (although only the latter one uses the abbreviation TMS). We adopt
the same naming convention here for consistency.
Add the "tms" option to iplink_can which controls the CAN_CTRLMODE_XL_TMS
flag of the CAN netlink interface.
Signed-off-by: Vincent Mailhol <mailhol@kernel.org> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Vincent Mailhol [Wed, 3 Dec 2025 18:24:32 +0000 (19:24 +0100)]
iplink_can: add initial CAN XL support
This is the iproute2 counterpart of Linux kernel's commit e63281614747
("can: netlink: add initial CAN XL support").
CAN XL uses bittiming parameters different from Classical CAN and CAN FD.
Thus, all the data bittiming parameters, including TDC, need to be
duplicated for CAN XL.
Add the "xl" option to iplink_can which controls the CAN_CTRLMODE_XL flag
of the netlink interface. Then add the "xbitrate", "xsample-point", "xtq",
"xprop-seg", "xphase-seg1", "xphase-seg2", "xsjw", "xtdcv", "xtdco",
"xtdcf" and "xtdc-mode" which are all sub options of "xl". Add the logic to
query and print all those values. Update print_usage() accordingly.
All these options behave similarly to their CAN FD equivalent.
The new options which are specific to CAN XL (i.e. not inherited from CAN
FD) will be added in a subsequent change.
Vincent Mailhol [Wed, 3 Dec 2025 18:24:31 +0000 (19:24 +0100)]
iplink_can: add RESTRICTED operation mode support
This is the iproute2 counterpart of Linux kernel's commit 60f511f443e5
("can: netlink: add CAN_CTRLMODE_RESTRICTED").
ISO 11898-1:2024 adds a new restricted operation mode. This mode is added
as a mandatory feature for nodes which support CAN XL and is retrofitted as
optional for legacy nodes (i.e. the ones which only support Classical CAN
and CAN FD).
The restricted operation mode is nearly the same as the listen only mode:
the node can not send data frames or remote frames and can not send
dominant bits if an error occurs. The only exception is that the node shall
still send the acknowledgment bit.
Add the "restricted" option to iplink_can which controls the
CAN_CTRLMODE_RESTRICTED flag of the netlink interface.
Signed-off-by: Vincent Mailhol <mailhol@kernel.org> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Vincent Mailhol [Wed, 3 Dec 2025 18:24:30 +0000 (19:24 +0100)]
iplink_can: print_usage: describe the CAN bittiming units
While the meaning of "bps" or "ns" may be relatively easy to understand,
some of the CAN specific units such as "mtq" (minimum time quanta) may be
harder to understand.
Add a new paragraph to the help menu which describes all the different
units used for the CAN bittiming parameters.
Signed-off-by: Vincent Mailhol <mailhol@kernel.org> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Vincent Mailhol [Wed, 3 Dec 2025 18:24:29 +0000 (19:24 +0100)]
iplink_can: print_usage: change unit for minimum time quanta to mtq
In the vast majority of the available CAN datasheets, the minimum time
quanta is abbreviated as "mtq". Note that the ISO standard uses "tqmin"
(with the "min" part as a subscript).
One fact is that no one seems to be using "tc". I was actually the one who
initially proposed to use "tc", but I can not recall anymore the reasoning
behind that.
Change the minimum time quanta unit from "tc" to "mtq" to follow what the
majority of the industry does.
Fixes: 0c263d7c36ff ("iplink_can: add new CAN FD bittiming parameters: Transmitter Delay Compensation (TDC)") Signed-off-by: Vincent Mailhol <mailhol@kernel.org> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Vincent Mailhol [Wed, 3 Dec 2025 18:24:28 +0000 (19:24 +0100)]
iplink_can: print_usage: fix the text indentation
The description of the BITRATE variable is not correctly aligned with the
other ones. Put it on a new line with the same indentation as the other
variables.
This done, reindent everything to only one tabulation (was one tabulation
and two spaces before).
Before this patch...:
$ ip link help can
Usage: ip link set DEVICE type can
(...)
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:
$ ip link help can
Usage: ip link set DEVICE type can
(...)
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 }
Signed-off-by: Vincent Mailhol <mailhol@kernel.org> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Eric Biggers [Thu, 18 Dec 2025 20:09:10 +0000 (12:09 -0800)]
lib/bpf_legacy: Use userspace SHA-1 code instead of AF_ALG
Add a basic SHA-1 implementation to lib/, and make lib/bpf_legacy.c use
it to calculate SHA-1 digests instead of the previous AF_ALG-based code.
This eliminates the dependency on AF_ALG, specifically the kernel config
options CONFIG_CRYPTO_USER_API_HASH and CONFIG_CRYPTO_SHA1.
Over the years AF_ALG has been very problematic, and it is also not
supported on all kernels. Escalating to the kernel's privileged
execution context merely to calculate software algorithms, which can be
done in userspace instead, is not something that should have ever been
supported. Even on kernels that support it, the syscall overhead of
AF_ALG means that it is often slower than userspace code.
Let's do the right thing here, and allow people to disable AF_ALG
support (or not enable it) on systems where iproute2 is the only user.
Acked-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Eric Biggers <ebiggers@kernel.org> Signed-off-by: David Ahern <dsahern@kernel.org>
Vincent Mailhol [Wed, 3 Dec 2025 18:24:34 +0000 (19:24 +0100)]
iplink_can: add CAN XL TMS PWM configuration support
This is the iproute2 counterpart of Linux kernel's commit 46552323fa67
("can: netlink: add PWM netlink interface").
When the TMS is switched on, the node uses PWM (Pulse Width Modulation)
during the data phase instead of the classic NRZ (Non Return to Zero)
encoding.
PWM is configured by three parameters:
- PWMS: Pulse Width Modulation Short phase
- PWML: Pulse Width Modulation Long phase
- PWMO: Pulse Width Modulation Offset time
For each of these parameters, the CAN netlink interface defines three IFLA
symbols:
- IFLA_CAN_PWM_PWM*_MIN: the minimum allowed value.
- IFLA_CAN_PWM_PWM*_MAX: the maximum allowed value.
- IFLA_CAN_PWM_PWM*: the runtime value.
This results in a total of nine IFLA symbols which are all nested in a
parent IFLA_CAN_XL_PWM symbol.
Add the "pwms", "pwml" and "pwmo" options to iplink_can which controls the
IFLA_CAN_PWM_PWM* runtime values.
Add the logic to query and print all those IFLA values. Update
print_usage() accordingly.
Vincent Mailhol [Wed, 3 Dec 2025 18:24:33 +0000 (19:24 +0100)]
iplink_can: add CAN XL transceiver mode setting (TMS) support
This is the iproute2 counterpart of Linux kernel's commit 233134af2086
("can: netlink: add CAN_CTRLMODE_XL_TMS flag").
The Transceiver Mode Switching (TMS) indicates whether the CAN XL
controller shall use the PWM or NRZ encoding during the data phase.
The term "transceiver mode switching" is used in both ISO 11898-1 and CiA
612-2 (although only the latter one uses the abbreviation TMS). We adopt
the same naming convention here for consistency.
Add the "tms" option to iplink_can which controls the CAN_CTRLMODE_XL_TMS
flag of the CAN netlink interface.
Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
Vincent Mailhol [Wed, 3 Dec 2025 18:24:32 +0000 (19:24 +0100)]
iplink_can: add initial CAN XL support
This is the iproute2 counterpart of Linux kernel's commit e63281614747
("can: netlink: add initial CAN XL support").
CAN XL uses bittiming parameters different from Classical CAN and CAN FD.
Thus, all the data bittiming parameters, including TDC, need to be
duplicated for CAN XL.
Add the "xl" option to iplink_can which controls the CAN_CTRLMODE_XL flag
of the netlink interface. Then add the "xbitrate", "xsample-point", "xtq",
"xprop-seg", "xphase-seg1", "xphase-seg2", "xsjw", "xtdcv", "xtdco",
"xtdcf" and "xtdc-mode" which are all sub options of "xl". Add the logic to
query and print all those values. Update print_usage() accordingly.
All these options behave similarly to their CAN FD equivalent.
The new options which are specific to CAN XL (i.e. not inherited from CAN
FD) will be added in a subsequent change.
Vincent Mailhol [Wed, 3 Dec 2025 18:24:31 +0000 (19:24 +0100)]
iplink_can: add RESTRICTED operation mode support
This is the iproute2 counterpart of Linux kernel's commit 60f511f443e5
("can: netlink: add CAN_CTRLMODE_RESTRICTED").
ISO 11898-1:2024 adds a new restricted operation mode. This mode is added
as a mandatory feature for nodes which support CAN XL and is retrofitted as
optional for legacy nodes (i.e. the ones which only support Classical CAN
and CAN FD).
The restricted operation mode is nearly the same as the listen only mode:
the node can not send data frames or remote frames and can not send
dominant bits if an error occurs. The only exception is that the node shall
still send the acknowledgment bit.
Add the "restricted" option to iplink_can which controls the
CAN_CTRLMODE_RESTRICTED flag of the netlink interface.
Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
Vincent Mailhol [Wed, 3 Dec 2025 18:24:30 +0000 (19:24 +0100)]
iplink_can: print_usage: describe the CAN bittiming units
While the meaning of "bps" or "ns" may be relatively easy to understand,
some of the CAN specific units such as "mtq" (minimum time quanta) may be
harder to understand.
Add a new paragraph to the help menu which describes all the different
units used for the CAN bittiming parameters.
Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
Vincent Mailhol [Wed, 3 Dec 2025 18:24:29 +0000 (19:24 +0100)]
iplink_can: print_usage: change unit for minimum time quanta to mtq
In the vast majority of the available CAN datasheets, the minimum time
quanta is abbreviated as "mtq". Note that the ISO standard uses "tqmin"
(with the "min" part as a subscript).
One fact is that no one seems to be using "tc". I was actually the one who
initially proposed to use "tc", but I can not recall anymore the reasoning
behind that.
Change the minimum time quanta unit from "tc" to "mtq" to follow what the
majority of the industry does.
Fixes: 0c263d7c36ff ("iplink_can: add new CAN FD bittiming parameters: Transmitter Delay Compensation (TDC)") Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
Vincent Mailhol [Wed, 3 Dec 2025 18:24:28 +0000 (19:24 +0100)]
iplink_can: print_usage: fix the text indentation
The description of the BITRATE variable is not correctly aligned with the
other ones. Put it on a new line with the same indentation as the other
variables.
This done, reindent everything to only one tabulation (was one tabulation
and two spaces before).
Before this patch...:
$ ip link help can
Usage: ip link set DEVICE type can
(...)
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:
$ ip link help can
Usage: ip link set DEVICE type can
(...)
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 }
Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
Akhilesh Nema [Wed, 3 Dec 2025 02:11:24 +0000 (18:11 -0800)]
fix 'UINT_MAX' undeclared with build with musl libc
- utils_math.c:136:20: error: 'UINT_MAX' undeclared (first use in this function)
- tc_core.c:51:22: error: 'UINT_MAX' undeclared (first use in this function)
Signed-off-by: Akhilesh Nema <nemaakhilesh@gmail.com>
Until recently, the 'flags' attribute was not used. This has recently
been changed with the introduction of the 'deny_join_id0' flag [1].
This flag is set when a connection is created and the other peer set the
'C' flag in the MP_CAPABLE packets [2]. This flag can be set to tell the
other side that the peer will not accept extra subflows requests sent to
its initial IP address and port: typically set by a server behind a
legacy Layer 4 load balancer.
Now, when this flag is set, "deny_join_id0" will be printed instead of
"flags=1". Unknown remaining flags will be printed in hexadecimal at the
end, e.g. "flags=0x2".
This info has been added a while ago in the kernel [1], but it was not
displayed in 'ip monitor'.
Now, 'server_side' is displayed if the attribute is defined and set to
true. It looks better to do that instead of showing server_side=0. Note
that since v6.18 [2], this attribute is only defined if it is set to
true.
This new endpoint type has been recently added to the kernel in v6.18
[1]. It will be used to create new subflows from the associated address
to additional addresses announced by the other peer. This will be done
if allowed by the MPTCP limits, and if the associated address is not
already being used by another subflow from the same MPTCP connection.
Note that the fullmesh flag takes precedence over the laminar one.
Without any of these two flags, the path-manager will create new
subflows to additional addresses announced by the other peer by
selecting the source address from the routing tables, which is harder to
configure if the announced address is not known in advance.
The support of the new flag is easy: simply by adding it in the
mptcp_addr_flag_names array.
The usage menu and the manual now references the new endpoint type. The
new corresponding counter has also been added in ss.
Add Matthieu as main maintainer, but also the MPTCP Linux mailing list
to reach more people interested by MPTCP when submitting patches on this
subject.
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Signed-off-by: David Ahern <dsahern@kernel.org>
David Ahern [Fri, 21 Nov 2025 16:12:27 +0000 (09:12 -0700)]
Merge branch 'dpll' into next
Petr Oros says:
====================
This patch series adds a new userspace tool for managing and monitoring
DPLL (Digital Phase-Locked Loop) devices via the Linux kernel DPLL
subsystem.
The series includes preparatory patches to move shared code to lib/ and
the main dpll tool implementation with full support for device/pin
management, monitoring, and JSON output.
Petr Oros [Tue, 18 Nov 2025 14:10:31 +0000 (15:10 +0100)]
dpll: Add dpll command
Add a new userspace tool for managing and monitoring DPLL devices via the
Linux kernel DPLL subsystem. The tool uses libmnl for netlink communication
and provides a complete interface for device and pin configuration.
- ID resolution: query device/pin IDs by various attributes (module-name,
clock-id, board-label, type)
- Monitoring: real-time display of device and pin state changes via netlink
multicast notifications
- Output formats: both human-readable and JSON output (with pretty-print
support)
The tool belongs in iproute2 as DPLL devices are tightly integrated with
network interfaces - modern NICs provide hardware clock synchronization
support. The DPLL subsystem uses the same netlink infrastructure as other
networking subsystems, and the tool follows established iproute2 patterns
for command structure, output formatting, and error handling.
Example usage:
# dpll device show
# dpll device id-get module-name ice
# dpll device set id 0 phase-offset-monitor enable
# dpll pin show
# dpll pin set id 0 frequency 10000000
# dpll pin set id 13 parent-device 0 state connected prio 10
# dpll pin set id 0 reference-sync 1 state connected
# dpll monitor
# dpll -j -p device show
Testing notes:
Tested on real hardware with ice and zl3073x drivers. All commands work
(device show/set/id-get, pin show/set/id-get, monitor). JSON output was
carefully compared with cli.py - the tools are interchangeable.
v2:
- Added testing notes
- Added MAINTAINERS entry
- Removed unused -n parameter from man page
v3:
- Use shared mnlg and str_to_bool helpers from lib
- Use str_num_map for bidirectional string/enum mapping
- Remove unnecessary else after return
- Remove misleading "legacy" comments
- Simplify DPLL_PR_MULTI_ENUM_STR macro
- Convert json_output to global json variable
- Use appropriate mnl helpers with proper type casting to respect signed integer data types
- Use DPLL_PR_INT_FMT for phase-adjust-gran to respect signed integer type
- Remove dpll_link from Makefile (mistake in v2)
v4:
- Replace DPLL_PR_MULTI_ENUM_STR macro with dpll_pr_multi_enum_str() function
- Replace pr_out("\n") with print_nl() for one-line mode support
- Remove all is_json_context() code splitting, use PRINT_FP/PRINT_JSON/PRINT_ANY appropriately
- Add dpll_pr_freq_range() helper function to reduce code duplication
v5
- Fix checkpatch warnings
- Use structure initialization instead of memset
- Use sigemptyset() for proper signal mask initialization
- Remove redundant if (json) checks around JSON functions
- Use signalfd for signal handling in monitor
- Set netlink socket to non-blocking in monitor
Reviewed-by: Jiri Pirko <jiri@nvidia.com> Co-developed-by: Ivan Vecera <ivecera@redhat.com> Signed-off-by: Petr Oros <poros@redhat.com> Signed-off-by: Ivan Vecera <ivecera@redhat.com> Signed-off-by: David Ahern <dsahern@kernel.org>
Saeed Mahameed [Fri, 7 Nov 2025 00:14:35 +0000 (16:14 -0800)]
devlink: Support DEVLINK_ESWITCH_MODE_SWITCHDEV_INACTIVE
Add support for the new inactive switchdev mode [1].
A user can start the eswitch in switchdev or switchdev_inactive mode.
Active: Traffic is enabled on this eswitch FDB.
Inactive: Traffic is ignored/dropped on this eswitch FDB.
An example use case:
$ devlink dev eswitch set pci/0000:08:00.1 mode switchdev_inactive
Setup FDB pipeline and netdev representors
...
Once ready to start receiving traffic
$ devlink dev eswitch set pci/0000:08:00.1 mode switchdev
Ivan Vecera [Thu, 30 Oct 2025 19:42:00 +0000 (20:42 +0100)]
devlink: Add support for 64bit parameters
Kernel commit c0ef144695910 ("devlink: Add support for u64 parameters")
added support for 64bit devlink parameters, add the support for them
also into devlink utility userspace counterpart.
Tested on Microchip EDS2 development board...
Prior patch:
root@eds2:~# devlink dev param set i2c/1-0070 name clock_id value 1234 cmode driverinit
Value type not supported
root@eds2:~#
After patch:
root@eds2:~# devlink dev param set i2c/1-0070 name clock_id value 1234 cmode driverinit
root@eds2:~#
Cc: Jiri Pirko <jiri@resnulli.us> Signed-off-by: Ivan Vecera <ivecera@redhat.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: David Ahern <dsahern@kernel.org>
Sabrina Dubroca [Wed, 29 Oct 2025 11:06:16 +0000 (12:06 +0100)]
ip-xfrm: add pcpu-num support
The kernel supports passing the XFRMA_SA_PCPU attribute when creating
a state (via NEWSA or ALLOCSPI). Add a "pcpu-num" argument, and print
XFRMA_SA_PCPU when the kernel provides it.
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Signed-off-by: David Ahern <dsahern@kernel.org>
Andrea Claudi [Tue, 28 Oct 2025 22:17:56 +0000 (23:17 +0100)]
netshaper: fix build failure
netshaper fails to build from sources with this error:
$ make
netshaper
CC netshaper.o
LINK netshaper
/usr/bin/ld: ../lib/libutil.a(utils_math.o): in function `get_rate':
utils_math.c:(.text+0x97): undefined reference to `floor'
/usr/bin/ld: ../lib/libutil.a(utils_math.o): in function `get_size64':
utils_math.c:(.text+0x2a8): undefined reference to `floor'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:10: netshaper] Error 1
make: *** [Makefile:81: all] Error 2
Fix this simply linking against the math C library, similarly to what we
already did with commit 1a22ad2721fb ("build: Fix link errors on some
systems").
Fixes: 6f7779ad4ef6 ("netshaper: Add netshaper command") Signed-off-by: Andrea Claudi <aclaudi@redhat.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Ivan Vecera [Wed, 22 Oct 2025 12:23:02 +0000 (14:23 +0200)]
devlink: fix devlink flash error reporting
Currently, devlink silently exits when a non-existent device is specified
for flashing or when the user lacks sufficient permissions. This makes it
hard to diagnose the problem.
Print an appropriate error message in these cases to improve user feedback.
Prior:
$ devlink dev flash foo/bar file test
$ sudo devlink dev flash foo/bar file test
$
After patch:
$ devlink/devlink dev flash foo/bar file test
devlink answers: Operation not permitted
$ sudo devlink/devlink dev flash foo/bar file test
devlink answers: No such device
Fixes: 9b13cddfe268 ("devlink: implement flash status monitoring") Signed-off-by: Ivan Vecera <ivecera@redhat.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Andrea Claudi [Tue, 21 Oct 2025 19:26:56 +0000 (21:26 +0200)]
mptcp: add implicit flag to the 'ip mptcp' inline help
ip mptcp supports the implicit flag since commit 3a2535a41854 ("mptcp:
add support for implicit flag"), however this flag is not listed in the
command inline help.
Add the implicit flag to the inline help.
Signed-off-by: Andrea Claudi <aclaudi@redhat.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Yijing Zeng [Sat, 11 Oct 2025 22:25:24 +0000 (15:25 -0700)]
dcb: fix tc-maxrate unit conversions
The ieee_maxrate UAPI is defined as kbps, but dcb_maxrate uses Bps.
This fix patch converts Bps to kbps for parse by dividing 125,
and convert kbps to Bps for print_rate() by multiplying 125.
Fixes: 117939d9bd89 ("dcb: Add a subtool for the DCB maxrate object") Signed-off-by: Yijing Zeng <yijingzeng@meta.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Add support for the netshaper Generic Netlink family to
iproute2. Introduce a new command for configuring netshaper
parameters directly from userspace.
This interface allows users to set shaping attributes which
are passed to the kernel to perform the corresponding netshaper
operation.
Example usage:
$netshaper { set | show | delete } dev DEV \
handle scope SCOPE [id ID] \
[ bw-max BW_MAX ]
Internally, this triggers a kernel call to apply the shaping
configuration to the specified network device.
Currently, the tool supports the following functionalities:
- Setting bandwidth in Mbps, enabling bandwidth clamping for
a network device that support netshaper operations.
- Deleting the current configuration.
- Querying the existing configuration.
Additional netshaper operations will be integrated into the tool
as per requirement.
This change enables easy and scriptable configuration of bandwidth
shaping for devices that use the netshaper Netlink family.
Yureka [Sun, 12 Oct 2025 12:39:47 +0000 (14:39 +0200)]
lib: bridge: avoid redefinition of in6_addr
On musl libc, which does not use the kernel definitions of in6_addr, including
the libc headers after the kernel (UAPI) headers would cause a redefinition
error. The opposite order avoids the redefinition.
Fixes: 9e89d5b94d749f37525cd8778311e1c9f28f172a Signed-off-by: Yureka <yureka@cyberchaos.dev> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Shahar Shitrit [Wed, 8 Oct 2025 06:57:18 +0000 (09:57 +0300)]
devlink: Introduce burst period for health reporter
Add a new devlink health set option to configure the health
reporter’s burst period. The burst period defines a time window
during which recovery attempts for reported errors are allowed.
Once this period expires, the configured grace period begins.
This feature addresses cases where multiple errors occur
simultaneously due to a common root cause. Without a burst period,
the grace period starts immediately after the first error recovery
attempt finishes. This means that only the first error might be
recovered, while subsequent errors are blocked during the grace period.
With the burst period, the reporter initiates a recovery attempt for
every error reported within this time window before the grace period
starts.
Example:
$ devlink health set pci/0000:00:09.0 reporter tx burst_period 500
Signed-off-by: Shahar Shitrit <shshitrit@nvidia.com> Reviewed-by: Carolina Jubran <cjubran@nvidia.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Signed-off-by: David Ahern <dsahern@kernel.org>