mlxsw: reg: Add multi field to PAGT register
authorJiri Pirko <jiri@mellanox.com>
Thu, 7 Feb 2019 11:22:53 +0000 (11:22 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 8 Feb 2019 23:02:50 +0000 (15:02 -0800)
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>
drivers/net/ethernet/mellanox/mlxsw/reg.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c

index 5f8066ab7d40b6a5a1cbf3e61f7f8da37002c6ba..227720ce39821eae6c628ae6d6584133cb7760a8 100644 (file)
@@ -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);
 }
 
index 1077c893438b81444d9f19cd9465e3ce680902ac..12d202afa2332c776165b376fe2bfb9109b951c8 100644 (file)
@@ -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);
 }