Skip to content

Commit a75e41d

Browse files
nirdotandavem330
authored andcommitted
mlxsw: reg: Add Policy Engine Multicast Router Binding Table Register
In Spectrum-2, multicast routing is implemented explicitly using policy engine (ACL) block. PEMRBT register is used to bind a dedicated ACL group to a specific IP protocol. Add the register to be later used in multicast router implementation. Signed-off-by: Nir Dotan <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Signed-off-by: Ido Schimmel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e1a7651 commit a75e41d

File tree

1 file changed

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

1 file changed

+38
-0
lines changed

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

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2495,6 +2495,43 @@ static inline void mlxsw_reg_pefa_unpack(char *payload, bool *p_a)
24952495
*p_a = mlxsw_reg_pefa_a_get(payload);
24962496
}
24972497

2498+
/* PEMRBT - Policy-Engine Multicast Router Binding Table Register
2499+
* --------------------------------------------------------------
2500+
* This register is used for binding Multicast router to an ACL group
2501+
* that serves the MC router.
2502+
* This register is not supported by SwitchX/-2 and Spectrum.
2503+
*/
2504+
#define MLXSW_REG_PEMRBT_ID 0x3014
2505+
#define MLXSW_REG_PEMRBT_LEN 0x14
2506+
2507+
MLXSW_REG_DEFINE(pemrbt, MLXSW_REG_PEMRBT_ID, MLXSW_REG_PEMRBT_LEN);
2508+
2509+
enum mlxsw_reg_pemrbt_protocol {
2510+
MLXSW_REG_PEMRBT_PROTO_IPV4,
2511+
MLXSW_REG_PEMRBT_PROTO_IPV6,
2512+
};
2513+
2514+
/* reg_pemrbt_protocol
2515+
* Access: Index
2516+
*/
2517+
MLXSW_ITEM32(reg, pemrbt, protocol, 0x00, 0, 1);
2518+
2519+
/* reg_pemrbt_group_id
2520+
* ACL group identifier.
2521+
* Range 0..cap_max_acl_groups-1
2522+
* Access: RW
2523+
*/
2524+
MLXSW_ITEM32(reg, pemrbt, group_id, 0x10, 0, 16);
2525+
2526+
static inline void
2527+
mlxsw_reg_pemrbt_pack(char *payload, enum mlxsw_reg_pemrbt_protocol protocol,
2528+
u16 group_id)
2529+
{
2530+
MLXSW_REG_ZERO(pemrbt, payload);
2531+
mlxsw_reg_pemrbt_protocol_set(payload, protocol);
2532+
mlxsw_reg_pemrbt_group_id_set(payload, group_id);
2533+
}
2534+
24982535
/* PTCE-V2 - Policy-Engine TCAM Entry Register Version 2
24992536
* -----------------------------------------------------
25002537
* This register is used for accessing rules within a TCAM region.
@@ -9568,6 +9605,7 @@ static const struct mlxsw_reg_info *mlxsw_reg_infos[] = {
95689605
MLXSW_REG(ppbs),
95699606
MLXSW_REG(prcr),
95709607
MLXSW_REG(pefa),
9608+
MLXSW_REG(pemrbt),
95719609
MLXSW_REG(ptce2),
95729610
MLXSW_REG(perpt),
95739611
MLXSW_REG(perar),

0 commit comments

Comments
 (0)