mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-08 14:13:53 +00:00
mlxsw: reg: Add Switch Port FDB Security Register
Add the Switch Port FDB Security Register (SPFSR) that allows enabling and disabling security checks on a given local port. In Linux terms, it allows locking / unlocking a port. Signed-off-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: Petr Machata <petrm@nvidia.com> Signed-off-by: Petr Machata <petrm@nvidia.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
d85be0f5fd
commit
0b31fb9ba2
@ -2046,6 +2046,39 @@ static inline void mlxsw_reg_spvmlr_pack(char *payload, u16 local_port,
|
||||
}
|
||||
}
|
||||
|
||||
/* SPFSR - Switch Port FDB Security Register
|
||||
* -----------------------------------------
|
||||
* Configures the security mode per port.
|
||||
*/
|
||||
#define MLXSW_REG_SPFSR_ID 0x2023
|
||||
#define MLXSW_REG_SPFSR_LEN 0x08
|
||||
|
||||
MLXSW_REG_DEFINE(spfsr, MLXSW_REG_SPFSR_ID, MLXSW_REG_SPFSR_LEN);
|
||||
|
||||
/* reg_spfsr_local_port
|
||||
* Local port.
|
||||
* Access: Index
|
||||
*
|
||||
* Note: not supported for CPU port.
|
||||
*/
|
||||
MLXSW_ITEM32_LP(reg, spfsr, 0x00, 16, 0x00, 12);
|
||||
|
||||
/* reg_spfsr_security
|
||||
* Security checks.
|
||||
* 0: disabled (default)
|
||||
* 1: enabled
|
||||
* Access: RW
|
||||
*/
|
||||
MLXSW_ITEM32(reg, spfsr, security, 0x04, 31, 1);
|
||||
|
||||
static inline void mlxsw_reg_spfsr_pack(char *payload, u16 local_port,
|
||||
bool security)
|
||||
{
|
||||
MLXSW_REG_ZERO(spfsr, payload);
|
||||
mlxsw_reg_spfsr_local_port_set(payload, local_port);
|
||||
mlxsw_reg_spfsr_security_set(payload, security);
|
||||
}
|
||||
|
||||
/* SPVC - Switch Port VLAN Classification Register
|
||||
* -----------------------------------------------
|
||||
* Configures the port to identify packets as untagged / single tagged /
|
||||
@ -12762,6 +12795,7 @@ static const struct mlxsw_reg_info *mlxsw_reg_infos[] = {
|
||||
MLXSW_REG(svpe),
|
||||
MLXSW_REG(sfmr),
|
||||
MLXSW_REG(spvmlr),
|
||||
MLXSW_REG(spfsr),
|
||||
MLXSW_REG(spvc),
|
||||
MLXSW_REG(spevet),
|
||||
MLXSW_REG(smpe),
|
||||
|
Loading…
Reference in New Issue
Block a user