aboutsummaryrefslogtreecommitdiffstats
path: root/net/tls/tls_sw.c
diff options
context:
space:
mode:
authorVakul Garg <vakul.garg@nxp.com>2018-07-30 16:08:33 +0530
committerDavid S. Miller <davem@davemloft.net>2018-07-30 09:41:41 -0700
commitad13acce8dcd35cfc15281c1348beb70ca64091b (patch)
tree79091400a04991bece35ec7f9f77a16319ffdaf8 /net/tls/tls_sw.c
parentMerge branch 'TC-refactor-act_mirred-packets-re-injection' (diff)
downloadlinux-dev-ad13acce8dcd35cfc15281c1348beb70ca64091b.tar.xz
linux-dev-ad13acce8dcd35cfc15281c1348beb70ca64091b.zip
net/tls: Use socket data_ready callback on record availability
On receipt of a complete tls record, use socket's saved data_ready callback instead of state_change callback. In function tls_queue(), the TLS record is queued in encrypted state. But the decryption happen inline when tls_sw_recvmsg() or tls_sw_splice_read() get invoked. So it should be ok to notify the waiting context about the availability of data as soon as we could collect a full TLS record. For new data availability notification, sk_data_ready callback is more appropriate. It points to sock_def_readable() which wakes up specifically for EPOLLIN event. This is in contrast to the socket callback sk_state_change which points to sock_def_wakeup() which issues a wakeup unconditionally (without event mask). Signed-off-by: Vakul Garg <vakul.garg@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tls/tls_sw.c')
-rw-r--r--net/tls/tls_sw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index 6deceb7c56ba..33838f11fafa 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -1028,7 +1028,7 @@ static void tls_queue(struct strparser *strp, struct sk_buff *skb)
ctx->recv_pkt = skb;
strp_pause(strp);
- strp->sk->sk_state_change(strp->sk);
+ ctx->saved_data_ready(strp->sk);
}
static void tls_data_ready(struct sock *sk)