From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: [PATCH net] mlxsw: spectrum: Forbid creation of VLAN 1 over port/LAG Date: Mon, 28 May 2018 05:55:58 +0200 Message-ID: <20180528035558.GD18029@lunn.ch> References: <20180527064841.32199-1-idosch@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, davem@davemloft.net, jiri@mellanox.com, petrm@mellanox.com, mlxsw@mellanox.com To: Ido Schimmel Return-path: Received: from vps0.lunn.ch ([185.16.172.187]:46756 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751776AbeE1D4F (ORCPT ); Sun, 27 May 2018 23:56:05 -0400 Content-Disposition: inline In-Reply-To: <20180527064841.32199-1-idosch@mellanox.com> Sender: netdev-owner@vger.kernel.org List-ID: > 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