From: Dave Watson <davejwatson@fb.com>
To: Atul Gupta <atul.gupta@chelsio.com>
Cc: <davem@davemloft.net>, <herbert@gondor.apana.org.au>,
<sd@queasysnail.net>, <linux-crypto@vger.kernel.org>,
<netdev@vger.kernel.org>, <ganeshgr@chelsio.com>
Subject: Re: [Crypto v7 03/12] tls: support for inline tls
Date: Fri, 23 Feb 2018 08:23:13 -0800 [thread overview]
Message-ID: <20180223162313.GA82586@davejwatson-mba> (raw)
In-Reply-To: <1519321890-22919-1-git-send-email-atul.gupta@chelsio.com>
On 02/22/18 11:21 PM, Atul Gupta wrote:
> @@ -403,6 +431,15 @@ static int do_tls_setsockopt_tx(struct sock *sk, char __user *optval,
> goto err_crypto_info;
> }
>
> + rc = tls_offload_dev_absent(sk);
> + if (rc == -EINVAL) {
> + goto out;
> + } else if (rc == -EEXIST) {
> + /* Retain HW unhash for cleanup and move to SW Tx */
> + sk->sk_prot[TLS_BASE_TX].unhash =
> + sk->sk_prot[TLS_FULL_HW].unhash;
I'm still confused by this, it lookes like it is modifying the global
tls_prots without taking a lock? And modifying it for all sockets,
not just this one? One way to fix might be to always set an unhash in
TLS_BASE_TX, and then have a function pointer unhash in ctx.
> +static void tls_hw_unhash(struct sock *sk)
> +{
> + struct tls_device *dev;
> +
> + mutex_lock(&device_mutex);
> + list_for_each_entry(dev, &device_list, dev_list) {
> + if (dev->unhash)
> + dev->unhash(dev, sk);
> + }
> + mutex_unlock(&device_mutex);
> + sk->sk_prot->unhash(sk);
I would have thought unhash() here was tls_hw_unhash, doesn't the
original callback need to be saved like the other ones
(set/getsockopt, etc) in tls_init? Similar for hash().
It looks like in patch 11 you directly call tcp_prot.hash/unhash, so
it doesn't have this issue.
next prev parent reply other threads:[~2018-02-23 16:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-22 17:51 [Crypto v7 03/12] tls: support for inline tls Atul Gupta
2018-02-23 16:23 ` Dave Watson [this message]
2018-02-23 16:58 ` Atul Gupta
2018-02-23 17:32 ` Dave Watson
2018-02-24 11:34 ` Atul Gupta
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=20180223162313.GA82586@davejwatson-mba \
--to=davejwatson@fb.com \
--cc=atul.gupta@chelsio.com \
--cc=davem@davemloft.net \
--cc=ganeshgr@chelsio.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sd@queasysnail.net \
/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;
as well as URLs for NNTP newsgroup(s).