Commit 038784a9 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller
Browse files

mlxsw: spectrum: Introduce resource for getting offset of 4 lanes split port



In Spectrum-3 the modules have 8 lanes, so split by count 2 results in
two split ports each of 4 lanes. Add a resource that can be used to
obtain local port offset in that case.

Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d0846ce9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ enum mlxsw_res_id {
	MLXSW_RES_ID_MAX_LAG_MEMBERS,
	MLXSW_RES_ID_LOCAL_PORTS_IN_1X,
	MLXSW_RES_ID_LOCAL_PORTS_IN_2X,
	MLXSW_RES_ID_LOCAL_PORTS_IN_4X,
	MLXSW_RES_ID_GUARANTEED_SHARED_BUFFER,
	MLXSW_RES_ID_CELL_SIZE,
	MLXSW_RES_ID_MAX_HEADROOM_SIZE,
@@ -82,6 +83,7 @@ static u16 mlxsw_res_ids[] = {
	[MLXSW_RES_ID_MAX_LAG_MEMBERS] = 0x2521,
	[MLXSW_RES_ID_LOCAL_PORTS_IN_1X] = 0x2610,
	[MLXSW_RES_ID_LOCAL_PORTS_IN_2X] = 0x2611,
	[MLXSW_RES_ID_LOCAL_PORTS_IN_4X] = 0x2612,
	[MLXSW_RES_ID_GUARANTEED_SHARED_BUFFER] = 0x2805,	/* Bytes */
	[MLXSW_RES_ID_CELL_SIZE] = 0x2803,	/* Bytes */
	[MLXSW_RES_ID_MAX_HEADROOM_SIZE] = 0x2811,	/* Bytes */
+2 −0
Original line number Diff line number Diff line
@@ -4165,6 +4165,8 @@ static int mlxsw_sp_local_ports_offset(struct mlxsw_core *mlxsw_core,
		local_ports_in_x_res_id = MLXSW_RES_ID_LOCAL_PORTS_IN_1X;
	else if (split_width == 2)
		local_ports_in_x_res_id = MLXSW_RES_ID_LOCAL_PORTS_IN_2X;
	else if (split_width == 4)
		local_ports_in_x_res_id = MLXSW_RES_ID_LOCAL_PORTS_IN_4X;
	else
		return -EINVAL;