Skip to content

Commit ee538dc

Browse files
jpirkodavem330
authored andcommitted
net: sched: cls_api: make reclassify return all the way back to the original tp
With the introduction of chain goto action, the reclassification would cause the re-iteration of the actual chain. It makes more sense to restart the whole thing and re-iterate starting from the original tp - start of chain 0. Signed-off-by: Jiri Pirko <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent abc7a4e commit ee538dc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

net/sched/cls_api.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,8 @@ int tcf_classify(struct sk_buff *skb, const struct tcf_proto *tp,
300300
__be16 protocol = tc_skb_protocol(skb);
301301
#ifdef CONFIG_NET_CLS_ACT
302302
const int max_reclassify_loop = 4;
303-
const struct tcf_proto *old_tp = tp;
303+
const struct tcf_proto *orig_tp = tp;
304+
const struct tcf_proto *first_tp;
304305
int limit = 0;
305306

306307
reclassify:
@@ -315,9 +316,10 @@ int tcf_classify(struct sk_buff *skb, const struct tcf_proto *tp,
315316
err = tp->classify(skb, tp, res);
316317
#ifdef CONFIG_NET_CLS_ACT
317318
if (unlikely(err == TC_ACT_RECLASSIFY && !compat_mode)) {
319+
first_tp = orig_tp;
318320
goto reset;
319321
} else if (unlikely(TC_ACT_EXT_CMP(err, TC_ACT_GOTO_CHAIN))) {
320-
old_tp = res->goto_tp;
322+
first_tp = res->goto_tp;
321323
goto reset;
322324
}
323325
#endif
@@ -335,7 +337,7 @@ int tcf_classify(struct sk_buff *skb, const struct tcf_proto *tp,
335337
return TC_ACT_SHOT;
336338
}
337339

338-
tp = old_tp;
340+
tp = first_tp;
339341
protocol = tc_skb_protocol(skb);
340342
goto reclassify;
341343
#endif

0 commit comments

Comments
 (0)