netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Ido Schimmel <idosch@mellanox.com>
Cc: 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 05:55:58 +0200	[thread overview]
Message-ID: <20180528035558.GD18029@lunn.ch> (raw)
In-Reply-To: <20180527064841.32199-1-idosch@mellanox.com>

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

	Andrew

  parent reply	other threads:[~2018-05-28  3:56 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 [this message]
2018-05-28  6:33   ` Ido Schimmel
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=20180528035558.GD18029@lunn.ch \
    --to=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).