All of lore.kernel.org
 help / color / mirror / Atom feed
From: Haren Myneni <haren@linux.vnet.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Dan Streetman <ddstreet@ieee.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	Michael Neuling <mikey@neuling.org>,
	suka@us.ibm.com, Ram Pai <linuxram@us.ibm.com>,
	npiggin@gmail.com, Haren Myneni <hbabu@us.ibm.com>
Subject: Re: [PATCH V3 6/6] crypto/nx: Add P9 NX support for 842 compression engine
Date: Fri, 01 Sep 2017 20:27:47 -0700	[thread overview]
Message-ID: <59AA2533.1010702@linux.vnet.ibm.com> (raw)
In-Reply-To: <87bmmu64if.fsf@concordia.ellerman.id.au>

On 09/01/2017 04:29 AM, Michael Ellerman wrote:
> Hi Dan,
> 
> Thanks for reviewing this series.
> 
> Dan Streetman <ddstreet@ieee.org> writes:
>> On Tue, Aug 29, 2017 at 5:54 PM, Haren Myneni <haren@linux.vnet.ibm.com> wrote:
>>> On 08/29/2017 02:23 PM, Benjamin Herrenschmidt wrote:
>>>> On Tue, 2017-08-29 at 09:58 -0400, Dan Streetman wrote:
>>>>>> +
>>>>>> +       ret = -EINVAL;
>>>>>> +       if (coproc && coproc->vas.rxwin) {
>>>>>> +               wmem->txwin = nx842_alloc_txwin(coproc);
>>>>>
>>>>> this is wrong.  the workmem is scratch memory that's valid only for
>>>>> the duration of a single operation.
>>>
>>> Correct, workmem is used until crypto_free is called.
>>
>> that's not a 'single operation'.  a single operation is compress() or
>> decompress().
>>
>>>>>
>>>>> do you actually need a txwin per crypto transform?  or do you need a
>>>>> txwin per coprocessor?  or txwin per processor?  either per-coproc or
>>>>> per-cpu should be created at driver init and held separately
>>>>> (globally) instead of a per-transform txwin.  I really don't see why
>>>>> you would need a txwin per transform, because the coproc should not
>>>>> care how many different transforms there are.
>>>>
>>>> We should only need a single window for the whole kernel really, plus
>>>> one per user process who wants direct access but that's not relevant
>>>> here.
>>>
>>> Opening send window for each crypto transform (crypto_alloc,
>>> compression/decompression, ..., crypto_free) so that does not
>>> have to wait for the previous copy/paste complete.
>>> VAS will map send and receive windows, and can cache in send
>>> windows (up to 128). So I thought using the same send window
>>> (per chip) for more requests (say 1000) may be adding overhead.
>>>
>>> I will make changes if you prefer using 1 send window per chip.
>>
>> i don't have the spec, so i shouldn't be making the decision on it,
>> but i do know putting a persistent field into the workmem is the wrong
>> location.  If it's valid for the life of the transform, put it into
>> the transform context.  The workmem buffer is intended to be used only
>> during a single operation - it's "working memory" to perform each
>> individual crypto transformation.
> 
> I agree workmem isn't the right place for the txwin. But I don't believe
> it actually breaks anything to put txwin there.
> 
> So for now I'm going to merge this series as-is and I've asked Haren to
> send fixes as soon as he can to clean it up.

I will move txwin to nx842_crypto_ctx and send patch soon.  Even though nx842_crypto_ctx is also used for pseries, we can ignore txwin. 

Thanks
Haren


> 
> cheers
> 

  reply	other threads:[~2017-09-02  3:28 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-22  5:01 [PATCH V3 6/6] crypto/nx: Add P9 NX support for 842 compression engine Haren Myneni
2017-07-24 16:46 ` Ram Pai
2017-08-28 23:25 ` Michael Ellerman
2017-08-29 13:32   ` Dan Streetman
2017-08-31  7:44     ` Haren Myneni
2017-08-31 13:40       ` Dan Streetman
2017-08-31 19:03         ` Haren Myneni
2017-09-01 11:34       ` Michael Ellerman
2017-09-02  4:11         ` Haren Myneni
2017-08-29  6:30 ` Sukadev Bhattiprolu
2017-08-29 13:58 ` Dan Streetman
2017-08-29 21:23   ` Benjamin Herrenschmidt
2017-08-29 21:54     ` Haren Myneni
2017-08-29 21:57       ` Benjamin Herrenschmidt
2017-08-30  1:02         ` Haren Myneni
2017-08-31 13:31       ` Dan Streetman
2017-08-31 19:09         ` Haren Myneni
2017-09-01 11:29         ` Michael Ellerman
2017-09-02  3:27           ` Haren Myneni [this message]
2017-09-02 16:14           ` Dan Streetman
2017-09-02  8:40   ` Haren Myneni
2017-09-02 13:42     ` Michael Neuling
2017-09-02 13:42       ` Michael Neuling
2017-09-02 16:17     ` Dan Streetman
2017-09-02 16:17       ` Dan Streetman
2017-09-03  8:32       ` Haren Myneni
2017-09-03 14:12         ` Dan Streetman
2017-09-03 14:12           ` Dan Streetman

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=59AA2533.1010702@linux.vnet.ibm.com \
    --to=haren@linux.vnet.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=ddstreet@ieee.org \
    --cc=hbabu@us.ibm.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=linuxram@us.ibm.com \
    --cc=mikey@neuling.org \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=suka@us.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.