Re: [PATCH net 1/5] net: tls: handle -EBUSY on async encrypt/decrypt requests
flat view
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: 2023-09-12 04:43:37
On Fri, Sep 08, 2023 at 05:55:59PM +0200, Sabrina Dubroca wrote:
Uh, ok, I didn't know that, thanks for explaining. When I was fixing this code I couldn't find a mention of what the expectations for MAY_BACKLOG are. Could you add a comment describing this in the headers (either for #define CRYPTO_TFM_REQ_MAY_BACKLOG or aead_request_set_callback, wherever is more appropriate). MAY_BACKLOG is used by both tls and tipc (talking only about networking) and neither seem to respect this need to back off.
Patches are welcome :) A bit of history: at the beginning we always dropped requests that we couldn't queue because the only user was IPsec so this is the expected behaviour. When storage crypto support was added there was a need for reliable handling of resource constraints so that's why MAY_BACKLOG was added. However, the expectation is obviously that you must stop sending new requests once you run into the resource constraint.
Jakub, I guess we should drop the CRYPTO_TFM_REQ_MAY_BACKLOG for net, and maybe consider adding it back (with the back off) in net-next. Probably not urgent considering that nobody seems to have run into this bug so far.
I think that would be the prudent action. Thanks, -- Email: Herbert Xu [off-list ref] Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt