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>
Subject: [PATCH iproute2-next v3 09/12] dcb: rewr: add symbol for max DSCP value
Date: Tue, 6 Jun 2023 09:19:44 +0200	[thread overview]
Message-ID: <20230510-dcb-rewr-v3-9-60a766f72e61@microchip.com> (raw)
In-Reply-To: <20230510-dcb-rewr-v3-0-60a766f72e61@microchip.com>

A symbol, DCB_APP_PCP_MAX, for maximum PCP value, already exists. Lets
add a symbol DCB_APP_DSCP_MAX and update accordingly.

Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
---
 dcb/dcb.h      | 1 +
 dcb/dcb_app.c  | 2 +-
 dcb/dcb_rewr.c | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/dcb/dcb.h b/dcb/dcb.h
index ff11a122ba37..b2e8e89f7701 100644
--- a/dcb/dcb.h
+++ b/dcb/dcb.h
@@ -73,6 +73,7 @@ struct dcb_app_parse_mapping {
 };
 
 #define DCB_APP_PCP_MAX 15
+#define DCB_APP_DSCP_MAX 63
 
 int dcb_cmd_app(struct dcb *dcb, int argc, char **argv);
 
diff --git a/dcb/dcb_app.c b/dcb/dcb_app.c
index 9c2727eff7d8..7040e62cbb47 100644
--- a/dcb/dcb_app.c
+++ b/dcb/dcb_app.c
@@ -306,7 +306,7 @@ static int dcb_app_parse_mapping_dscp_prio(__u32 key, char *value, void *data)
 	if (get_u8(&prio, value, 0))
 		return -EINVAL;
 
-	return dcb_parse_mapping("DSCP", key, 63,
+	return dcb_parse_mapping("DSCP", key, DCB_APP_DSCP_MAX,
 				 "PRIO", prio, IEEE_8021QAZ_MAX_TCS - 1,
 				 dcb_app_parse_mapping_cb, data);
 }
diff --git a/dcb/dcb_rewr.c b/dcb/dcb_rewr.c
index facbdbe664a4..5bb649adce24 100644
--- a/dcb/dcb_rewr.c
+++ b/dcb/dcb_rewr.c
@@ -76,7 +76,7 @@ static int dcb_rewr_parse_mapping_prio_dscp(__u32 key, char *value, void *data)
 		return -EINVAL;
 
 	return dcb_parse_mapping("PRIO", key, IEEE_8021QAZ_MAX_TCS - 1,
-				 "DSCP", dscp, 63,
+				 "DSCP", dscp, DCB_APP_DSCP_MAX,
 				 dcb_rewr_parse_mapping_cb, data);
 }
 

-- 
2.34.1


  parent 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 [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 ` Daniel Machon [this message]
2023-06-06 13:14   ` [PATCH iproute2-next v3 09/12] dcb: rewr: add symbol for max DSCP value 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-9-60a766f72e61@microchip.com \
    --to=daniel.machon@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=dsahern@kernel.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).