tls: rx: don't consider sock_rcvtimeo() cumulative
authorJakub Kicinski <kuba@kernel.org>
Wed, 27 Jul 2022 03:15:22 +0000 (20:15 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 29 Jul 2022 04:49:59 +0000 (21:49 -0700)
commit70f03fc2fc142d8c18e891dfa55ae8c5579f1e82
tree8ea900e156f95dfafcb37fd817a7730b9b3cc6da
parent86c591fb9142e772d3ba26b601f4a49123e7079c
tls: rx: don't consider sock_rcvtimeo() cumulative

Eric indicates that restarting rcvtimeo on every wait may be fine.
I thought that we should consider it cumulative, and made
tls_rx_reader_lock() return the remaining timeo after acquiring
the reader lock.

tls_rx_rec_wait() gets its timeout passed in by value so it
does not keep track of time previously spent.

Make the lock waiting consistent with tls_rx_rec_wait() - don't
keep track of time spent.

Read the timeo fresh in tls_rx_rec_wait().
It's unclear to me why callers are supposed to cache the value.

Link: https://lore.kernel.org/all/CANn89iKcmSfWgvZjzNGbsrndmCch2HC_EPZ7qmGboDNaWoviNQ@mail.gmail.com/
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/tls/tls_sw.c