• Petr Machata's avatar
    mlxsw: spectrum_switchdev: Pass extack to mlxsw_sp_br_ban_rif_pvid_change() · 352be882
    Petr Machata authored
    Currently the reason for rejection of PVID manipulation is dumped to
    syslog, and a generic -EBUSY is returned to the userspace. But
    switchdev_handle_port_obj_add(), through which we get to
    mlxsw_sp_port_vlans_add(), handles extack just fine, and we can pass the
    message this way.
    
    This improves visibility into reasons why the request to change PVID
    was rejected. Before the change:
    
     # bridge vlan add dev br vid 2 self pvid untagged
     RTNETLINK answers: Device or resource busy
     (plus a syslog line)
    
    After the change:
    
     # bridge vlan add dev br vid 2 self pvid untagged
     Error: mlxsw_spectrum: Can't change PVID, it's used by router interface.
    
    Note that this particular error message is going away in the following
    patches. However the ability to pass error messages through extack will be
    useful more broadly for communicating in particular reasons why a RIF
    failed to be created.
    Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
    Reviewed-by: default avatarDanielle Ratson <danieller@nvidia.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    352be882
spectrum_switchdev.c 110 KB