| .. | .. |
|---|
| 34 | 34 | { |
|---|
| 35 | 35 | struct mlxsw_sp_acl_atcam_region *aregion; |
|---|
| 36 | 36 | struct mlxsw_sp_acl_atcam_entry *aentry; |
|---|
| 37 | | - struct mlxsw_sp_acl_erp *erp; |
|---|
| 37 | + struct mlxsw_sp_acl_erp_mask *erp_mask; |
|---|
| 38 | 38 | |
|---|
| 39 | 39 | aregion = mlxsw_sp_acl_tcam_cregion_aregion(cregion); |
|---|
| 40 | 40 | aentry = mlxsw_sp_acl_tcam_centry_aentry(centry); |
|---|
| 41 | 41 | |
|---|
| 42 | | - erp = mlxsw_sp_acl_erp_get(aregion, mask, true); |
|---|
| 43 | | - if (IS_ERR(erp)) |
|---|
| 44 | | - return PTR_ERR(erp); |
|---|
| 45 | | - aentry->erp = erp; |
|---|
| 42 | + erp_mask = mlxsw_sp_acl_erp_mask_get(aregion, mask, true); |
|---|
| 43 | + if (IS_ERR(erp_mask)) |
|---|
| 44 | + return PTR_ERR(erp_mask); |
|---|
| 45 | + aentry->erp_mask = erp_mask; |
|---|
| 46 | 46 | |
|---|
| 47 | 47 | return 0; |
|---|
| 48 | 48 | } |
|---|
| .. | .. |
|---|
| 57 | 57 | aregion = mlxsw_sp_acl_tcam_cregion_aregion(cregion); |
|---|
| 58 | 58 | aentry = mlxsw_sp_acl_tcam_centry_aentry(centry); |
|---|
| 59 | 59 | |
|---|
| 60 | | - mlxsw_sp_acl_erp_put(aregion, aentry->erp); |
|---|
| 60 | + mlxsw_sp_acl_erp_mask_put(aregion, aentry->erp_mask); |
|---|
| 61 | 61 | } |
|---|
| 62 | 62 | |
|---|
| 63 | 63 | static const struct mlxsw_sp_acl_ctcam_region_ops |
|---|
| .. | .. |
|---|
| 139 | 139 | static int |
|---|
| 140 | 140 | mlxsw_sp2_acl_tcam_region_init(struct mlxsw_sp *mlxsw_sp, void *region_priv, |
|---|
| 141 | 141 | void *tcam_priv, |
|---|
| 142 | | - struct mlxsw_sp_acl_tcam_region *_region) |
|---|
| 142 | + struct mlxsw_sp_acl_tcam_region *_region, |
|---|
| 143 | + void *hints_priv) |
|---|
| 143 | 144 | { |
|---|
| 144 | 145 | struct mlxsw_sp2_acl_tcam_region *region = region_priv; |
|---|
| 145 | 146 | struct mlxsw_sp2_acl_tcam *tcam = tcam_priv; |
|---|
| .. | .. |
|---|
| 147 | 148 | region->region = _region; |
|---|
| 148 | 149 | |
|---|
| 149 | 150 | return mlxsw_sp_acl_atcam_region_init(mlxsw_sp, &tcam->atcam, |
|---|
| 150 | | - ®ion->aregion, _region, |
|---|
| 151 | + ®ion->aregion, |
|---|
| 152 | + _region, hints_priv, |
|---|
| 151 | 153 | &mlxsw_sp2_acl_ctcam_region_ops); |
|---|
| 152 | 154 | } |
|---|
| 153 | 155 | |
|---|
| .. | .. |
|---|
| 164 | 166 | struct mlxsw_sp_acl_tcam_region *region) |
|---|
| 165 | 167 | { |
|---|
| 166 | 168 | return mlxsw_sp_acl_atcam_region_associate(mlxsw_sp, region->id); |
|---|
| 169 | +} |
|---|
| 170 | + |
|---|
| 171 | +static void *mlxsw_sp2_acl_tcam_region_rehash_hints_get(void *region_priv) |
|---|
| 172 | +{ |
|---|
| 173 | + struct mlxsw_sp2_acl_tcam_region *region = region_priv; |
|---|
| 174 | + |
|---|
| 175 | + return mlxsw_sp_acl_atcam_rehash_hints_get(®ion->aregion); |
|---|
| 176 | +} |
|---|
| 177 | + |
|---|
| 178 | +static void mlxsw_sp2_acl_tcam_region_rehash_hints_put(void *hints_priv) |
|---|
| 179 | +{ |
|---|
| 180 | + mlxsw_sp_acl_atcam_rehash_hints_put(hints_priv); |
|---|
| 167 | 181 | } |
|---|
| 168 | 182 | |
|---|
| 169 | 183 | static void mlxsw_sp2_acl_tcam_chunk_init(void *region_priv, void *chunk_priv, |
|---|
| .. | .. |
|---|
| 211 | 225 | } |
|---|
| 212 | 226 | |
|---|
| 213 | 227 | static int |
|---|
| 228 | +mlxsw_sp2_acl_tcam_entry_action_replace(struct mlxsw_sp *mlxsw_sp, |
|---|
| 229 | + void *region_priv, void *entry_priv, |
|---|
| 230 | + struct mlxsw_sp_acl_rule_info *rulei) |
|---|
| 231 | +{ |
|---|
| 232 | + struct mlxsw_sp2_acl_tcam_region *region = region_priv; |
|---|
| 233 | + struct mlxsw_sp2_acl_tcam_entry *entry = entry_priv; |
|---|
| 234 | + |
|---|
| 235 | + entry->act_block = rulei->act_block; |
|---|
| 236 | + return mlxsw_sp_acl_atcam_entry_action_replace(mlxsw_sp, |
|---|
| 237 | + ®ion->aregion, |
|---|
| 238 | + &entry->aentry, rulei); |
|---|
| 239 | +} |
|---|
| 240 | + |
|---|
| 241 | +static int |
|---|
| 214 | 242 | mlxsw_sp2_acl_tcam_entry_activity_get(struct mlxsw_sp *mlxsw_sp, |
|---|
| 215 | 243 | void *region_priv, void *entry_priv, |
|---|
| 216 | 244 | bool *activity) |
|---|
| .. | .. |
|---|
| 229 | 257 | .region_init = mlxsw_sp2_acl_tcam_region_init, |
|---|
| 230 | 258 | .region_fini = mlxsw_sp2_acl_tcam_region_fini, |
|---|
| 231 | 259 | .region_associate = mlxsw_sp2_acl_tcam_region_associate, |
|---|
| 260 | + .region_rehash_hints_get = mlxsw_sp2_acl_tcam_region_rehash_hints_get, |
|---|
| 261 | + .region_rehash_hints_put = mlxsw_sp2_acl_tcam_region_rehash_hints_put, |
|---|
| 232 | 262 | .chunk_priv_size = sizeof(struct mlxsw_sp2_acl_tcam_chunk), |
|---|
| 233 | 263 | .chunk_init = mlxsw_sp2_acl_tcam_chunk_init, |
|---|
| 234 | 264 | .chunk_fini = mlxsw_sp2_acl_tcam_chunk_fini, |
|---|
| 235 | 265 | .entry_priv_size = sizeof(struct mlxsw_sp2_acl_tcam_entry), |
|---|
| 236 | 266 | .entry_add = mlxsw_sp2_acl_tcam_entry_add, |
|---|
| 237 | 267 | .entry_del = mlxsw_sp2_acl_tcam_entry_del, |
|---|
| 268 | + .entry_action_replace = mlxsw_sp2_acl_tcam_entry_action_replace, |
|---|
| 238 | 269 | .entry_activity_get = mlxsw_sp2_acl_tcam_entry_activity_get, |
|---|
| 239 | 270 | }; |
|---|