summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
diff options
context:
space:
mode:
authorIdo Schimmel2016-06-20 23:04:17 +0200
committerDavid S. Miller2016-06-21 11:02:50 +0200
commit41b996cc94c7e7f8567585d05ea1d52a3a181146 (patch)
tree738ee0580c06efb58778a6995cf8405294889135 /drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
parentmlxsw: spectrum: Check if port is vPort using its VID (diff)
downloadkernel-qcow2-linux-41b996cc94c7e7f8567585d05ea1d52a3a181146.tar.gz
kernel-qcow2-linux-41b996cc94c7e7f8567585d05ea1d52a3a181146.tar.xz
kernel-qcow2-linux-41b996cc94c7e7f8567585d05ea1d52a3a181146.zip
mlxsw: spectrum: Add FID get / set functions
As previously explained, not all vPorts will be assigned FIDs, so instead of returning the FID index of a vPort, return a pointer to its FID struct. This will allow us to know whether it's legal to access the vPort's FID parameters such as index and device. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
index 671376984af2..b31b2ce0f1ed 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
@@ -58,7 +58,7 @@ static u16 mlxsw_sp_port_vid_to_fid_get(struct mlxsw_sp_port *mlxsw_sp_port,
u16 fid = vid;
if (mlxsw_sp_port_is_vport(mlxsw_sp_port))
- fid = mlxsw_sp_vport_fid_get(mlxsw_sp_port);
+ fid = mlxsw_sp_vport_fid_get(mlxsw_sp_port)->fid;
if (!fid)
fid = mlxsw_sp_port->pvid;
@@ -233,9 +233,9 @@ static int mlxsw_sp_port_uc_flood_set(struct mlxsw_sp_port *mlxsw_sp_port,
int err;
if (mlxsw_sp_port_is_vport(mlxsw_sp_port)) {
- u16 vfid, fid = mlxsw_sp_vport_fid_get(mlxsw_sp_port);
+ u16 fid = mlxsw_sp_vport_fid_get(mlxsw_sp_port)->fid;
+ u16 vfid = mlxsw_sp_fid_to_vfid(fid);
- vfid = mlxsw_sp_fid_to_vfid(fid);
return __mlxsw_sp_port_flood_set(mlxsw_sp_port, vfid, vfid,
set, true);
}
@@ -1212,7 +1212,7 @@ static int mlxsw_sp_port_fdb_dump(struct mlxsw_sp_port *mlxsw_sp_port,
return -ENOMEM;
if (mlxsw_sp_port_is_vport(mlxsw_sp_port))
- vport_fid = mlxsw_sp_vport_fid_get(mlxsw_sp_port);
+ vport_fid = mlxsw_sp_vport_fid_get(mlxsw_sp_port)->fid;
mlxsw_reg_sfd_pack(sfd_pl, MLXSW_REG_SFD_OP_QUERY_DUMP, 0);
do {