[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180727122702.17995-1-idosch@mellanox.com>
Date: Fri, 27 Jul 2018 15:26:54 +0300
From: Ido Schimmel <idosch@...lanox.com>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net, jiri@...lanox.com, petrm@...lanox.com,
mlxsw@...lanox.com, john.fastabend@...il.com,
Ido Schimmel <idosch@...lanox.com>
Subject: [PATCH net-next 0/8] mlxsw: Support DSCP prioritization and rewrite
Petr says:
On ingress, a network device such as a switch assigns to packets
priority based on various criteria. Common options include interpreting
PCP and DSCP fields according to user configuration. When a packet
egresses the switch, a reverse process may rewrite PCP and/or DSCP
headers according to packet priority.
So far, mlxsw has supported prioritization based on PCP (802.1p priority
tag). This patch set introduces support for prioritization based on
DSCP, and DSCP rewrite.
To configure the DSCP-to-priority maps, the user is expected to invoke
ieee_setapp and ieee_delapp DCBNL ops, e.g. by using lldptool:
# lldptool -T -i sw1p6 -V APP app=3,5,24 # (priority 3, DSCP, 24)
To decide whether or not to pay attention to DSCP values, the Spectrum
switch recognize a per-port configuration of trust level. Until the
first APP rule is added for a given port, this port's trust level stays
at PCP, meaning that PCP is used for packet prioritization. With the
first DSCP APP rule, the port is configured to trust DSCP instead, and
it stays there until all DSCP APP rules are removed again.
Besides the DSCP (value 5) selector, another selector that plays into
packet prioritization is Ethernet type (value 1) with PID of 0. Such APP
entries denote default priority[1]:
# lldptool -T -i sw1p6 -V APP app=3,1,0 # (default priority 3)
With this patch set, mlxsw uses these values to configure priority for
DSCP values not explicitly specified in DSCP APP map. In the future we
expect to also use this to configure default port priority for untagged
packets.
Access to DSCP-to-priority map, priority-to-DSCP map, and default
priority for a port is exposed through three new DCB helpers. Like the
already-existing dcb_ieee_getapp_mask() helper, these helpers operate in
terms of bitmaps, to support the arbitrary M:N mapping that the APP
rules allow. Such interface presents all the relevant information from
the APP database without necessitating exposition of iterators, locking
or other complex primitives. It is up to the driver to then digest the
mapping in a way that the device supports. In this patch set, mlxsw
resolves conflicts by favoring higher-numbered DSCP values and
priorities.
In this patchset:
- Patch #1 fixes a bug in DCB APP database management.
- Patch #2 adds the getters described above.
- Patches #3-#6 add Spectrum configuration registers.
- Patch #7 adds the mlxsw logic that configures the device according to
APP rules.
- Patch #8 adds a self-test. The test is added to the subdirectory
drivers/net/mlxsw. Even though it's not particularly specific to
mlxsw, it's not suitable for running on soft devices (which don't
support the ieee_getapp et.al.), and thus isn't a good fit for the
general net/forwarding directory.
[1] 802.1Q-2014, Table D-9
Petr Machata (8):
net: dcb: For wild-card lookups, use priority -1, not 0
net: dcb: Add priority-to-DSCP map getters
mlxsw: reg: Add QoS Port DSCP to Priority Mapping Register
mlxsw: reg: Add QoS Priority Trust State Register
mlxsw: reg: Add QoS ReWrite Enable Register
mlxsw: reg: Add QoS Priority to DSCP Mapping Register
mlxsw: spectrum: Support ieee_setapp, ieee_delapp
selftests: mlxsw: Add test for trust-DSCP
drivers/net/ethernet/mellanox/mlxsw/reg.h | 219 ++++++++++++++
.../net/ethernet/mellanox/mlxsw/spectrum.h | 4 +-
.../ethernet/mellanox/mlxsw/spectrum_dcb.c | 269 +++++++++++++++++-
include/net/dcbnl.h | 13 +
net/dcb/dcbnl.c | 97 ++++++-
.../drivers/net/mlxsw/qos_dscp_bridge.sh | 248 ++++++++++++++++
6 files changed, 844 insertions(+), 6 deletions(-)
create mode 100755 tools/testing/selftests/drivers/net/mlxsw/qos_dscp_bridge.sh
--
2.17.1
Powered by blists - more mailing lists