]> git.ipfire.org Git - thirdparty/iproute2.git/commit
dcb: add new pcp-prio parameter to dcb app
authorDaniel Machon <daniel.machon@microchip.com>
Mon, 5 Dec 2022 22:21:44 +0000 (23:21 +0100)
committerDavid Ahern <dsahern@kernel.org>
Thu, 8 Dec 2022 16:22:26 +0000 (09:22 -0700)
commit3e2a96c9f417bd2c46e1f20561e69fbd7aa4e5a7
treeee1ee19c6930c4d487caa20a935018733df30141
parenta74e7181c60b8ffc75503ff7eea7d4a719d636fd
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>
dcb/dcb.h
dcb/dcb_app.c
man/man8/dcb-app.8