Go to file
Vincent Mailhol 8316df6e6d iplink_can: fix configuration ranges in print_usage() and add unit
The configuration ranges in print_usage() are taken from "Table 8 -
Time segments' minimum configuration ranges" in section 11.3.1.2
"Configuration of the bit time parameters" of ISO 11898-1.

The standard clearly specifies that "implementations may allow time
segments that exceed the minimum required configuration ranges
specified in Table 8".

Because no maximum ranges are given in the standard, all given ranges
{ a..b } are simply replaced with { NUMBER }.

The actual ranges are specific to each device and can be confirmed
doing:

$ ip --details link show can0
1: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN mode DEFAULT group default qlen 10
    link/can  promiscuity 0 minmtu 0 maxmtu 0
    can state STOPPED restart-ms 0
	  ES582.1/ES584.1: tseg1 2..256 tseg2 2..128 sjw 1..128 brp 1..512 brp-inc 1
	  ES582.1/ES584.1: dtseg1 2..32 dtseg2 1..16 dsjw 1..8 dbrp 1..32 dbrp-inc 1
	  clock 80000000 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535

Finally, the unit (bps, tq, ns or ms) are given. The rationale to add
the units is that the TDC parameters (that will be introduced in the
upcoming patches) are measured in a different unit than the other
bittiming parameters: clock period (a.k.a. minimum time quantum)
instead of time quantum. Adding the units disambiguates things.

For reference, before the change:
$ ip link set can0 type can help
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 ] ]

	[ 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 } ]

	[ restart-ms TIME-MS ]
	[ restart ]

	[ termination { 0..65535 } ]

	Where: BITRATE	:= { 1..1000000 }
		  SAMPLE-POINT	:= { 0.000..0.999 }
		  TQ		:= { NUMBER }
		  PROP-SEG	:= { 1..8 }
		  PHASE-SEG1	:= { 1..8 }
		  PHASE-SEG2	:= { 1..8 }
		  SJW		:= { 1..4 }
		  RESTART-MS	:= { 0 | NUMBER }

...and after it:
$ ip link set can0 type can help
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 ] ]

	[ 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 } ]

	[ 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 }
		  RESTART-MS	:= { 0 | NUMBER in ms }

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: David Ahern <dsahern@kernel.org>
2021-11-04 09:42:23 -06:00
bash-completion devlink: add support for port params get/set 2021-02-11 09:21:24 -07:00
bridge Merge branch 'main' into next 2021-10-09 17:47:47 -06:00
dcb dcb: fix memory leak 2021-05-06 14:48:02 +00:00
devlink devlink: print maximum number of snapshots if available 2021-10-05 08:31:30 -06:00
doc/actions doc: remove trailing whitespace 2018-12-19 12:02:38 -08:00
etc/iproute2 Add Open/R to rt_protos 2021-03-30 03:04:09 +00:00
examples/bpf examples/bpf: add bpf examples with BTF defined maps 2020-11-24 22:14:08 -07:00
genl genl: ctrl: print op -> policy idx mapping 2020-10-11 20:10:09 -06:00
include Import amt.h 2021-11-03 13:23:38 -06:00
ip iplink_can: fix configuration ranges in print_usage() and add unit 2021-11-04 09:42:23 -06:00
lib Merge branch 'main' into next 2021-10-09 17:47:47 -06:00
man ip: add AMT support 2021-11-03 13:24:13 -06:00
misc cmd: use spaces instead of tabs for usage indentation 2021-10-06 10:00:49 -07:00
netem doc: remove trailing whitespace 2018-12-19 12:02:38 -08:00
rdma rdma: Add optional-counters set/unset support 2021-10-15 17:52:57 -06:00
schema bridge: add json schema for bridge fdb show 2016-07-20 12:02:02 -07:00
tc tc/f_flower: fix port range parsing 2021-09-22 17:28:48 -07:00
testsuite testsuite: Add mpls packet matching tests for tc flower 2020-12-16 04:14:26 +00:00
tipc tipc: bail out if key is abnormally long 2021-05-09 22:08:47 +00:00
vdpa vdpa: add .gitignore 2021-02-23 23:12:14 -08:00
.clang-format clang-format: add configuration file 2019-01-17 13:38:23 -08:00
.gitignore Remove leftovers from removed Latex documentation 2018-02-13 16:43:19 -08:00
.mailmap mailmap: map David's mail address 2019-05-15 09:50:42 -07:00
COPYING Update address of FSF in license 2008-03-08 13:31:03 -08:00
Makefile configure: add the --libdir option 2021-10-15 17:57:20 -06:00
README README: remove doc instructions 2021-03-20 09:29:02 -07:00
README.devel README: update location of git repositories, remove broken info link 2018-02-13 16:42:51 -08:00
configure configure: add the --libdir option 2021-10-15 17:57:20 -06:00

README

This is a set of utilities for Linux networking.

Information:
    https://wiki.linuxfoundation.org/networking/iproute2

Download:
    http://www.kernel.org/pub/linux/utils/net/iproute2/

Stable version repository:
    git://git.kernel.org/pub/scm/network/iproute2/iproute2.git

Development repository:
    git://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git

How to compile this.
--------------------
1. libdbm

arpd needs to have the berkeleydb development libraries. For Debian
users this is the package with a name like libdbX.X-dev.
DBM_INCLUDE points to the directory with db_185.h which
is the include file used by arpd to get to the old format Berkeley
database routines.  Often this is in the db-devel package.

2. make

The makefile will automatically build a config.mk file which
contains definitions of libraries that may or may not be available
on the system such as: ATM, ELF, MNL, and SELINUX.

3. include/uapi

This package includes matching sanitized kernel headers because
the build environment may not have up to date versions. See Makefile
if you have special requirements and need to point at different
kernel include files.

Stephen Hemminger
stephen@networkplumber.org

Alexey Kuznetsov
kuznet@ms2.inr.ac.ru