netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2-next v3 00/12] Introduce new dcb-rewr subcommand
@ 2023-06-06  7:19 Daniel Machon
  2023-06-06  7:19 ` [PATCH iproute2-next v3 01/12] dcb: app: add new dcbnl attribute field Daniel Machon
                   ` (12 more replies)
  0 siblings, 13 replies; 23+ messages in thread
From: Daniel Machon @ 2023-06-06  7:19 UTC (permalink / raw)
  To: netdev; +Cc: dsahern, stephen, petrm, UNGLinuxDriver, daniel.machon,
	Petr Machata

========================================================================               
Introduction:
========================================================================

This series introduces a new DCB subcommand: rewr, which is used to
configure the in-kernel DCB rewrite table [1].

Rewrite support is added as a separate DCB subcommand, rather than an
APP opt-in flag or similar. This goes in line with what we did to dcbnl,
where rewrite is a separate object.  Obviously this requires a bit more
code to implement the new command, but much of the existing dcb-app code
(especially the bookkeeping code) can be reused. In some cases a little
adaptation is needed.

========================================================================
dcb-rewr parameters:
========================================================================

Initially, I have only made support for the prio-pcp and prio-dscp
parameters, as DSCP and PCP  are the only selectors that currently have
a user [2] and to be honest, I am not even sure it makes sense to add
dgram, stream, ethtype rewrite support - At least the rewriter of Sparx5
does not support this. Any input here is much appreciated!

Examples:

Rewrite DSCP to 63 for packets with priority 1
$ dcb rewr add dev eth0 prio-dscp 1:63

Rewrite PCP 7 and DEI to 1 for packets with priority 1
$ dcb rewr add dev eth0 prio-pcp 1:7de

A new manpage has been added, to cover the new dcb-rewr subcommand, and
its parameters. Also I took the liberty to clean up a few things in the
dcb-app manpage.

========================================================================               
Patch overview:
========================================================================

Patch  #1 Adds a new field 'attr' to the dcb_app_table struct, which is
          used to distinguish app and rewrite tables.

Patch  #2 Replaces uses of %d with %u for unsigned int.

Patch  #3 Moves colon out of callback functions.

Patch  #4 Renames protocl print functions from _key to _pid

Patch  #5 Modifies the _print_filtered() function for dcb-rewr reuse, by
          introducing new callbacks.

Patch  #6 Modifies existing dcb-app function dcb_app_table_remove_replaced 
          for reuse by dcb-rewr

Patch  #7 Expose dcb-app functions required by dcb-rewr.

Patch  #8 Adds the new dcb-rewr subcommand with initial support for
          prio-pcp and prio-dscp rewrite.

Patch  #9 Introduces symbol for max DSCP value and updates accordingly.

Patch #10 Adds the dcb-rewr.8 manpage
Patch #11 Adds references to dcb-apptrust and dcb-rewr in the dcb.8
          manpage.

Patch #12 Cleans up the dcb-app.8 manpage.

[1] https://elixir.bootlin.com/linux/v6.4-rc1/source/net/dcb/dcbnl.c#L181
[2] https://elixir.bootlin.com/linux/v6.4-rc1/source/drivers/net/ethernet/microchip/sparx5/sparx5_dcb.c#L380

Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
---
Changes in v3:
- Split #2 into four patches (%d->%u, :, renaming, prototype change).
- Moved publication of functions in #3 to patches where they are used.
- Added new patch #7 that exposes dcb-app functions required by dcb-rewr.
- Got rid of #4 and copied over dcb_app_parse_mapping_cb to dcb-rewr instead.
- Added new patch #9 for DCB_APP_MAX_DSCP
- Link to v2: https://lore.kernel.org/r/20230510-dcb-rewr-v2-0-9f38e688117e@microchip.com

Changes in v2:
- Got rid of patch #1 that introduced dcb_app.h - expose in individual patches. 
- Changed to callbacks for printing APP and rewrite entries. Also fixed %d to be %u.
- Changed to callbacks for removing replaced table entries for APP and rewrite.
- Changed to callbacks for pushing APP and rewrite entries to the table.
- Got rid of extra spaces in dcb-rewr helps, and reordered some parameters for dcb_parse_mapping.
- Rephrased 'that that' sentence in dcb-app.8 and dcb-rewr.8
- Link to v1: https://lore.kernel.org/r/20230510-dcb-rewr-v1-0-83adc1f93356@microchip.com

