linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/6] Introduce new DCB rewrite table
@ 2023-01-16 14:48 Daniel Machon
  2023-01-16 14:48 ` [PATCH net-next v2 1/6] net: dcb: modify dcb_app_add to take list_head ptr as parameter Daniel Machon
                   ` (6 more replies)
  0 siblings, 7 replies; 20+ messages in thread
From: Daniel Machon @ 2023-01-16 14:48 UTC (permalink / raw)
  To: netdev
  Cc: davem, edumazet, kuba, pabeni, lars.povlsen, Steen.Hegelund,
	daniel.machon, UNGLinuxDriver, joe, error27, horatiu.vultur,
	Julia.Lawall, petrm, vladimir.oltean, maxime.chevallier,
	linux-arm-kernel, linux-kernel

There is currently no support for per-port egress mapping of priority to PCP and
priority to DSCP. Some support for expressing egress mapping of PCP is supported
through ip link, with the 'egress-qos-map', however this command only maps
priority to PCP, and for vlan interfaces only. DCB APP already has support for
per-port ingress mapping of PCP/DEI, DSCP and a bunch of other stuff. So why not
take advantage of this fact, and add a new table that does the reverse.

This patch series introduces the new DCB rewrite table. Whereas the DCB
APP table deals with ingress mapping of PID (protocol identifier) to priority,
the rewrite table deals with egress mapping of priority to PID.

It is indeed possible to integrate rewrite in the existing APP table, by
introducing new dedicated rewrite selectors, and altering existing functions
to treat rewrite entries specially. However, I feel like this is not a good
solution, and will pollute the APP namespace. APP is well-defined in IEEE, and
some userspace relies of advertised entries - for this fact, separating APP and
rewrite into to completely separate objects, seems to me the best solution.

The new table shares much functionality with the APP table, and as such, much
existing code is reused, or slightly modified, to work for both.

================================================================================
DCB rewrite table in a nutshell
================================================================================
The table is implemented as a simple linked list, and uses the same lock as the
APP table. New functions for getting, setting and deleting entries have been
added, and these are exported, so they can be used by the stack or drivers.
Additionnaly, new dcbnl_setrewr and dcnl_delrewr hooks has been added, to
support hardware offload of the entries.

================================================================================
Sparx5 per-port PCP rewrite support
================================================================================
Sparx5 supports PCP egress mapping through two eight-entry switch tables.
One table maps QoS class 0-7 to PCP for DE0 (DP levels mapped to
drop-eligibility 0) and the other for DE1. DCB does currently not have support
for expressing DP/color, so instead, the tagged DEI bit will reflect the DP
levels, for any rewrite entries> 7 ('de').

The driver will take apptrust (contributed earlier) into consideration, so
that the mapping tables only be used, if PCP is trusted *and* the rewrite table
has active mappings, otherwise classified PCP (same as frame PCP) will be used
instead.

================================================================================
Sparx5 per-port DSCP rewrite support
================================================================================
Sparx5 support DSCP egress mapping through a single 32-entry table. This table
maps classified QoS class and DP level to classified DSCP, and is consulted by
the switch Analyzer Classifier at ingress. At egress, the frame DSCP can either
be rewritten to classified DSCP to frame DSCP.

The driver will take apptrust into consideration, so that the mapping tables
only be used, if DSCP is trusted *and* the rewrite table has active mappings,
otherwise frame DSCP will be used instead.

================================================================================
Patches
================================================================================
Patch #1 modifies dcb_app_add to work for both APP and rewrite

Patch #2 adds dcbnl_app_table_setdel() for setting and deleting both APP and
         rewrite entries.

Patch #3 adds the rewrite table and all required functions, offload hooks and
         bookkeeping for maintaining it.

Patch #4 adds two new helper functions for getting a priority to PCP bitmask
         map, and a priority to DSCP bitmask map.

Patch #5 adds support for PCP rewrite in the Sparx5 driver.
Patch #6 adds support for DSCP rewrite in the Sparx5 driver.

================================================================================
v1 -> v2:
  In dcb_setrewr() change proto to u16 as it ought to be, and remove zero
  initialization of err. (Dan Carpenter).
  Change name of dcbnl_apprewr_setdel -> dcbnl_app_table_setdel and change the
  function signature to take a single function pointer. Update uses accordingly
  (Petr Machata).

Daniel Machon (6):
  net: dcb: modify dcb_app_add to take list_head ptr as parameter
  net: dcb: add new common function for set/del of app/rewr entries
  net: dcb: add new rewrite table
  net: dcb: add helper functions to retrieve PCP and DSCP rewrite maps
  net: microchip: sparx5: add support for PCP rewrite
  net: microchip: sparx5: add support for DSCP rewrite

 .../ethernet/microchip/sparx5/sparx5_dcb.c    | 121 +++++++-
 .../microchip/sparx5/sparx5_main_regs.h       |  70 ++++-
 .../ethernet/microchip/sparx5/sparx5_port.c   |  97 +++++++
 .../ethernet/microchip/sparx5/sparx5_port.h   |  41 +++
 include/net/dcbnl.h                           |  18 ++
 include/uapi/linux/dcbnl.h                    |   2 +
 net/dcb/dcbnl.c                               | 271 ++++++++++++++----
 7 files changed, 547 insertions(+), 73 deletions(-)

--
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2023-01-19  9:58 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-16 14:48 [PATCH net-next v2 0/6] Introduce new DCB rewrite table Daniel Machon
2023-01-16 14:48 ` [PATCH net-next v2 1/6] net: dcb: modify dcb_app_add to take list_head ptr as parameter Daniel Machon
2023-01-18 11:02   ` Petr Machata
2023-01-16 14:48 ` [PATCH net-next v2 2/6] net: dcb: add new common function for set/del of app/rewr entries Daniel Machon
2023-01-18 10:26   ` Petr Machata
2023-01-18 11:03     ` Petr Machata
2023-01-18 13:56       ` Daniel.Machon
2023-01-18 15:42         ` Petr Machata
2023-01-16 14:48 ` [PATCH net-next v2 3/6] net: dcb: add new rewrite table Daniel Machon
2023-01-18 10:54   ` Petr Machata
2023-01-18 13:47     ` Daniel.Machon
2023-01-18 15:20       ` Petr Machata
2023-01-18 15:07     ` Dan Carpenter
2023-01-18 15:11       ` Dan Carpenter
2023-01-19  9:38       ` Petr Machata
2023-01-16 14:48 ` [PATCH net-next v2 4/6] net: dcb: add helper functions to retrieve PCP and DSCP rewrite maps Daniel Machon
2023-01-18 11:01   ` Petr Machata
2023-01-16 14:48 ` [PATCH net-next v2 5/6] net: microchip: sparx5: add support for PCP rewrite Daniel Machon
2023-01-16 14:48 ` [PATCH net-next v2 6/6] net: microchip: sparx5: add support for DSCP rewrite Daniel Machon
2023-01-18 11:00 ` [PATCH net-next v2 0/6] Introduce new DCB rewrite table Simon Horman

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).