mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
mlxsw: reg: Add multi field to PAGT register
For Spectrum-2 this allows parallel lookups in multiple regions. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
a339bf8aaf
commit
5c661f142c
2 changed files with 11 additions and 2 deletions
|
@ -2199,6 +2199,14 @@ MLXSW_ITEM32(reg, pagt, size, 0x00, 0, 8);
|
|||
*/
|
||||
MLXSW_ITEM32(reg, pagt, acl_group_id, 0x08, 0, 16);
|
||||
|
||||
/* reg_pagt_multi
|
||||
* Multi-ACL
|
||||
* 0 - This ACL is the last ACL in the multi-ACL
|
||||
* 1 - This ACL is part of a multi-ACL
|
||||
* Access: RW
|
||||
*/
|
||||
MLXSW_ITEM32_INDEXED(reg, pagt, multi, 0x30, 31, 1, 0x04, 0x00, false);
|
||||
|
||||
/* reg_pagt_acl_id
|
||||
* ACL identifier
|
||||
* Access: RW
|
||||
|
@ -2212,12 +2220,13 @@ static inline void mlxsw_reg_pagt_pack(char *payload, u16 acl_group_id)
|
|||
}
|
||||
|
||||
static inline void mlxsw_reg_pagt_acl_id_pack(char *payload, int index,
|
||||
u16 acl_id)
|
||||
u16 acl_id, bool multi)
|
||||
{
|
||||
u8 size = mlxsw_reg_pagt_size_get(payload);
|
||||
|
||||
if (index >= size)
|
||||
mlxsw_reg_pagt_size_set(payload, index + 1);
|
||||
mlxsw_reg_pagt_multi_set(payload, index, multi);
|
||||
mlxsw_reg_pagt_acl_id_set(payload, index, acl_id);
|
||||
}
|
||||
|
||||
|
|
|
@ -217,7 +217,7 @@ static int mlxsw_sp_acl_tcam_group_update(struct mlxsw_sp *mlxsw_sp,
|
|||
mlxsw_reg_pagt_pack(pagt_pl, group->id);
|
||||
list_for_each_entry(vregion, &group->vregion_list, list)
|
||||
mlxsw_reg_pagt_acl_id_pack(pagt_pl, acl_index++,
|
||||
vregion->region->id);
|
||||
vregion->region->id, false);
|
||||
mlxsw_reg_pagt_size_set(pagt_pl, acl_index);
|
||||
return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pagt), pagt_pl);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue