summaryrefslogtreecommitdiff
path: root/net/sched/act_ct.c
diff options
context:
space:
mode:
authorwenxu <wenxu@ucloud.cn>2020-11-25 12:01:23 +0800
committerJakub Kicinski <kuba@kernel.org>2020-11-27 14:36:02 -0800
commitc129412f74e99b609f0a8e95fc3915af1fd40f34 (patch)
tree05c6360e02fed40ef5dd599c1974414b639cb7e7 /net/sched/act_ct.c
parentfa6d639930ee5cd3f932cc314f3407f07a06582d (diff)
downloadlwn-c129412f74e99b609f0a8e95fc3915af1fd40f34.tar.gz
lwn-c129412f74e99b609f0a8e95fc3915af1fd40f34.zip
net/sched: sch_frag: add generic packet fragment support.
Currently kernel tc subsystem can do conntrack in cat_ct. But when several fragment packets go through the act_ct, function tcf_ct_handle_fragments will defrag the packets to a big one. But the last action will redirect mirred to a device which maybe lead the reassembly big packet over the mtu of target device. This patch add support for a xmit hook to mirred, that gets executed before xmiting the packet. Then, when act_ct gets loaded, it configs that hook. The frag xmit hook maybe reused by other modules. Signed-off-by: wenxu <wenxu@ucloud.cn> Acked-by: Cong Wang <cong.wang@bytedance.com> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/sched/act_ct.c')
-rw-r--r--net/sched/act_ct.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c
index aba3cd85f284..61092c5d646c 100644
--- a/net/sched/act_ct.c
+++ b/net/sched/act_ct.c
@@ -1541,6 +1541,8 @@ static int __init ct_init_module(void)
if (err)
goto err_register;
+ static_branch_inc(&tcf_frag_xmit_count);
+
return 0;
err_register:
@@ -1552,6 +1554,7 @@ err_tbl_init:
static void __exit ct_cleanup_module(void)
{
+ static_branch_dec(&tcf_frag_xmit_count);
tcf_unregister_action(&act_ct_ops, &ct_net_ops);
tcf_ct_flow_tables_uninit();
destroy_workqueue(act_ct_wq);