From: Vakul Garg <vakul.garg@nxp.com>
To: netdev@vger.kernel.org
Cc: borisp@mellanox.com, davejwatson@fb.com, aviadye@mellanox.com,
davem@davemloft.net, Vakul Garg <vakul.garg@nxp.com>
Subject: [PATCH net-next 1/3] net/tls: Do not enable zero-copy prematurely
Date: Sat, 14 Jul 2018 03:52:28 +0530 [thread overview]
Message-ID: <20180713222230.17949-1-vakul.garg@nxp.com> (raw)
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
next reply other threads:[~2018-07-13 17:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-13 22:22 Vakul Garg [this message]
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
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=20180713222230.17949-1-vakul.garg@nxp.com \
--to=vakul.garg@nxp.com \
--cc=aviadye@mellanox.com \
--cc=borisp@mellanox.com \
--cc=davejwatson@fb.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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