[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191003181859.24958-4-jakub.kicinski@netronome.com>
Date: Thu, 3 Oct 2019 11:18:56 -0700
From: Jakub Kicinski <jakub.kicinski@...ronome.com>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org, oss-drivers@...ronome.com,
davejwatson@...com, borisp@...lanox.com, aviadye@...lanox.com,
john.fastabend@...il.com, daniel@...earbox.net,
atul.gupta@...lsio.com,
Jakub Kicinski <jakub.kicinski@...ronome.com>,
John Hurley <john.hurley@...ronome.com>,
Simon Horman <simon.horman@...ronome.com>
Subject: [PATCH net-next 3/6] net/tls: move tls_build_proto() on init path
Move tls_build_proto() so that TOE offload doesn't have to call it
mid way through its bypass enable path.
Signed-off-by: Jakub Kicinski <jakub.kicinski@...ronome.com>
Reviewed-by: John Hurley <john.hurley@...ronome.com>
Reviewed-by: Simon Horman <simon.horman@...ronome.com>
---
net/tls/tls_main.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c
index a1203807a3ef..7bc2ad26316f 100644
--- a/net/tls/tls_main.c
+++ b/net/tls/tls_main.c
@@ -668,14 +668,11 @@ static int tls_hw_prot(struct sock *sk)
if (!ctx)
goto out;
- spin_unlock_bh(&device_spinlock);
- tls_build_proto(sk);
ctx->sk_destruct = sk->sk_destruct;
sk->sk_destruct = tls_hw_sk_destruct;
ctx->rx_conf = TLS_HW_RECORD;
ctx->tx_conf = TLS_HW_RECORD;
update_sk_prot(sk, ctx);
- spin_lock_bh(&device_spinlock);
rc = 1;
break;
}
@@ -776,6 +773,8 @@ static int tls_init(struct sock *sk)
struct tls_context *ctx;
int rc = 0;
+ tls_build_proto(sk);
+
if (tls_hw_prot(sk))
return 0;
@@ -788,8 +787,6 @@ static int tls_init(struct sock *sk)
if (sk->sk_state != TCP_ESTABLISHED)
return -ENOTSUPP;
- tls_build_proto(sk);
-
/* allocate tls context */
write_lock_bh(&sk->sk_callback_lock);
ctx = create_ctx(sk);
--
2.21.0
Powered by blists - more mailing lists