]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum: Add extack messages for enslave failures
authorDavid Ahern <dsahern@gmail.com>
Thu, 5 Oct 2017 00:48:51 +0000 (17:48 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 5 Oct 2017 04:39:34 +0000 (21:39 -0700)
commita43dbd2fe44a109ba53d243db33f66991c9c81b7
tree7336e8a94272855046ff07440fa0e23beba0f73d
parent1805667067800d3017f4f2392a0e3d16cfccbaf0
mlxsw: spectrum: Add extack messages for enslave failures

mlxsw fails device enslavement for a number of reasons. Use the extack
facility to return an error message to the user stating why the enslave
is failing.

Messages are prefixed with "spectrum" so users know it is a constraint
imposed by the hardware driver. For example:
    $ ip li add br0.11 link br0 type vlan id 11
    $ ip li set swp11 master br0
    Error: spectrum: Enslaving a port to a device that already has an upper device is not supported.

Signed-off-by: David Ahern <dsahern@gmail.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Tested-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c