Message ID | 20240207011824.2609030-8-kuba@kernel.org (mailing list archive) |
---|---|
State | Accepted |
Commit | ac437a51ce662364062f704e321227f6728e6adc |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: tls: fix some issues with async encryption | expand |
On Tue, Feb 06, 2024 at 05:18:24PM -0800, Jakub Kicinski wrote: > We double count async, non-zc rx data. The previous fix was > lucky because if we fully zc async_copy_bytes is 0 so we add 0. > Decrypted already has all the bytes we handled, in all cases. > We don't have to adjust anything, delete the erroneous line. > > Fixes: 4d42cd6bc2ac ("tls: rx: fix return value for async crypto") > Co-developed-by: Sabrina Dubroca <sd@queasysnail.net> > Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> > Signed-off-by: Jakub Kicinski <kuba@kernel.org> Reviewed-by: Simon Horman <horms@kernel.org>
2024-02-06, 17:18:24 -0800, Jakub Kicinski wrote: > We double count async, non-zc rx data. The previous fix was > lucky because if we fully zc async_copy_bytes is 0 so we add 0. > Decrypted already has all the bytes we handled, in all cases. > We don't have to adjust anything, delete the erroneous line. I had an adjustment there which I thought was necessary, but I can't remember why, so let's go with this. Possibly had to do with partial async cases, since I also played with a hack to only go async for every other request (or every N requests).
On Sat, 10 Feb 2024 10:02:07 +0100 Sabrina Dubroca wrote: > 2024-02-06, 17:18:24 -0800, Jakub Kicinski wrote: > > We double count async, non-zc rx data. The previous fix was > > lucky because if we fully zc async_copy_bytes is 0 so we add 0. > > Decrypted already has all the bytes we handled, in all cases. > > We don't have to adjust anything, delete the erroneous line. > > I had an adjustment there which I thought was necessary, but I can't > remember why, so let's go with this. > > Possibly had to do with partial async cases, since I also played with > a hack to only go async for every other request (or every N requests). I must have seen some reason to keep it back in 4d42cd6bc2ac as well :S Let's see if someone complains..
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c index a6eff21ade23..9fbc70200cd0 100644 --- a/net/tls/tls_sw.c +++ b/net/tls/tls_sw.c @@ -2132,7 +2132,6 @@ int tls_sw_recvmsg(struct sock *sk, else err = process_rx_list(ctx, msg, &control, 0, async_copy_bytes, is_peek); - decrypted += max(err, 0); } copied += decrypted;