mlxsw: Refactor headroom management
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest15 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/15 | mlxsw: spectrum_buffers: Add struct mlxsw_sp_hdroomdrivers/ drivers/ drivers/ | +25 | 0 replies | |
| 2/15 | mlxsw: spectrum: Unify delay handling between PFC and pausedrivers/ drivers/ drivers/ +1 more | +67 | 0 replies | |
| 3/15 | mlxsw: spectrum: Track MTU in struct mlxsw_sp_hdroomdrivers/ drivers/ drivers/ +2 more | +26 | 0 replies | |
| 4/15 | mlxsw: spectrum: Track priorities in struct mlxsw_sp_hdroomdrivers/ drivers/ drivers/ +1 more | +35 | 0 replies | |
| 5/15 | mlxsw: spectrum: Track lossiness in struct mlxsw_sp_hdroomdrivers/ drivers/ drivers/ +2 more | +64 | 0 replies | |
| 6/15 | mlxsw: spectrum: Track buffer sizes in struct mlxsw_sp_hdroomdrivers/ drivers/ | +16 | 0 replies | |
| 7/15 | mlxsw: spectrum: Split headroom autoresize out of buffer configurationdrivers/ drivers/ drivers/ +1 more | +97 | 0 replies | |
| 8/15 | mlxsw: spectrum_dcb: Convert ETS handler fully to mlxsw_sp_hdroom_configure()drivers/ | +6 | 0 replies | |
| 9/15 | mlxsw: spectrum_dcb: Convert mlxsw_sp_port_pg_prio_map() to hdroom codedrivers/ | +19 | 0 replies | |
| 10/15 | mlxsw: spectrum: Move here the three-step headroom configuration from DCBdrivers/ drivers/ | +61 | 0 replies | |
| 11/15 | mlxsw: spectrum_buffers: Move here the new headroom codedrivers/ drivers/ | +199 | 0 replies | |
| 12/15 | mlxsw: spectrum_buffers: Inline mlxsw_sp_sb_max_headroom_cells()drivers/ drivers/ | +1 | 0 replies | |
| 13/15 | mlxsw: spectrum_buffers: Convert mlxsw_sp_port_headroom_init()drivers/ | +23 | 0 replies | |
| 14/15 | mlxsw: spectrum_buffers: Introduce shared buffer opsdrivers/ drivers/ drivers/ | +21 | 0 replies | |
| 15/15 | mlxsw: spectrum_buffers: Manage internal buffer in the hdroom codedrivers/ drivers/ drivers/ +1 more | +113 | 0 replies |
Reviews trailers per patch
All 15 patches have a Reviewed-by or Acked-by.
| Patch | Jiri Pirko |
|---|---|
| 1/15 | R-b |
| 2/15 | R-b |
| 3/15 | R-b |
| 4/15 | R-b |
| 5/15 | R-b |
| 6/15 | R-b |
| 7/15 | R-b |
| 8/15 | R-b |
| 9/15 | R-b |
| 10/15 | R-b |
| 11/15 | R-b |
| 12/15 | R-b |
| 13/15 | R-b |
| 14/15 | R-b |
| 15/15 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH net-next 00/15] mlxsw: Refactor headroom management
From: Ido Schimmel <[email protected]>
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 driver.
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 configuration.
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 configured.
Patch #12 is a small cleanup that the previous transformation made possible.
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 code.
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_sp_hdroom_configure()
mlxsw: spectrum_dcb: Convert mlxsw_sp_port_pg_prio_map() to hdroom
code
mlxsw: spectrum: Move here the three-step headroom configuration from
DCB
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(-)
Signature · 1 line
2.26.2