---
Daniel Machon (12):
      dcb: app: add new dcbnl attribute field
      dcb: app: replace occurrences of %d with %u for printing unsigned int
      dcb: app: move colon printing out of callbacks
      dcb: app: rename dcb_app_print_key_*() functions
      dcb: app: modify dcb_app_print_filtered() for dcb-rewr reuse
      dcb: app: modify dcb_app_table_remove_replaced() for dcb-rewr reuse
      dcb: app: expose functions required by dcb-rewr
      dcb: rewr: add new dcb-rewr subcommand
      dcb: rewr: add symbol for max DSCP value
      man: dcb-rewr: add new manpage for dcb-rewr
      man: dcb: add additional references under 'SEE ALSO'
      man: dcb-app: clean up a few mistakes

 dcb/Makefile        |   3 +-
 dcb/dcb.c           |   4 +-
 dcb/dcb.h           |  54 ++++++++
 dcb/dcb_app.c       | 154 +++++++++++-----------
 dcb/dcb_rewr.c      | 363 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 man/man8/dcb-app.8  |  10 +-
 man/man8/dcb-rewr.8 | 206 +++++++++++++++++++++++++++++
 man/man8/dcb.8      |   4 +-
 8 files changed, 718 insertions(+), 80 deletions(-)
---
base-commit: e0c7a04f1dfd7ca05e0725663489c6406d169b9c
change-id: 20230510-dcb-rewr-534b7ab637eb

Best regards,
-- 
Daniel Machon <daniel.machon@microchip.com>


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

end of thread, other threads:[~2023-06-09 21:50 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-06  7:19 [PATCH iproute2-next v3 00/12] Introduce new dcb-rewr subcommand Daniel Machon
2023-06-06  7:19 ` [PATCH iproute2-next v3 01/12] dcb: app: add new dcbnl attribute field Daniel Machon
2023-06-06 15:00   ` Petr Machata
2023-06-06  7:19 ` [PATCH iproute2-next v3 02/12] dcb: app: replace occurrences of %d with %u for printing unsigned int Daniel Machon
2023-06-06  9:29   ` Petr Machata
2023-06-06  7:19 ` [PATCH iproute2-next v3 03/12] dcb: app: move colon printing out of callbacks Daniel Machon
2023-06-06  9:32   ` Petr Machata
2023-06-06  7:19 ` [PATCH iproute2-next v3 04/12] dcb: app: rename dcb_app_print_key_*() functions Daniel Machon
2023-06-06  9:34   ` Petr Machata
2023-06-06  7:19 ` [PATCH iproute2-next v3 05/12] dcb: app: modify dcb_app_print_filtered() for dcb-rewr reuse Daniel Machon
2023-06-06 14:08   ` Petr Machata
2023-06-06  7:19 ` [PATCH iproute2-next v3 06/12] dcb: app: modify dcb_app_table_remove_replaced() " Daniel Machon
2023-06-06 13:10   ` Petr Machata
2023-06-06  7:19 ` [PATCH iproute2-next v3 07/12] dcb: app: expose functions required by dcb-rewr Daniel Machon
2023-06-06 13:11   ` Petr Machata
2023-06-06  7:19 ` [PATCH iproute2-next v3 08/12] dcb: rewr: add new dcb-rewr subcommand Daniel Machon
2023-06-06 13:17   ` Petr Machata
2023-06-06  7:19 ` [PATCH iproute2-next v3 09/12] dcb: rewr: add symbol for max DSCP value Daniel Machon
2023-06-06 13:14   ` Petr Machata
2023-06-06  7:19 ` [PATCH iproute2-next v3 10/12] man: dcb-rewr: add new manpage for dcb-rewr Daniel Machon
2023-06-06  7:19 ` [PATCH iproute2-next v3 11/12] man: dcb: add additional references under 'SEE ALSO' Daniel Machon
2023-06-06  7:19 ` [PATCH iproute2-next v3 12/12] man: dcb-app: clean up a few mistakes Daniel Machon
2023-06-09 21:50 ` [PATCH iproute2-next v3 00/12] Introduce new dcb-rewr subcommand patchwork-bot+netdevbpf

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