提交 cc36784b 编写于 作者: W Wang Yufen 提交者: Zheng Zengkai

tcp_comp: add init and cleanup hook for compression

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I4PNEK
CVE: NA

-------------------------------------------------

When establishing a tcp connection or closing it, the
tcp compression needs to be initialized or cleaned
up at the same time.

Add dummy init and cleanup hook for tcp compression.
It will be implemented later.
Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: NWang Yufen <wangyufen@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NLu Wei <luwei32@huawei.com>
Reviewed-by: NWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 7f39947b
......@@ -2383,11 +2383,20 @@ static inline u64 tcp_transmit_time(const struct sock *sk)
#if IS_ENABLED(CONFIG_TCP_COMP)
extern struct static_key_false tcp_have_comp;
bool tcp_syn_comp_enabled(const struct tcp_sock *tp);
void tcp_init_compression(struct sock *sk);
void tcp_cleanup_compression(struct sock *sk);
#else
static inline bool tcp_syn_comp_enabled(const struct tcp_sock *tp)
{
return false;
}
static inline void tcp_init_compression(struct sock *sk)
{
}
static inline void tcp_cleanup_compression(struct sock *sk)
{
}
#endif
#endif /* _TCP_H */
......@@ -11,3 +11,11 @@ bool tcp_syn_comp_enabled(const struct tcp_sock *tp)
{
return true;
}
void tcp_init_compression(struct sock *sk)
{
}
void tcp_cleanup_compression(struct sock *sk)
{
}
......@@ -5937,6 +5937,7 @@ void tcp_init_transfer(struct sock *sk, int bpf_op, struct sk_buff *skb)
/* Initialize congestion control unless BPF initialized it already: */
if (!icsk->icsk_ca_initialized)
tcp_init_congestion_control(sk);
tcp_init_compression(sk);
tcp_init_buffer_space(sk);
}
......
......@@ -2218,6 +2218,8 @@ void tcp_v4_destroy_sock(struct sock *sk)
tcp_cleanup_congestion_control(sk);
tcp_cleanup_compression(sk);
tcp_cleanup_ulp(sk);
/* Cleanup up the write buffer. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册