netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Petr Machata <petrm@nvidia.com>
To: David Ahern <dsahern@kernel.org>
Cc: Daniel Machon <daniel.machon@microchip.com>,
	<netdev@vger.kernel.org>, <stephen@networkplumber.org>,
	<petrm@nvidia.com>, <maxime.chevallier@bootlin.com>,
	<vladimir.oltean@nxp.com>, <UNGLinuxDriver@microchip.com>
Subject: Re: [PATCH iproute2-next v2 1/2] dcb: add new pcp-prio parameter to dcb app
Date: Thu, 1 Dec 2022 11:57:13 +0100	[thread overview]
Message-ID: <87cz93fky0.fsf@nvidia.com> (raw)
In-Reply-To: <0642f8ab-63be-7db2-bd7c-16f19a3bdddc@kernel.org>


David Ahern <dsahern@kernel.org> writes:

> On 11/28/22 5:38 AM, Daniel Machon wrote:
>> @@ -344,6 +420,17 @@ static int dcb_app_print_key_dscp(__u16 protocol)
>>  	return print_uint(PRINT_ANY, NULL, "%d:", protocol);
>>  }
>>  
>> +static int dcb_app_print_key_pcp(__u16 protocol)
>> +{
>> +	/* Print in numerical form, if protocol value is out-of-range */
>> +	if (protocol > 15) {
>
> 15 is used in a number of places in this patch. What's the significance
> and can you give it a name that identifies the meaning? i.e., protocol
> is a u16 why the 15 limit? (and update all places accordingly)

In case of PCP, "protocol" is 0..7 for PCP values with DEI=0, and 8..15
for the same values respecively, but with DEI=1. That's fundamentally
where the 15 comes from.

Here in particular, it is ARRAY_LENGTH(pcp_names), and I agree, it would
be better to express it this way.

  reply	other threads:[~2022-12-01 11:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-28 12:38 [PATCH iproute2-next v2 0/2] Add pcp-prio and new apptrust subcommand Daniel Machon
2022-11-28 12:38 ` [PATCH iproute2-next v2 1/2] dcb: add new pcp-prio parameter to dcb app Daniel Machon
2022-11-29  9:35   ` Petr Machata
2022-12-01  6:43   ` David Ahern
2022-12-01 10:57     ` Petr Machata [this message]
2022-12-01 14:10       ` Petr Machata
2022-12-02  8:45     ` Daniel.Machon
2022-11-28 12:38 ` [PATCH iproute2-next v2 2/2] dcb: add new subcommand for apptrust Daniel Machon
2022-11-29  9:24   ` Petr Machata

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=87cz93fky0.fsf@nvidia.com \
    --to=petrm@nvidia.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=daniel.machon@microchip.com \
    --cc=dsahern@kernel.org \
    --cc=maxime.chevallier@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=vladimir.oltean@nxp.com \
    /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).