Commit a40313d9 authored by Petr Machata's avatar Petr Machata Committed by David S. Miller

mlxsw: spectrum: Add extack messages to VXLAN FDB rejection

Annotate the rejections in mlxsw_sp_switchdev_vxlan_work_prepare() with
textual reasons.

Because this code ends up being invoked for FDB replay as well, drop the
default message from there, so that the more accurate error message is
not overwritten.
Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6685987c
......@@ -842,10 +842,8 @@ int mlxsw_sp_nve_fid_enable(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_fid *fid,
nve->config = config;
err = ops->fdb_replay(params->dev, params->vni, extack);
if (err) {
NL_SET_ERR_MSG_MOD(extack, "Failed to offload the FDB");
if (err)
goto err_fdb_replay;
}
return 0;
......
......@@ -3099,23 +3099,34 @@ mlxsw_sp_switchdev_vxlan_work_prepare(struct mlxsw_sp_switchdev_event_work *
struct vxlan_dev *vxlan = netdev_priv(switchdev_work->dev);
struct switchdev_notifier_vxlan_fdb_info *vxlan_fdb_info;
struct vxlan_config *cfg = &vxlan->cfg;
struct netlink_ext_ack *extack;
extack = switchdev_notifier_info_to_extack(info);
vxlan_fdb_info = container_of(info,
struct switchdev_notifier_vxlan_fdb_info,
info);
if (vxlan_fdb_info->remote_port != cfg->dst_port)
return -EOPNOTSUPP;
if (vxlan_fdb_info->remote_vni != cfg->vni)
if (vxlan_fdb_info->remote_port != cfg->dst_port) {
NL_SET_ERR_MSG_MOD(extack, "VxLAN: FDB: Non-default remote port is not supported");
return -EOPNOTSUPP;
if (vxlan_fdb_info->vni != cfg->vni)
}
if (vxlan_fdb_info->remote_vni != cfg->vni ||
vxlan_fdb_info->vni != cfg->vni) {
NL_SET_ERR_MSG_MOD(extack, "VxLAN: FDB: Non-default VNI is not supported");
return -EOPNOTSUPP;
if (vxlan_fdb_info->remote_ifindex)
}
if (vxlan_fdb_info->remote_ifindex) {
NL_SET_ERR_MSG_MOD(extack, "VxLAN: FDB: Local interface is not supported");
return -EOPNOTSUPP;
if (is_multicast_ether_addr(vxlan_fdb_info->eth_addr))
}
if (is_multicast_ether_addr(vxlan_fdb_info->eth_addr)) {
NL_SET_ERR_MSG_MOD(extack, "VxLAN: FDB: Multicast MAC addresses not supported");
return -EOPNOTSUPP;
if (vxlan_addr_multicast(&vxlan_fdb_info->remote_ip))
}
if (vxlan_addr_multicast(&vxlan_fdb_info->remote_ip)) {
NL_SET_ERR_MSG_MOD(extack, "VxLAN: FDB: Multicast destination IP is not supported");
return -EOPNOTSUPP;
}
switchdev_work->vxlan_fdb_info = *vxlan_fdb_info;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment