Skip to content

Commit 0692546

Browse files
Jiri Pirkokuba-moo
authored andcommitted
mlxsw: reg: Add Router LPM Cache Enable Register
The RLPMCE allows disabling the LPM cache. Can be changed on the fly. Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: Ido Schimmel <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent edb47f3 commit 0692546

File tree

1 file changed

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

1 file changed

+35
-0
lines changed

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

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8653,6 +8653,40 @@ static inline void mlxsw_reg_rlcmld_pack6(char *payload,
86538653
mlxsw_reg_rlcmld_dip_mask6_memcpy_to(payload, dip_mask);
86548654
}
86558655

8656+
/* RLPMCE - Router LPM Cache Enable Register
8657+
* -----------------------------------------
8658+
* Allows disabling the LPM cache. Can be changed on the fly.
8659+
*/
8660+
8661+
#define MLXSW_REG_RLPMCE_ID 0x8056
8662+
#define MLXSW_REG_RLPMCE_LEN 0x4
8663+
8664+
MLXSW_REG_DEFINE(rlpmce, MLXSW_REG_RLPMCE_ID, MLXSW_REG_RLPMCE_LEN);
8665+
8666+
/* reg_rlpmce_flush
8667+
* Flush:
8668+
* 0: do not flush the cache (default)
8669+
* 1: flush (clear) the cache
8670+
* Access: WO
8671+
*/
8672+
MLXSW_ITEM32(reg, rlpmce, flush, 0x00, 4, 1);
8673+
8674+
/* reg_rlpmce_disable
8675+
* LPM cache:
8676+
* 0: enabled (default)
8677+
* 1: disabled
8678+
* Access: RW
8679+
*/
8680+
MLXSW_ITEM32(reg, rlpmce, disable, 0x00, 0, 1);
8681+
8682+
static inline void mlxsw_reg_rlpmce_pack(char *payload, bool flush,
8683+
bool disable)
8684+
{
8685+
MLXSW_REG_ZERO(rlpmce, payload);
8686+
mlxsw_reg_rlpmce_flush_set(payload, flush);
8687+
mlxsw_reg_rlpmce_disable_set(payload, disable);
8688+
}
8689+
86568690
/* Note that XLTQ, XMDR, XRMT and XRALXX register positions violate the rule
86578691
* of ordering register definitions by the ID. However, XRALXX pack helpers are
86588692
* using RALXX pack helpers, RALXX registers have higher IDs.
@@ -12028,6 +12062,7 @@ static const struct mlxsw_reg_info *mlxsw_reg_infos[] = {
1202812062
MLXSW_REG(rxlte),
1202912063
MLXSW_REG(rxltm),
1203012064
MLXSW_REG(rlcmld),
12065+
MLXSW_REG(rlpmce),
1203112066
MLXSW_REG(xltq),
1203212067
MLXSW_REG(xmdr),
1203312068
MLXSW_REG(xrmt),

0 commit comments

Comments
 (0)