netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Machon <daniel.machon@microchip.com>
To: <netdev@vger.kernel.org>
Cc: <dsahern@kernel.org>, <stephen@networkplumber.org>,
	<petrm@nvidia.com>, <UNGLinuxDriver@microchip.com>,
	<daniel.machon@microchip.com>, Petr Machata <me@pmachata.org>
Subject: [PATCH iproute2-next v3 00/12] Introduce new dcb-rewr subcommand
Date: Tue, 6 Jun 2023 09:19:35 +0200	[thread overview]
Message-ID: <20230510-dcb-rewr-v3-0-60a766f72e61@microchip.com> (raw)

========================================================================               
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>


             reply	other threads:[~2023-06-06  7:20 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-06  7:19 Daniel Machon [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230510-dcb-rewr-v3-0-60a766f72e61@microchip.com \
    --to=daniel.machon@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=dsahern@kernel.org \
    --cc=me@pmachata.org \
    --cc=netdev@vger.kernel.org \
    --cc=petrm@nvidia.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).