OSDN Git Service

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)
commite58376e1df2aaffbf12753959142a50f824c46ea
tree7336e8a94272855046ff07440fa0e23beba0f73d
parentca752be006013ac6f19721280f44c91ef07ad3d1
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