* [PATCH net-next 1/3] net/tls: Do not enable zero-copy prematurely
@ 2018-07-13 22:22 Vakul Garg
2018-07-13 22:22 ` [PATCH net-next 2/3] net/tls: Use socket data_ready callback on record availability Vakul Garg
2018-07-13 22:22 ` [PATCH net-next 3/3] net/tls: Remove redundant variable assignments and wakeup Vakul Garg
0 siblings, 2 replies; 3+ messages in thread
From: Vakul Garg @ 2018-07-13 22:22 UTC (permalink / raw)
To: netdev; +Cc: borisp, davejwatson, aviadye, davem, Vakul Garg
Zero-copy mode was left enabled even when zerocopy_from_iter() failed.
Set the zero-copy mode only when zerocopy_from_iter() succeeds.
Signed-off-by: Vakul Garg <vakul.garg@nxp.com>
---
net/tls/tls_sw.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index 7453f5ae0819..d31dc2487488 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -800,7 +800,6 @@ int tls_sw_recvmsg(struct sock *sk,
struct scatterlist sgin[MAX_SKB_FRAGS + 1];
int pages = 0;
- zc = true;
sg_init_table(sgin, MAX_SKB_FRAGS + 1);
sg_set_buf(&sgin[0], ctx->rx_aad_plaintext,
TLS_AAD_SPACE_SIZE);
@@ -811,6 +810,8 @@ int tls_sw_recvmsg(struct sock *sk,
MAX_SKB_FRAGS, false);
if (err < 0)
goto fallback_to_reg_recv;
+ else
+ zc = true;
err = decrypt_skb(sk, skb, sgin);
for (; pages > 0; pages--)
--
2.13.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH net-next 2/3] net/tls: Use socket data_ready callback on record availability
2018-07-13 22:22 [PATCH net-next 1/3] net/tls: Do not enable zero-copy prematurely Vakul Garg
@ 2018-07-13 22:22 ` Vakul Garg
2018-07-13 22:22 ` [PATCH net-next 3/3] net/tls: Remove redundant variable assignments and wakeup Vakul Garg
1 sibling, 0 replies; 3+ messages in thread
From: Vakul Garg @ 2018-07-13 22:22 UTC (permalink / raw)
To: netdev; +Cc: borisp, davejwatson, aviadye, davem, Vakul Garg
On receipt of a complete tls record, use socket's saved data_ready
callback instead of state_change callback.
Signed-off-by: Vakul Garg <vakul.garg@nxp.com>
---
net/tls/tls_sw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index d31dc2487488..a184c70ee0ac 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -1000,7 +1000,7 @@ static void tls_queue(struct strparser *strp, struct sk_buff *skb)
ctx->recv_pkt = skb;
strp_pause(strp);
- strp->sk->sk_state_change(strp->sk);
+ ctx->saved_data_ready(strp->sk);
}
static void tls_data_ready(struct sock *sk)
--
2.13.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH net-next 3/3] net/tls: Remove redundant variable assignments and wakeup
2018-07-13 22:22 [PATCH net-next 1/3] net/tls: Do not enable zero-copy prematurely Vakul Garg
2018-07-13 22:22 ` [PATCH net-next 2/3] net/tls: Use socket data_ready callback on record availability Vakul Garg
@ 2018-07-13 22:22 ` Vakul Garg
1 sibling, 0 replies; 3+ messages in thread
From: Vakul Garg @ 2018-07-13 22:22 UTC (permalink / raw)
To: netdev; +Cc: borisp, davejwatson, aviadye, davem, Vakul Garg
In function tls_do_decryption(), the assignment to tls receive context'
variable 'decrypted' is redundant as the same is being done in function
tls_recvmsg() after calling decrypt_skb(). Also calling callback
function to wakeup processes sleeping on socket data availability is
useless as tls_do_decryption() is invoked from user processes only. This
patch cleans these up.
Signed-off-by: Vakul Garg <vakul.garg@nxp.com>
---
net/tls/tls_sw.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index a184c70ee0ac..a53fdcc33e31 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -78,10 +78,6 @@ static int tls_do_decryption(struct sock *sk,
rxm->full_len -= tls_ctx->rx.overhead_size;
tls_advance_record_sn(sk, &tls_ctx->rx);
- ctx->decrypted = true;
-
- ctx->saved_data_ready(sk);
-
out:
aead_request_free(aead_req);
return ret;
--
2.13.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-07-13 17:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-13 22:22 [PATCH net-next 1/3] net/tls: Do not enable zero-copy prematurely Vakul Garg
2018-07-13 22:22 ` [PATCH net-next 2/3] net/tls: Use socket data_ready callback on record availability Vakul Garg
2018-07-13 22:22 ` [PATCH net-next 3/3] net/tls: Remove redundant variable assignments and wakeup Vakul Garg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox