netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/8] mlxsw: Support DSCP prioritization and rewrite
@ 2018-07-27 12:26 Ido Schimmel
  2018-07-27 12:26 ` [PATCH net-next 1/8] net: dcb: For wild-card lookups, use priority -1, not 0 Ido Schimmel
                   ` (9 more replies)
  0 siblings, 10 replies; 13+ messages in thread
From: Ido Schimmel @ 2018-07-27 12:26 UTC (permalink / raw)
  To: netdev; +Cc: davem, jiri, petrm, mlxsw, john.fastabend, Ido Schimmel

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-07-29 21:25 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-27 12:26 [PATCH net-next 0/8] mlxsw: Support DSCP prioritization and rewrite Ido Schimmel
2018-07-27 12:26 ` [PATCH net-next 1/8] net: dcb: For wild-card lookups, use priority -1, not 0 Ido Schimmel
2018-07-27 12:26 ` [PATCH net-next 2/8] net: dcb: Add priority-to-DSCP map getters Ido Schimmel
2018-07-27 12:26 ` [PATCH net-next 3/8] mlxsw: reg: Add QoS Port DSCP to Priority Mapping Register Ido Schimmel
2018-07-27 12:26 ` [PATCH net-next 4/8] mlxsw: reg: Add QoS Priority Trust State Register Ido Schimmel
2018-07-27 12:26 ` [PATCH net-next 5/8] mlxsw: reg: Add QoS ReWrite Enable Register Ido Schimmel
2018-07-27 12:27 ` [PATCH net-next 6/8] mlxsw: reg: Add QoS Priority to DSCP Mapping Register Ido Schimmel
2018-07-27 12:27 ` [PATCH net-next 7/8] mlxsw: spectrum: Support ieee_setapp, ieee_delapp Ido Schimmel
2018-07-27 12:27 ` [PATCH net-next 8/8] selftests: mlxsw: Add test for trust-DSCP Ido Schimmel
2018-07-27 20:11 ` [PATCH net-next] net: dcb: add DSCP to comment about priority selector types Jakub Kicinski
2018-07-27 21:14   ` Petr Machata
2018-07-29 19:54   ` David Miller
2018-07-27 20:18 ` [PATCH net-next 0/8] mlxsw: Support DSCP prioritization and rewrite David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).