net/tls: Use socket data_ready callback on record availability
authorVakul Garg <vakul.garg@nxp.com>
Mon, 30 Jul 2018 10:38:33 +0000 (16:08 +0530)
committerDavid S. Miller <davem@davemloft.net>
Mon, 30 Jul 2018 16:41:41 +0000 (09:41 -0700)
commitad13acce8dcd35cfc15281c1348beb70ca64091b
tree79091400a04991bece35ec7f9f77a16319ffdaf8
parent8f3f6500c74935bfe5a9067e3106b806f336facf
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>
net/tls/tls_sw.c