Skip to content

Commit 0cc254e

Browse files
Paul Blakeykuba-moo
authored andcommitted
net/sched: act_ct: Offload connections with commit action
Currently established connections are not offloaded if the filter has a "ct commit" action. This behavior will not offload connections of the following scenario: $ tc_filter add dev $DEV ingress protocol ip prio 1 flower \ ct_state -trk \ action ct commit action goto chain 1 $ tc_filter add dev $DEV ingress protocol ip chain 1 prio 1 flower \ action mirred egress redirect dev $DEV2 $ tc_filter add dev $DEV2 ingress protocol ip prio 1 flower \ action ct commit action goto chain 1 $ tc_filter add dev $DEV2 ingress protocol ip prio 1 chain 1 flower \ ct_state +trk+est \ action mirred egress redirect dev $DEV Offload established connections, regardless of the commit flag. Fixes: 46475bb ("net/sched: act_ct: Software offload of established flows") Reviewed-by: Oz Shlomo <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Acked-by: Marcelo Ricardo Leitner <[email protected]> Signed-off-by: Paul Blakey <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent b28d8f0 commit 0cc254e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

net/sched/act_ct.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,7 @@ static int tcf_ct_act(struct sk_buff *skb, const struct tc_action *a,
984984
*/
985985
cached = tcf_ct_skb_nfct_cached(net, skb, p->zone, force);
986986
if (!cached) {
987-
if (!commit && tcf_ct_flow_table_lookup(p, skb, family)) {
987+
if (tcf_ct_flow_table_lookup(p, skb, family)) {
988988
skip_add = true;
989989
goto do_nat;
990990
}
@@ -1022,10 +1022,11 @@ static int tcf_ct_act(struct sk_buff *skb, const struct tc_action *a,
10221022
* even if the connection is already confirmed.
10231023
*/
10241024
nf_conntrack_confirm(skb);
1025-
} else if (!skip_add) {
1026-
tcf_ct_flow_table_process_conn(p->ct_ft, ct, ctinfo);
10271025
}
10281026

1027+
if (!skip_add)
1028+
tcf_ct_flow_table_process_conn(p->ct_ft, ct, ctinfo);
1029+
10291030
out_push:
10301031
skb_push_rcsum(skb, nh_ofs);
10311032

0 commit comments

Comments
 (0)