public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: horatiu.vultur@microchip.com
Cc: nikolay@cumulusnetworks.com, UNGLinuxDriver@microchip.com,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [Resend PATCH net] bridge: uapi: mrp: Fix MRP_PORT_ROLE
Date: Mon, 22 Jun 2020 16:07:12 -0700 (PDT)	[thread overview]
Message-ID: <20200622.160712.2300967026610181117.davem@davemloft.net> (raw)
In-Reply-To: <20200620131403.2680293-1-horatiu.vultur@microchip.com>

From: Horatiu Vultur <horatiu.vultur@microchip.com>
Date: Sat, 20 Jun 2020 15:14:03 +0200

> Currently the MRP_PORT_ROLE_NONE has the value 0x2 but this is in conflict
> with the IEC 62439-2 standard. The standard defines the following port
> roles: primary (0x0), secondary(0x1), interconnect(0x2).
> Therefore remove the port role none.
> 
> Fixes: 4714d13791f831 ("bridge: uapi: mrp: Add mrp attributes.")
> Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>

The code accepts arbitrary 32-bit values for the role in a configuration
but only PRIMARY and SECONDARY seem to be valid.

There is no validation that the value used makes sense.

In the future if we handle type interconnect, and we add checks, it will
break any existing applications.  Because they can validly pass any
non-zero valid and the code treats that as SECONDARY currently.

So you really can't just remove NONE, you have to add validation code
too so we don't run into problem in the future.

Thanks.

  reply	other threads:[~2020-06-22 23:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-20 13:14 [Resend PATCH net] bridge: uapi: mrp: Fix MRP_PORT_ROLE Horatiu Vultur
2020-06-22 23:07 ` David Miller [this message]
2020-06-23  8:02   ` Horatiu Vultur

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=20200622.160712.2300967026610181117.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=horatiu.vultur@microchip.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@cumulusnetworks.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