Skip to content

Commit 51ae8cc

Browse files
yotamgidavem330
authored andcommitted
mlxsw: reg: Add Shared Buffer Internal Buffer register
The SBIB register configures per port buffer for internal use. This register is used to configure an egress mirror buffer on the egress port which does the mirroring. Signed-off-by: Yotam Gigi <yotamg@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent b87f793 commit 51ae8cc

File tree

1 file changed

+41
-0
lines changed
  • drivers/net/ethernet/mellanox/mlxsw

1 file changed

+41
-0
lines changed

drivers/net/ethernet/mellanox/mlxsw/reg.h

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5062,6 +5062,45 @@ static inline void mlxsw_reg_sbsr_rec_unpack(char *payload, int rec_index,
50625062
mlxsw_reg_sbsr_rec_max_buff_occupancy_get(payload, rec_index);
50635063
}
50645064

5065+
/* SBIB - Shared Buffer Internal Buffer Register
5066+
* ---------------------------------------------
5067+
* The SBIB register configures per port buffers for internal use. The internal
5068+
* buffers consume memory on the port buffers (note that the port buffers are
5069+
* used also by PBMC).
5070+
*
5071+
* For Spectrum this is used for egress mirroring.
5072+
*/
5073+
#define MLXSW_REG_SBIB_ID 0xB006
5074+
#define MLXSW_REG_SBIB_LEN 0x10
5075+
5076+
static const struct mlxsw_reg_info mlxsw_reg_sbib = {
5077+
.id = MLXSW_REG_SBIB_ID,
5078+
.len = MLXSW_REG_SBIB_LEN,
5079+
};
5080+
5081+
/* reg_sbib_local_port
5082+
* Local port number
5083+
* Not supported for CPU port and router port
5084+
* Access: Index
5085+
*/
5086+
MLXSW_ITEM32(reg, sbib, local_port, 0x00, 16, 8);
5087+
5088+
/* reg_sbib_buff_size
5089+
* Units represented in cells
5090+
* Allowed range is 0 to (cap_max_headroom_size - 1)
5091+
* Default is 0
5092+
* Access: RW
5093+
*/
5094+
MLXSW_ITEM32(reg, sbib, buff_size, 0x08, 0, 24);
5095+
5096+
static inline void mlxsw_reg_sbib_pack(char *payload, u8 local_port,
5097+
u32 buff_size)
5098+
{
5099+
MLXSW_REG_ZERO(sbib, payload);
5100+
mlxsw_reg_sbib_local_port_set(payload, local_port);
5101+
mlxsw_reg_sbib_buff_size_set(payload, buff_size);
5102+
}
5103+
50655104
static inline const char *mlxsw_reg_id_str(u16 reg_id)
50665105
{
50675106
switch (reg_id) {
@@ -5179,6 +5218,8 @@ static inline const char *mlxsw_reg_id_str(u16 reg_id)
51795218
return "SBMM";
51805219
case MLXSW_REG_SBSR_ID:
51815220
return "SBSR";
5221+
case MLXSW_REG_SBIB_ID:
5222+
return "SBIB";
51825223
default:
51835224
return "*UNKNOWN*";
51845225
}

0 commit comments

Comments
 (0)