Skip to content

Commit ad13acc

Browse files
nxa22042davem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8f3f650 commit ad13acc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/tls/tls_sw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ static void tls_queue(struct strparser *strp, struct sk_buff *skb)
10281028
ctx->recv_pkt = skb;
10291029
strp_pause(strp);
10301030

1031-
strp->sk->sk_state_change(strp->sk);
1031+
ctx->saved_data_ready(strp->sk);
10321032
}
10331033

10341034
static void tls_data_ready(struct sock *sk)

0 commit comments

Comments
 (0)