@@ -201,7 +201,7 @@ static void fl_destroy_filter(struct rcu_head *head)
201
201
kfree (f );
202
202
}
203
203
204
- static void fl_hw_destroy_filter (struct tcf_proto * tp , unsigned long cookie )
204
+ static void fl_hw_destroy_filter (struct tcf_proto * tp , struct cls_fl_filter * f )
205
205
{
206
206
struct net_device * dev = tp -> q -> dev_queue -> dev ;
207
207
struct tc_cls_flower_offload offload = {0 };
@@ -211,7 +211,7 @@ static void fl_hw_destroy_filter(struct tcf_proto *tp, unsigned long cookie)
211
211
return ;
212
212
213
213
offload .command = TC_CLSFLOWER_DESTROY ;
214
- offload .cookie = cookie ;
214
+ offload .cookie = ( unsigned long ) f ;
215
215
216
216
tc .type = TC_SETUP_CLSFLOWER ;
217
217
tc .cls_flower = & offload ;
@@ -222,32 +222,30 @@ static void fl_hw_destroy_filter(struct tcf_proto *tp, unsigned long cookie)
222
222
static int fl_hw_replace_filter (struct tcf_proto * tp ,
223
223
struct flow_dissector * dissector ,
224
224
struct fl_flow_key * mask ,
225
- struct fl_flow_key * key ,
226
- struct tcf_exts * actions ,
227
- unsigned long cookie , u32 flags )
225
+ struct cls_fl_filter * f )
228
226
{
229
227
struct net_device * dev = tp -> q -> dev_queue -> dev ;
230
228
struct tc_cls_flower_offload offload = {0 };
231
229
struct tc_to_netdev tc ;
232
230
int err ;
233
231
234
232
if (!tc_can_offload (dev , tp ))
235
- return tc_skip_sw (flags ) ? - EINVAL : 0 ;
233
+ return tc_skip_sw (f -> flags ) ? - EINVAL : 0 ;
236
234
237
235
offload .command = TC_CLSFLOWER_REPLACE ;
238
- offload .cookie = cookie ;
236
+ offload .cookie = ( unsigned long ) f ;
239
237
offload .dissector = dissector ;
240
238
offload .mask = mask ;
241
- offload .key = key ;
242
- offload .exts = actions ;
239
+ offload .key = & f -> key ;
240
+ offload .exts = & f -> exts ;
243
241
244
242
tc .type = TC_SETUP_CLSFLOWER ;
245
243
tc .cls_flower = & offload ;
246
244
247
245
err = dev -> netdev_ops -> ndo_setup_tc (dev , tp -> q -> handle , tp -> protocol ,
248
246
& tc );
249
247
250
- if (tc_skip_sw (flags ))
248
+ if (tc_skip_sw (f -> flags ))
251
249
return err ;
252
250
253
251
return 0 ;
@@ -276,7 +274,7 @@ static void __fl_delete(struct tcf_proto *tp, struct cls_fl_filter *f)
276
274
{
277
275
list_del_rcu (& f -> list );
278
276
if (!tc_skip_hw (f -> flags ))
279
- fl_hw_destroy_filter (tp , ( unsigned long ) f );
277
+ fl_hw_destroy_filter (tp , f );
280
278
tcf_unbind_filter (tp , & f -> res );
281
279
call_rcu (& f -> rcu , fl_destroy_filter );
282
280
}
@@ -748,10 +746,7 @@ static int fl_change(struct net *net, struct sk_buff *in_skb,
748
746
err = fl_hw_replace_filter (tp ,
749
747
& head -> dissector ,
750
748
& mask .key ,
751
- & fnew -> key ,
752
- & fnew -> exts ,
753
- (unsigned long )fnew ,
754
- fnew -> flags );
749
+ fnew );
755
750
if (err )
756
751
goto errout ;
757
752
}
@@ -760,7 +755,7 @@ static int fl_change(struct net *net, struct sk_buff *in_skb,
760
755
rhashtable_remove_fast (& head -> ht , & fold -> ht_node ,
761
756
head -> ht_params );
762
757
if (!tc_skip_hw (fold -> flags ))
763
- fl_hw_destroy_filter (tp , ( unsigned long ) fold );
758
+ fl_hw_destroy_filter (tp , fold );
764
759
}
765
760
766
761
* arg = (unsigned long ) fnew ;
0 commit comments