lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 16 Sep 2020 09:35:13 +0300
From:   Ido Schimmel <>
        Ido Schimmel <>
Subject: [PATCH net-next 00/15] mlxsw: Refactor headroom management

From: Ido Schimmel <>

Petr says:

On Spectrum, port buffers, also called port headroom, is where packets are
stored while they are parsed and the forwarding decision is being made. For
lossless traffic flows, in case shared buffer admission is not allowed,
headroom is also where to put the extra traffic received before the sent
PAUSE takes effect. Another aspect of the port headroom is the so called
internal buffer, which is used for egress mirroring.

Linux supports two DCB interfaces related to the headroom: dcbnl_setbuffer
for configuration, and dcbnl_getbuffer for inspection. In order to make it
possible to implement these interfaces, it is first necessary to clean up
headroom handling, which is currently strewn in several places in the

The end goal is an architecture whereby it is possible to take a copy of
the current configuration, adjust parameters, and then hand the proposed
configuration over to the system to implement it. When everything works,
the proposed configuration is accepted and saved. First, this centralizes
the reconfiguration handling to one function, which takes care of
coordinating buffer size changes and priority map changes to avoid
introducing drops. Second, the fact that the configuration is all in one
place makes it easy to keep a backup and handle error path rollbacks, which
were previously hard to understand.

Patch #1 introduces struct mlxsw_sp_hdroom, which will keep port headroom

Patch #2 unifies handling of delay provision between PFC and PAUSE. From
now on, delay is to be measured in bytes of extra space, and will not
include MTU. PFC handler sets the delay directly from the parameter it gets
through the DCB interface. For PAUSE, MLXSW_SP_PAUSE_DELAY is converted to
have the same meaning.

In patches #3-#5, MTU, lossiness and priorities are gradually moved over to
struct mlxsw_sp_hdroom.

In patches #6-#11, handling of buffer resizing and priority maps is moved
from spectrum.c and spectrum_dcb.c to spectrum_buffers.c. The API is
gradually adapted so that struct mlxsw_sp_hdroom becomes the main interface
through which the various clients express how the headroom should be

Patch #12 is a small cleanup that the previous transformation made

In patch #13, the port init code becomes a boring client of the headroom
code, instead of rolling its own thing.

Patches #14 and #15 move handling of internal mirroring buffer to the new
headroom code as well. Previously, this code was in the SPAN module. This
patchset converts the SPAN module to another boring client of the headroom

Petr Machata (15):
  mlxsw: spectrum_buffers: Add struct mlxsw_sp_hdroom
  mlxsw: spectrum: Unify delay handling between PFC and pause
  mlxsw: spectrum: Track MTU in struct mlxsw_sp_hdroom
  mlxsw: spectrum: Track priorities in struct mlxsw_sp_hdroom
  mlxsw: spectrum: Track lossiness in struct mlxsw_sp_hdroom
  mlxsw: spectrum: Track buffer sizes in struct mlxsw_sp_hdroom
  mlxsw: spectrum: Split headroom autoresize out of buffer configuration
  mlxsw: spectrum_dcb: Convert ETS handler fully to
  mlxsw: spectrum_dcb: Convert mlxsw_sp_port_pg_prio_map() to hdroom
  mlxsw: spectrum: Move here the three-step headroom configuration from
  mlxsw: spectrum_buffers: Move here the new headroom code
  mlxsw: spectrum_buffers: Inline mlxsw_sp_sb_max_headroom_cells()
  mlxsw: spectrum_buffers: Convert mlxsw_sp_port_headroom_init()
  mlxsw: spectrum_buffers: Introduce shared buffer ops
  mlxsw: spectrum_buffers: Manage internal buffer in the hdroom code

 .../net/ethernet/mellanox/mlxsw/spectrum.c    | 136 +------
 .../net/ethernet/mellanox/mlxsw/spectrum.h    |  71 +++-
 .../mellanox/mlxsw/spectrum_buffers.c         | 361 ++++++++++++++++--
 .../ethernet/mellanox/mlxsw/spectrum_dcb.c    | 104 ++---
 .../mellanox/mlxsw/spectrum_ethtool.c         |  27 +-
 .../ethernet/mellanox/mlxsw/spectrum_span.c   |  65 +---
 .../ethernet/mellanox/mlxsw/spectrum_span.h   |   1 -
 7 files changed, 470 insertions(+), 295 deletions(-)


Powered by blists - more mailing lists