Skip to content

Commit e534a56

Browse files
jpirkodavem330
authored andcommitted
mlxsw: reg: Add Switch Filtering Database Aging Time register definition
Add SFDAT which is used to control switch ageing time. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 1f65da7 commit e534a56

File tree

1 file changed

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

1 file changed

+37
-0
lines changed

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

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,41 @@ static inline void mlxsw_reg_sspr_pack(char *payload, u8 local_port)
157157
mlxsw_reg_sspr_system_port_set(payload, local_port);
158158
}
159159

160+
/* SFDAT - Switch Filtering Database Aging Time
161+
* --------------------------------------------
162+
* Controls the Switch aging time. Aging time is able to be set per Switch
163+
* Partition.
164+
*/
165+
#define MLXSW_REG_SFDAT_ID 0x2009
166+
#define MLXSW_REG_SFDAT_LEN 0x8
167+
168+
static const struct mlxsw_reg_info mlxsw_reg_sfdat = {
169+
.id = MLXSW_REG_SFDAT_ID,
170+
.len = MLXSW_REG_SFDAT_LEN,
171+
};
172+
173+
/* reg_sfdat_swid
174+
* Switch partition ID.
175+
* Access: Index
176+
*/
177+
MLXSW_ITEM32(reg, sfdat, swid, 0x00, 24, 8);
178+
179+
/* reg_sfdat_age_time
180+
* Aging time in seconds
181+
* Min - 10 seconds
182+
* Max - 1,000,000 seconds
183+
* Default is 300 seconds.
184+
* Access: RW
185+
*/
186+
MLXSW_ITEM32(reg, sfdat, age_time, 0x04, 0, 20);
187+
188+
static inline void mlxsw_reg_sfdat_pack(char *payload, u32 age_time)
189+
{
190+
MLXSW_REG_ZERO(sfdat, payload);
191+
mlxsw_reg_sfdat_swid_set(payload, 0);
192+
mlxsw_reg_sfdat_age_time_set(payload, age_time);
193+
}
194+
160195
/* SFD - Switch Filtering Database
161196
* -------------------------------
162197
* The following register defines the access to the filtering database.
@@ -2259,6 +2294,8 @@ static inline const char *mlxsw_reg_id_str(u16 reg_id)
22592294
return "SPAD";
22602295
case MLXSW_REG_SSPR_ID:
22612296
return "SSPR";
2297+
case MLXSW_REG_SFDAT_ID:
2298+
return "SFDAT";
22622299
case MLXSW_REG_SFD_ID:
22632300
return "SFD";
22642301
case MLXSW_REG_SFN_ID:

0 commit comments

Comments
 (0)