Skip to content

Commit 8b5bd59

Browse files
spikehNipaLocal
authored andcommitted
tcp: fix passive TFO socket having invalid NAPI ID
There is a bug with passive TFO sockets returning an invalid NAPI ID 0 from SO_INCOMING_NAPI_ID. Normally this is not an issue, but zero copy receive relies on a correct NAPI ID to process sockets on the right queue. Fix by adding a sk_mark_napi_id_set(). Fixes: e590745 ("tcp: Record Rx hash and NAPI ID in tcp_child_process") Signed-off-by: David Wei <[email protected]> Reviewed-by: Kuniyuki Iwashima <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent 03d77f1 commit 8b5bd59

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/ipv4/tcp_fastopen.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <linux/tcp.h>
44
#include <linux/rcupdate.h>
55
#include <net/tcp.h>
6+
#include <net/busy_poll.h>
67

78
void tcp_fastopen_init_key_once(struct net *net)
89
{
@@ -279,6 +280,8 @@ static struct sock *tcp_fastopen_create_child(struct sock *sk,
279280

280281
refcount_set(&req->rsk_refcnt, 2);
281282

283+
sk_mark_napi_id_set(child, skb);
284+
282285
/* Now finish processing the fastopen child socket. */
283286
tcp_init_transfer(child, BPF_SOCK_OPS_PASSIVE_ESTABLISHED_CB, skb);
284287

0 commit comments

Comments
 (0)