Skip to content

Commit e590745

Browse files
Alexander Duyckdavem330
authored andcommitted
tcp: Record Rx hash and NAPI ID in tcp_child_process
While working on some recent busy poll changes we found that child sockets were being instantiated without NAPI ID being set. In our first attempt to fix it, it was suggested that we should just pull programming the NAPI ID into the function itself since all callers will need to have it set. In addition to the NAPI ID change I have dropped the code that was populating the Rx hash since it was actually being populated in tcp_get_cookie_sock. Reported-by: Sridhar Samudrala <[email protected]> Signed-off-by: Alexander Duyck <[email protected]> Acked-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 545cd5e commit e590745

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

net/ipv4/tcp_ipv4.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,8 +1409,6 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb)
14091409
if (!nsk)
14101410
goto discard;
14111411
if (nsk != sk) {
1412-
sock_rps_save_rxhash(nsk, skb);
1413-
sk_mark_napi_id(nsk, skb);
14141412
if (tcp_child_process(sk, nsk, skb)) {
14151413
rsk = nsk;
14161414
goto reset;

net/ipv4/tcp_minisocks.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <net/tcp.h>
2727
#include <net/inet_common.h>
2828
#include <net/xfrm.h>
29+
#include <net/busy_poll.h>
2930

3031
int sysctl_tcp_abort_on_overflow __read_mostly;
3132

@@ -799,6 +800,9 @@ int tcp_child_process(struct sock *parent, struct sock *child,
799800
int ret = 0;
800801
int state = child->sk_state;
801802

803+
/* record NAPI ID of child */
804+
sk_mark_napi_id(child, skb);
805+
802806
tcp_segs_in(tcp_sk(child), skb);
803807
if (!sock_owned_by_user(child)) {
804808
ret = tcp_rcv_state_process(child, skb);

net/ipv6/tcp_ipv6.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,8 +1293,6 @@ static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)
12931293
goto discard;
12941294

12951295
if (nsk != sk) {
1296-
sock_rps_save_rxhash(nsk, skb);
1297-
sk_mark_napi_id(nsk, skb);
12981296
if (tcp_child_process(sk, nsk, skb))
12991297
goto reset;
13001298
if (opt_skb)

0 commit comments

Comments
 (0)