diff options
author | wenxu <wenxu@ucloud.cn> | 2020-11-25 07:01:23 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2020-11-28 01:36:02 +0300 |
commit | c129412f74e99b609f0a8e95fc3915af1fd40f34 (patch) | |
tree | 05c6360e02fed40ef5dd599c1974414b639cb7e7 /include | |
parent | fa6d639930ee5cd3f932cc314f3407f07a06582d (diff) | |
download | linux-c129412f74e99b609f0a8e95fc3915af1fd40f34.tar.xz |
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 'include')
-rw-r--r-- | include/net/act_api.h | 6 | ||||
-rw-r--r-- | include/net/sch_generic.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/include/net/act_api.h b/include/net/act_api.h index 87214927314a..55dab604861f 100644 --- a/include/net/act_api.h +++ b/include/net/act_api.h @@ -239,6 +239,12 @@ int tcf_action_check_ctrlact(int action, struct tcf_proto *tp, struct netlink_ext_ack *newchain); struct tcf_chain *tcf_action_set_ctrlact(struct tc_action *a, int action, struct tcf_chain *newchain); + +#ifdef CONFIG_INET +DECLARE_STATIC_KEY_FALSE(tcf_frag_xmit_count); +#endif + +int tcf_dev_queue_xmit(struct sk_buff *skb, int (*xmit)(struct sk_buff *skb)); #endif /* CONFIG_NET_CLS_ACT */ static inline void tcf_action_stats_update(struct tc_action *a, u64 bytes, diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index dd74f06bbb0b..162ed6249e8b 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -1281,4 +1281,6 @@ void mini_qdisc_pair_init(struct mini_Qdisc_pair *miniqp, struct Qdisc *qdisc, void mini_qdisc_pair_block_init(struct mini_Qdisc_pair *miniqp, struct tcf_block *block); +int sch_frag_xmit_hook(struct sk_buff *skb, int (*xmit)(struct sk_buff *skb)); + #endif |