@@ -154,10 +154,6 @@ struct mlxsw_sp_acl_tcam_group {
154
154
struct list_head region_list ;
155
155
unsigned int region_count ;
156
156
struct rhashtable chunk_ht ;
157
- struct {
158
- u16 local_port ;
159
- bool ingress ;
160
- } bound ;
161
157
struct mlxsw_sp_acl_tcam_group_ops * ops ;
162
158
const struct mlxsw_sp_acl_tcam_pattern * patterns ;
163
159
unsigned int patterns_count ;
@@ -271,26 +267,28 @@ mlxsw_sp_acl_tcam_group_bind(struct mlxsw_sp *mlxsw_sp,
271
267
return - EINVAL ;
272
268
273
269
mlxsw_sp_port = netdev_priv (dev );
274
- group -> bound .local_port = mlxsw_sp_port -> local_port ;
275
- group -> bound .ingress = ingress ;
276
- mlxsw_reg_ppbt_pack (ppbt_pl ,
277
- group -> bound .ingress ? MLXSW_REG_PXBT_E_IACL :
278
- MLXSW_REG_PXBT_E_EACL ,
279
- MLXSW_REG_PXBT_OP_BIND , group -> bound .local_port ,
270
+ mlxsw_reg_ppbt_pack (ppbt_pl , ingress ? MLXSW_REG_PXBT_E_IACL :
271
+ MLXSW_REG_PXBT_E_EACL ,
272
+ MLXSW_REG_PXBT_OP_BIND , mlxsw_sp_port -> local_port ,
280
273
group -> id );
281
274
return mlxsw_reg_write (mlxsw_sp -> core , MLXSW_REG (ppbt ), ppbt_pl );
282
275
}
283
276
284
277
static void
285
278
mlxsw_sp_acl_tcam_group_unbind (struct mlxsw_sp * mlxsw_sp ,
286
- struct mlxsw_sp_acl_tcam_group * group )
279
+ struct mlxsw_sp_acl_tcam_group * group ,
280
+ struct net_device * dev , bool ingress )
287
281
{
282
+ struct mlxsw_sp_port * mlxsw_sp_port ;
288
283
char ppbt_pl [MLXSW_REG_PPBT_LEN ];
289
284
290
- mlxsw_reg_ppbt_pack (ppbt_pl ,
291
- group -> bound .ingress ? MLXSW_REG_PXBT_E_IACL :
292
- MLXSW_REG_PXBT_E_EACL ,
293
- MLXSW_REG_PXBT_OP_UNBIND , group -> bound .local_port ,
285
+ if (WARN_ON (!mlxsw_sp_port_dev_check (dev )))
286
+ return ;
287
+
288
+ mlxsw_sp_port = netdev_priv (dev );
289
+ mlxsw_reg_ppbt_pack (ppbt_pl , ingress ? MLXSW_REG_PXBT_E_IACL :
290
+ MLXSW_REG_PXBT_E_EACL ,
291
+ MLXSW_REG_PXBT_OP_UNBIND , mlxsw_sp_port -> local_port ,
294
292
group -> id );
295
293
mlxsw_reg_write (mlxsw_sp -> core , MLXSW_REG (ppbt ), ppbt_pl );
296
294
}
@@ -1066,11 +1064,12 @@ mlxsw_sp_acl_tcam_flower_ruleset_bind(struct mlxsw_sp *mlxsw_sp,
1066
1064
1067
1065
static void
1068
1066
mlxsw_sp_acl_tcam_flower_ruleset_unbind (struct mlxsw_sp * mlxsw_sp ,
1069
- void * ruleset_priv )
1067
+ void * ruleset_priv ,
1068
+ struct net_device * dev , bool ingress )
1070
1069
{
1071
1070
struct mlxsw_sp_acl_tcam_flower_ruleset * ruleset = ruleset_priv ;
1072
1071
1073
- mlxsw_sp_acl_tcam_group_unbind (mlxsw_sp , & ruleset -> group );
1072
+ mlxsw_sp_acl_tcam_group_unbind (mlxsw_sp , & ruleset -> group , dev , ingress );
1074
1073
}
1075
1074
1076
1075
static u16
0 commit comments