diff options
author | Amritha Nambiar <amritha.nambiar@intel.com> | 2018-06-30 00:26:57 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-07-01 20:06:24 -0400 |
commit | c6345ce7d361dce1b5d02a2181ccb598c27fd7ae (patch) | |
tree | e3e40f7b159a24b76b55c7c48f6057ecc0a423fd /net/ipv4/tcp_input.c | |
parent | 755c31cd85aea35cf7a5e7253851b52c08eff6e9 (diff) |
net: Record receive queue number for a connection
This patch adds a new field to sock_common 'skc_rx_queue_mapping'
which holds the receive queue number for the connection. The Rx queue
is marked in tcp_finish_connect() to allow a client app to do
SO_INCOMING_NAPI_ID after a connect() call to get the right queue
association for a socket. Rx queue is also marked in tcp_conn_request()
to allow syn-ack to go on the right tx-queue associated with
the queue on which syn is received.
Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com>
Signed-off-by: Sridhar Samudrala <sridhar.samudrala@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r-- | net/ipv4/tcp_input.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index eecd359595fc..a4731995e899 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -78,6 +78,7 @@ | |||
78 | #include <linux/errqueue.h> | 78 | #include <linux/errqueue.h> |
79 | #include <trace/events/tcp.h> | 79 | #include <trace/events/tcp.h> |
80 | #include <linux/static_key.h> | 80 | #include <linux/static_key.h> |
81 | #include <net/busy_poll.h> | ||
81 | 82 | ||
82 | int sysctl_tcp_max_orphans __read_mostly = NR_FILE; | 83 | int sysctl_tcp_max_orphans __read_mostly = NR_FILE; |
83 | 84 | ||
@@ -5592,6 +5593,7 @@ void tcp_finish_connect(struct sock *sk, struct sk_buff *skb) | |||
5592 | if (skb) { | 5593 | if (skb) { |
5593 | icsk->icsk_af_ops->sk_rx_dst_set(sk, skb); | 5594 | icsk->icsk_af_ops->sk_rx_dst_set(sk, skb); |
5594 | security_inet_conn_established(sk, skb); | 5595 | security_inet_conn_established(sk, skb); |
5596 | sk_mark_napi_id(sk, skb); | ||
5595 | } | 5597 | } |
5596 | 5598 | ||
5597 | tcp_init_transfer(sk, BPF_SOCK_OPS_ACTIVE_ESTABLISHED_CB); | 5599 | tcp_init_transfer(sk, BPF_SOCK_OPS_ACTIVE_ESTABLISHED_CB); |
@@ -6420,6 +6422,7 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops, | |||
6420 | tcp_rsk(req)->snt_isn = isn; | 6422 | tcp_rsk(req)->snt_isn = isn; |
6421 | tcp_rsk(req)->txhash = net_tx_rndhash(); | 6423 | tcp_rsk(req)->txhash = net_tx_rndhash(); |
6422 | tcp_openreq_init_rwin(req, sk, dst); | 6424 | tcp_openreq_init_rwin(req, sk, dst); |
6425 | sk_rx_queue_set(req_to_sk(req), skb); | ||
6423 | if (!want_cookie) { | 6426 | if (!want_cookie) { |
6424 | tcp_reqsk_record_syn(sk, req, skb); | 6427 | tcp_reqsk_record_syn(sk, req, skb); |
6425 | fastopen_sk = tcp_try_fastopen(sk, skb, req, &foc, dst); | 6428 | fastopen_sk = tcp_try_fastopen(sk, skb, req, &foc, dst); |