From: Jakub Kicinski <kuba@kernel•org>
To: davem@davemloft•net, pabeni@redhat•com
Cc: netdev@vger•kernel.org, borisp@nvidia•com,
john.fastabend@gmail•com, daniel@iogearbox•net,
vfedorenko@novek•ru, Jakub Kicinski <kuba@kernel•org>
Subject: [PATCH net-next 01/10] tls: rx: consistently use unlocked accessors for rx_list
Date: Mon, 11 Apr 2022 12:19:08 -0700 [thread overview]
Message-ID: <20220411191917.1240155-2-kuba@kernel.org> (raw)
In-Reply-To: <20220411191917.1240155-1-kuba@kernel.org>
rx_list is protected by the socket lock, no need to take
the built-in spin lock on accesses.
Signed-off-by: Jakub Kicinski <kuba@kernel•org>
---
net/tls/tls_sw.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index 2e8a896af81a..e176549216ac 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -1709,7 +1709,7 @@ static int process_rx_list(struct tls_sw_context_rx *ctx,
next_skb = skb_peek_next(skb, &ctx->rx_list);
if (!is_peek) {
- skb_unlink(skb, &ctx->rx_list);
+ __skb_unlink(skb, &ctx->rx_list);
consume_skb(skb);
}
@@ -1827,7 +1827,7 @@ int tls_sw_recvmsg(struct sock *sk,
ctx->recv_pkt = NULL;
__strp_unpause(&ctx->strp);
- skb_queue_tail(&ctx->rx_list, skb);
+ __skb_queue_tail(&ctx->rx_list, skb);
if (async) {
/* TLS 1.2-only, to_decrypt must be text length */
@@ -1848,7 +1848,7 @@ int tls_sw_recvmsg(struct sock *sk,
if (err != __SK_PASS) {
rxm->offset = rxm->offset + rxm->full_len;
rxm->full_len = 0;
- skb_unlink(skb, &ctx->rx_list);
+ __skb_unlink(skb, &ctx->rx_list);
if (err == __SK_DROP)
consume_skb(skb);
continue;
@@ -1876,7 +1876,7 @@ int tls_sw_recvmsg(struct sock *sk,
decrypted += chunk;
len -= chunk;
- skb_unlink(skb, &ctx->rx_list);
+ __skb_unlink(skb, &ctx->rx_list);
consume_skb(skb);
/* Return full control message to userspace before trying
@@ -2176,7 +2176,7 @@ void tls_sw_release_resources_rx(struct sock *sk)
if (ctx->aead_recv) {
kfree_skb(ctx->recv_pkt);
ctx->recv_pkt = NULL;
- skb_queue_purge(&ctx->rx_list);
+ __skb_queue_purge(&ctx->rx_list);
crypto_free_aead(ctx->aead_recv);
strp_stop(&ctx->strp);
/* If tls_sw_strparser_arm() was not called (cleanup paths)
--
2.34.1
next prev parent reply other threads:[~2022-04-11 19:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-11 19:19 [PATCH net-next 00/10] tls: rx: random refactoring part 3 Jakub Kicinski
2022-04-11 19:19 ` Jakub Kicinski [this message]
2022-04-11 19:19 ` [PATCH net-next 02/10] tls: rx: reuse leave_on_list label for psock Jakub Kicinski
2022-04-11 19:19 ` [PATCH net-next 03/10] tls: rx: move counting TlsDecryptErrors for sync Jakub Kicinski
2022-04-11 19:19 ` [PATCH net-next 04/10] tls: rx: don't handle TLS 1.3 in the async crypto callback Jakub Kicinski
2022-04-11 19:19 ` [PATCH net-next 05/10] tls: rx: assume crypto always calls our callback Jakub Kicinski
2022-04-11 19:19 ` [PATCH net-next 06/10] tls: rx: treat process_rx_list() errors as transient Jakub Kicinski
2022-04-11 19:19 ` [PATCH net-next 07/10] tls: rx: return the already-copied data on crypto error Jakub Kicinski
2022-04-11 19:19 ` [PATCH net-next 08/10] tls: rx: use async as an in-out argument Jakub Kicinski
2022-04-25 7:19 ` Gal Pressman
2022-04-25 14:54 ` Jakub Kicinski
2022-04-26 6:08 ` Gal Pressman
2022-04-11 19:19 ` [PATCH net-next 09/10] tls: rx: use MAX_IV_SIZE for allocations Jakub Kicinski
2022-04-11 19:19 ` [PATCH net-next 10/10] tls: rx: only copy IV from the packet for TLS 1.2 Jakub Kicinski
2022-04-13 11:00 ` [PATCH net-next 00/10] tls: rx: random refactoring part 3 patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220411191917.1240155-2-kuba@kernel.org \
--to=kuba@kernel$(echo .)org \
--cc=borisp@nvidia$(echo .)com \
--cc=daniel@iogearbox$(echo .)net \
--cc=davem@davemloft$(echo .)net \
--cc=john.fastabend@gmail$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
--cc=vfedorenko@novek$(echo .)ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox