提交 3624fa5a 编写于 作者: Z zhang-mingyi66

net, bpf: Introduces a new ebpf delay connect flag

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I7LE1H

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

The bpf_defer_connect bit is added for inet_sock to indicate
whether the current socket is changed to the bpf program to
delay link establishment.
Signed-off-by: Nzhang-mingyi66 <zhangmingyi5@huawei.com>
上级 eab6965b
......@@ -238,10 +238,11 @@ struct inet_sock {
nodefrag:1;
__u8 bind_address_no_port:1,
recverr_rfc4884:1,
defer_connect:1; /* Indicates that fastopen_connect is set
defer_connect:1, /* Indicates that fastopen_connect is set
* and cookie exists so we defer connect
* until first data frame is written
*/
bpf_defer_connect:1;
__u8 rcv_tos;
__u8 convert_csum;
int uc_index;
......
......@@ -582,7 +582,8 @@ __poll_t tcp_poll(struct file *file, struct socket *sock, poll_table *wait)
if (urg_data & TCP_URG_VALID)
mask |= EPOLLPRI;
} else if (state == TCP_SYN_SENT && inet_sk(sk)->defer_connect) {
} else if (state == TCP_SYN_SENT &&
(inet_sk(sk)->defer_connect || inet_sk(sk)->bpf_defer_connect)) {
/* Active TCP fastopen socket with defer_connect
* Return EPOLLOUT so application can call write()
* in order for kernel to generate SYN+data
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册