From: Corentin Labbe <clabbe.montjoie@gmail.com>
To: Kalyani Akula <kalyania@xilinx.com>
Cc: "herbert@gondor.apana.org.au" <herbert@gondor.apana.org.au>,
"kstewart@linuxfoundation.org" <kstewart@linuxfoundation.org>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"pombredanne@nexb.com" <pombredanne@nexb.com>,
"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Sarat Chand Savitala <saratcha@xilinx.com>
Subject: Re: [RFC PATCH V3 0/4] Add Xilinx's ZynqMP SHA3 driver support
Date: Thu, 2 May 2019 18:38:21 +0200 [thread overview]
Message-ID: <20190502163821.GA22561@Red> (raw)
In-Reply-To: <BN7PR02MB512413C534A8EFA925105441AF340@BN7PR02MB5124.namprd02.prod.outlook.com>
On Thu, May 02, 2019 at 03:12:55PM +0000, Kalyani Akula wrote:
> Hi Corentin,
>
> Please find my response inline.
>
> > -----Original Message-----
> > From: Corentin Labbe <clabbe.montjoie@gmail.com>
> > Sent: Thursday, May 2, 2019 5:30 PM
> > To: Kalyani Akula <kalyania@xilinx.com>
> > Cc: herbert@gondor.apana.org.au; kstewart@linuxfoundation.org;
> > gregkh@linuxfoundation.org; tglx@linutronix.de; pombredanne@nexb.com;
> > linux-crypto@vger.kernel.org; linux-kernel@vger.kernel.org;
> > netdev@vger.kernel.org; Sarat Chand Savitala <saratcha@xilinx.com>; Kalyani
> > Akula <kalyania@xilinx.com>
> > Subject: Re: [RFC PATCH V3 0/4] Add Xilinx's ZynqMP SHA3 driver support
> >
> > On Thu, May 02, 2019 at 04:04:38PM +0530, Kalyani Akula wrote:
> > > This patch set adds support for
> > > - dt-binding docs for Xilinx ZynqMP SHA3 driver
> > > - Adds communication layer support for sha_hash in zynqmp.c
> > > - Adds Xilinx ZynqMP driver for SHA3 Algorithm
> > > - Adds device tree node for ZynqMP SHA3 driver
> > >
> > > V3 Changes :
> > > - Removed zynqmp_sha_import and export APIs.The reason as follows The
> > > user space code does an accept on an already accepted FD when we
> > > create AF_ALG socket and call accept on it, it calls af_alg_accept and
> > > not hash_accept.
> > > import and export APIs are called from hash_accept.
> > > The flow is as below
> > > accept--> af_alg_accept-->hash_accept_parent-->hash_accept_parent_noke
> > > accept--> y
> > > for hash salg_type.
> > > - Resolved comments from
> > > https://patchwork.kernel.org/patch/10753719/
> > >
> >
> >
> > Your driver still doesnt handle the case where two hash are done in parallel.
> >
>
> Our Firmware uses IPI protocol to send this SHA3 requests to SHA3 HW engine, which doesn't support parallel processing of 2 hash requests.
> The flow is
> SHA3 request from App -> SHA3 driver-> ZynqMp driver-> Firmware (which doesn't support parallel processing of 2 requests) -> SHA3 HW Engine
>
>
So your driver will just send bad result in that case.
You need to export and store the intermediate result in a request context.
> > Furthermore, you miss the export/import functions.
> >
>
> When user space code does an accept on an already accepted FD as below
> sockfd = socket(AF_ALG, SOCK_SEQPACKET, 0);
> bind(sockfd, (struct sockaddr *)&sa, sizeof(sa));
> fd = accept(sockfd, NULL, 0);
>
> where my sockaddr is
> struct sockaddr_alg sa = {
> .salg_family = AF_ALG,
> .salg_type = "hash",
> .salg_name = "xilinx-sha3-384"
> };
>
> Upon calling accept the flow in the kernel is as mentioned
> accept--> af_alg_accept-->hash_accept_parent-->hash_accept_parent_nokey
> for hash salg_type.
>
> And where import and export functions are called from hash_accept. hence, these functions never be called from the application.
> So, I removed those from the driver.
>
> Regards
> Kalyani.
>
Handling your own worflow is not enough.
You need to support two client doing multiple update in parallel.
It seems that your driver is bugged in that case.
Furthermore, i am pretty sure that export and import are mandatory, and without them self-test should fail.
Do you have self test enabled and tryed to load the tcrypt module ?
Regards
prev parent reply other threads:[~2019-05-02 16:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-02 10:34 [RFC PATCH V3 0/4] Add Xilinx's ZynqMP SHA3 driver support Kalyani Akula
2019-05-02 10:34 ` [RFC PATCH V3 1/4] dt-bindings: crypto: Add bindings for ZynqMP SHA3 driver Kalyani Akula
2019-05-02 10:34 ` [RFC PATCH V3 2/4] firmware: xilinx: Add ZynqMP sha_hash API for SHA3 functionality Kalyani Akula
2019-05-02 10:34 ` [RFC PATCH V3 3/4] crypto: Add Xilinx SHA3 driver Kalyani Akula
2019-05-02 10:34 ` [RFC PATCH V3 4/4] ARM64: zynqmp: Add Xilinix SHA-384 node Kalyani Akula
2019-05-02 12:00 ` [RFC PATCH V3 0/4] Add Xilinx's ZynqMP SHA3 driver support Corentin Labbe
2019-05-02 15:12 ` Kalyani Akula
2019-05-02 16:38 ` Corentin Labbe [this message]
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=20190502163821.GA22561@Red \
--to=clabbe.montjoie@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=herbert@gondor.apana.org.au \
--cc=kalyania@xilinx.com \
--cc=kstewart@linuxfoundation.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pombredanne@nexb.com \
--cc=saratcha@xilinx.com \
--cc=tglx@linutronix.de \
/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.