<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 31, 2017 at 3:31 PM, Harsh Jain <span dir="ltr"><<a href="mailto:harshjain.prof@gmail.com" target="_blank">harshjain.prof@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">HI Gilad,<br>
<br>
I think we need an update in ESP also. Now EBUSY return means driver<br>
has accepted, Packet should not be dropped in<br>
<br>
esp_output_tail() function.<br>
<br><br></blockquote><div><br></div><div>Good catch. You are right and the same holds true for ah_output() in ah4.c.</div><div><br></div><div>But I do wonder, the code there now treats -EBUSY as a special case and returns NET_XMIT_DROP</div><div>but if an AEAD or AHASH transformation return some other error, like -ENOMEM or -EINVAL shouldn't</div><div>we return NET_XMIT_DROP in that case too? </div><div><br></div><div>Any ideas?</div><div><br></div><div>Gilad</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-HOEnZb"><div class="gmail-h5"><br>
<br>
<br>
On Thu, Aug 24, 2017 at 7:48 PM, Gilad Ben-Yossef <<a href="mailto:gilad@benyossef.com">gilad@benyossef.com</a>> wrote:<br>
> Many users of kernel async. crypto services have a pattern of<br>
> starting an async. crypto op and than using a completion<br>
> to wait for it to end.<br>
><br>
> This patch set simplifies this common use case in two ways:<br>
><br>
> First, by separating the return codes of the case where a<br>
> request is queued to a backlog due to the provider being<br>
> busy (-EBUSY) from the case the request has failed due<br>
> to the provider being busy and backlogging is not enabled<br>
> (-EAGAIN).<br>
><br>
> Next, this change is than built on to create a generic API<br>
> to wait for a async. crypto operation to complete.<br>
><br>
> The end result is a smaller code base and an API that is<br>
> easier to use and more difficult to get wrong.<br>
><br>
> The patch set was boot tested on x86_64 and arm64 which<br>
> at the very least tests the crypto users via testmgr and<br>
> tcrypt but I do note that I do not have access to some<br>
> of the HW whose drivers are modified nor do I claim I was<br>
> able to test all of the corner cases.<br>
><br>
> The patch set is based upon linux-next release tagged<br>
> next-20170824.<br>
><br>
> Changes from v6:<br>
> - Fix brown paper bag compile error on marvell/cesa<br>
>   code.<br>
><br>
> Changes from v5:<br>
> - Remove redundant new line as spotted by Jonathan<br>
>   Cameron.<br>
> - Reworded dm-verity change commit message to better<br>
>   clarify potential issue averted by change as<br>
>   pointed out by Mikulas Patocka.<br>
><br>
> Changes from v4:<br>
> - Rebase on top of latest algif changes from Stephan<br>
>   Mueller.<br>
> - Fix typo in ccp patch title.<br>
><br>
> Changes from v3:<br>
> - Instead of changing the return code to indicate<br>
>   backlog queueing, change the return code to indicate<br>
>   transient busy state, as suggested by Herbert Xu.<br>
><br>
> Changes from v2:<br>
> - Patch title changed from "introduce crypto wait for<br>
>   async op" to better reflect the current state.<br>
> - Rebase on top of latest linux-next.<br>
> - Add a new return code of -EIOCBQUEUED for backlog<br>
>   queueing, as suggested by Herbert Xu.<br>
> - Transform more users to the new API.<br>
> - Update the drbg change to account for new init as<br>
>   indicated by Stephan Muller.<br>
><br>
> Changes from v1:<br>
> - Address review comments from Eric Biggers.<br>
> - Separated out bug fixes of existing code and rebase<br>
>   on top of that patch set.<br>
> - Rename 'ecr' to 'wait' in fscrypto code.<br>
> - Split patch introducing the new API from the change<br>
>   moving over the algif code which it originated from<br>
>   to the new API.<br>
> - Inline crypto_wait_req().<br>
> - Some code indentation fixes.<br>
><br>
> Gilad Ben-Yossef (19):<br>
>   crypto: change transient busy return code to -EAGAIN<br>
>   crypto: ccp: use -EAGAIN for transient busy indication<br>
>   crypto: remove redundant backlog checks on EBUSY<br>
>   crypto: marvell/cesa: remove redundant backlog checks on EBUSY<br>
>   crypto: introduce crypto wait for async op<br>
>   crypto: move algif to generic async completion<br>
>   crypto: move pub key to generic async completion<br>
>   crypto: move drbg to generic async completion<br>
>   crypto: move gcm to generic async completion<br>
>   crypto: move testmgr to generic async completion<br>
>   fscrypt: move to generic async completion<br>
>   dm: move dm-verity to generic async completion<br>
>   cifs: move to generic async completion<br>
>   ima: move to generic async completion<br>
>   crypto: tcrypt: move to generic async completion<br>
>   crypto: talitos: move to generic async completion<br>
>   crypto: qce: move to generic async completion<br>
>   crypto: mediatek: move to generic async completion<br>
>   crypto: adapt api sample to use async. op wait<br>
><br>
>  Documentation/crypto/api-<wbr>samples.rst |  52 ++-------<br>
>  crypto/af_alg.c                      |  27 -----<br>
>  crypto/ahash.c                       |  12 +--<br>
>  crypto/algapi.c                      |   6 +-<br>
>  crypto/algif_aead.c                  |   8 +-<br>
>  crypto/algif_hash.c                  |  50 +++++----<br>
>  crypto/algif_skcipher.c              |   9 +-<br>
>  crypto/api.c                         |  13 +++<br>
>  crypto/asymmetric_keys/public_<wbr>key.c  |  28 +----<br>
>  crypto/cryptd.c                      |   4 +-<br>
>  crypto/cts.c                         |   6 +-<br>
>  crypto/drbg.c                        |  36 ++-----<br>
>  crypto/gcm.c                         |  32 ++----<br>
>  crypto/lrw.c                         |   8 +-<br>
>  crypto/rsa-pkcs1pad.c                |  16 +--<br>
>  crypto/tcrypt.c                      |  84 +++++----------<br>
>  crypto/testmgr.c                     | 204 ++++++++++++------------------<wbr>-----<br>
>  crypto/xts.c                         |   8 +-<br>
>  drivers/crypto/ccp/ccp-crypto-<wbr>main.c |   8 +-<br>
>  drivers/crypto/ccp/ccp-dev.c         |   7 +-<br>
>  drivers/crypto/marvell/cesa.c        |   3 +-<br>
>  drivers/crypto/marvell/cesa.h        |   2 +-<br>
>  drivers/crypto/mediatek/mtk-<wbr>aes.c    |  31 +-----<br>
>  drivers/crypto/qce/sha.c             |  30 +-----<br>
>  drivers/crypto/talitos.c             |  38 +------<br>
>  drivers/md/dm-verity-target.c        |  81 ++++----------<br>
>  drivers/md/dm-verity.h               |   5 -<br>
>  fs/cifs/smb2ops.c                    |  30 +-----<br>
>  fs/crypto/crypto.c                   |  28 +----<br>
>  fs/crypto/fname.c                    |  36 ++-----<br>
>  fs/crypto/fscrypt_private.h          |  10 --<br>
>  fs/crypto/keyinfo.c                  |  21 +---<br>
>  include/crypto/drbg.h                |   3 +-<br>
>  include/crypto/if_alg.h              |  15 +--<br>
>  include/linux/crypto.h               |  40 +++++++<br>
>  security/integrity/ima/ima_<wbr>crypto.c  |  56 +++-------<br>
>  36 files changed, 310 insertions(+), 737 deletions(-)<br>
><br>
> --<br>
> 2.1.4<br>
><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Gilad Ben-Yossef<br>Chief Coffee Drinker<br><br>"If you take a class in large-scale robotics, can you end up in a situation where the homework eats your dog?"<br> -- Jean-Baptiste Queru</div>
</div></div>