From: Dave Watson <davejwatson@fb.com>
To: Atul Gupta <atul.gupta@chelsio.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
"herbert@gondor.apana.org.au" <herbert@gondor.apana.org.au>,
"sd@queasysnail.net" <sd@queasysnail.net>,
"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Ganesh GR <ganeshgr@chelsio.com>
Subject: Re: [Crypto v7 03/12] tls: support for inline tls
Date: Fri, 23 Feb 2018 09:32:52 -0800 [thread overview]
Message-ID: <20180223173252.GA91653@davejwatson-mba> (raw)
In-Reply-To: <CY4PR1201MB023019CF5E1D47CA9D136B4797CC0@CY4PR1201MB0230.namprd12.prod.outlook.com>
On 02/23/18 04:58 PM, Atul Gupta wrote:
> > 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.
>
> code enters do_tls_setsockopt_tx only for those offload capable dev which does not define FULL_HW setsockopt as done by chtls, unhash prot update is required for cleanup/revert of setup done in tls_hw_hash. This update does not impact SW or other Inline HW path.
I still don't follow. If it doesn't impact SW, then what is it doing?
According to the comment, we're moving to SW tx, where sk_prot will be
&tls_prot[TLS_SW_TX], and the unhash function you set here in
TLS_BASE_TX won't be called.
next prev parent reply other threads:[~2018-02-23 17:33 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
2018-02-23 16:58 ` Atul Gupta
2018-02-23 17:32 ` Dave Watson [this message]
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=20180223173252.GA91653@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