netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Ido Schimmel <idosch@mellanox.com>,
	netdev@vger.kernel.org, davem@davemloft.net, jiri@mellanox.com,
	petrm@mellanox.com, mlxsw@mellanox.com
Subject: Re: [PATCH net] mlxsw: spectrum: Forbid creation of VLAN 1 over port/LAG
Date: Mon, 28 May 2018 09:33:03 +0300	[thread overview]
Message-ID: <20180528063303.GA15094@splinter.mtl.com> (raw)
In-Reply-To: <20180528035558.GD18029@lunn.ch>

On Mon, May 28, 2018 at 05:55:58AM +0200, Andrew Lunn wrote:
> > diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
> > index ca38a30fbe91..adc6ab2cf429 100644
> > --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
> > +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
> > @@ -4433,6 +4433,11 @@ static int mlxsw_sp_netdevice_port_upper_event(struct net_device *lower_dev,
> >  			NL_SET_ERR_MSG_MOD(extack, "Can not put a VLAN on an OVS port");
> >  			return -EINVAL;
> >  		}
> > +		if (is_vlan_dev(upper_dev) &&
> > +		    vlan_dev_vlan_id(upper_dev) == 1) {
> > +			NL_SET_ERR_MSG_MOD(extack, "Creating a VLAN device with VID 1 is unsupported: VLAN 1 carries untagged traffic");
> > +			return -EINVAL;
> > +		}
> 
> Hi Ido
> 
> Would ENOTSUPP be a better return code. VLAN 1 is valid, you just
> don't support it.

OK, makes sense. We currently use EINVAL for such errors, but we can
convert to EOPNOTSUPP in net-next.

Thanks

  reply	other threads:[~2018-05-28  6:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-27  6:48 [PATCH net] mlxsw: spectrum: Forbid creation of VLAN 1 over port/LAG Ido Schimmel
2018-05-27 12:26 ` Jiri Pirko
2018-05-28  3:55 ` Andrew Lunn
2018-05-28  6:33   ` Ido Schimmel [this message]
2018-05-28  8:31     ` Petr Machata
2018-05-29 14:08 ` David Miller

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=20180528063303.GA15094@splinter.mtl.com \
    --to=idosch@idosch.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=idosch@mellanox.com \
    --cc=jiri@mellanox.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=petrm@mellanox.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).