diff mbox

[dpdk-dev,v2,01/12] mk: fix build of assembly files for ARM64

Message ID 1481077985-4224-2-git-send-email-zbigniew.bodek@caviumnetworks.com (mailing list archive)
State Changes Requested, archived
Delegated to: Pablo de Lara Guarch
Headers show

Checks

Context Check Description
checkpatch/checkpatch success coding style OK

Commit Message

zbigniew.bodek@caviumnetworks.com Dec. 7, 2016, 2:32 a.m. UTC
From: Zbigniew Bodek <zbigniew.bodek@caviumnetworks.com>

Avoid using incorrect assembler (nasm) and unsupported flags
when building for ARM64.

Signed-off-by: Zbigniew Bodek <zbigniew.bodek@caviumnetworks.com>
---
 mk/arch/arm64/rte.vars.mk    | 1 -
 mk/toolchain/gcc/rte.vars.mk | 6 ++++--
 2 files changed, 4 insertions(+), 3 deletions(-)

Comments

Pablo de Lara Dec. 21, 2016, 2:46 p.m. UTC | #1
Hi Zbigniew,

> -----Original Message-----
> From: zbigniew.bodek@caviumnetworks.com
> [mailto:zbigniew.bodek@caviumnetworks.com]
> Sent: Wednesday, December 07, 2016 2:33 AM
> To: De Lara Guarch, Pablo; jerin.jacob@caviumnetworks.com
> Cc: dev@dpdk.org; Zbigniew Bodek
> Subject: [PATCH v2 01/12] mk: fix build of assembly files for ARM64
> 
> From: Zbigniew Bodek <zbigniew.bodek@caviumnetworks.com>
> 
> Avoid using incorrect assembler (nasm) and unsupported flags
> when building for ARM64.
> 
> Signed-off-by: Zbigniew Bodek <zbigniew.bodek@caviumnetworks.com>

If this is a fix, you should include a "Fixes" line and CC the stable tree list.
zbigniew.bodek@caviumnetworks.com Jan. 4, 2017, 5:33 p.m. UTC | #2
From: Zbigniew Bodek <zbigniew.bodek@caviumnetworks.com>

Introduce crypto poll mode driver using ARMv8
cryptographic extensions. This PMD is optimized
to provide performance boost for chained
crypto operations processing, such as:
* encryption + HMAC generation
* decryption + HMAC validation.
In particular, cipher only or hash only
operations are not provided.
Performance gain can be observed in tests
against OpenSSL PMD which also uses ARM
crypto extensions for packets processing.

Exemplary crypto performance tests comparison:

cipher_hash. cipher algo: AES_CBC
auth algo: SHA1_HMAC cipher key size=16.
burst_size: 64 ops

ARMv8 PMD improvement over OpenSSL PMD
(Optimized for ARMv8 cipher only and hash
only cases):

Buffer
Size(B)   OPS(M)      Throughput(Gbps)
64        729 %        742 %
128       577 %        592 %
256       483 %        476 %
512       336 %        351 %
768       300 %        286 %
1024      263 %        250 %
1280      225 %        229 %
1536      214 %        213 %
1792      186 %        203 %
2048      200 %        193 %

The driver currently supports AES-128-CBC
in combination with: SHA256 HMAC and SHA1 HMAC.
The core crypto functionality of this driver is
provided by the external armv8_crypto library
that can be downloaded from the Cavium repository:
https://github.com/caviumnetworks/armv8_crypto

CPU compatibility with this virtual device
is detected in run-time and virtual crypto
device will not be created if CPU doesn't
provide AES, SHA1, SHA2 and NEON.

The functionality and performance of this
code can be tested using generic test application
with the following commands:
* cryptodev_sw_armv8_autotest
* cryptodev_sw_armv8_perftest
New test vectors and cases have been added
to the general pool. In particular SHA1 and
SHA256 HMAC for short cases were introduced.
This is because low-level ARM assembly code
is using different code paths for long and
short data sets, so in order to test the
mentioned driver correctly, two different
data sets need to be provided.

---
v3:
* Addressed review remarks
* Moved low-level assembly code to the external library
* Removed SHA256 MAC cases
* Various fixes: interface to the library, digest destination
  and source address interpreting, missing mbuf manipulations.

v2:
* Fixed checkpatch warnings
* Divide patches into smaller logical parts

Zbigniew Bodek (8):
  mk: fix build of assembly files for ARM64
  lib: add cryptodev type for the upcoming ARMv8 PMD
  crypto/armv8: add PMD optimized for ARMv8 processors
  mk/crypto/armv8: add PMD to the build system
  doc/armv8: update documentation about crypto PMD
  crypto/armv8: enable ARMv8 PMD in the configuration
  crypto/armv8: update MAINTAINERS entry for ARMv8 crypto
  app/test: add ARMv8 crypto tests and test vectors

 MAINTAINERS                                    |   6 +
 app/test/test_cryptodev.c                      |  63 ++
 app/test/test_cryptodev_aes_test_vectors.h     | 144 +++-
 app/test/test_cryptodev_blockcipher.c          |   4 +
 app/test/test_cryptodev_blockcipher.h          |   1 +
 app/test/test_cryptodev_perf.c                 | 480 +++++++++++++
 config/common_base                             |   6 +
 doc/guides/cryptodevs/armv8.rst                |  96 +++
 doc/guides/cryptodevs/index.rst                |   1 +
 doc/guides/rel_notes/release_17_02.rst         |   5 +
 drivers/crypto/Makefile                        |   1 +
 drivers/crypto/armv8/Makefile                  |  73 ++
 drivers/crypto/armv8/rte_armv8_pmd.c           | 926 +++++++++++++++++++++++++
 drivers/crypto/armv8/rte_armv8_pmd_ops.c       | 369 ++++++++++
 drivers/crypto/armv8/rte_armv8_pmd_private.h   | 211 ++++++
 drivers/crypto/armv8/rte_armv8_pmd_version.map |   3 +
 lib/librte_cryptodev/rte_cryptodev.h           |   3 +
 mk/arch/arm64/rte.vars.mk                      |   1 -
 mk/rte.app.mk                                  |   2 +
 mk/toolchain/gcc/rte.vars.mk                   |   6 +-
 20 files changed, 2390 insertions(+), 11 deletions(-)
 create mode 100644 doc/guides/cryptodevs/armv8.rst
 create mode 100644 drivers/crypto/armv8/Makefile
 create mode 100644 drivers/crypto/armv8/rte_armv8_pmd.c
 create mode 100644 drivers/crypto/armv8/rte_armv8_pmd_ops.c
 create mode 100644 drivers/crypto/armv8/rte_armv8_pmd_private.h
 create mode 100644 drivers/crypto/armv8/rte_armv8_pmd_version.map
Pablo de Lara Jan. 10, 2017, 5:11 p.m. UTC | #3
Hi Zbigniew,


> -----Original Message-----
> From: zbigniew.bodek@caviumnetworks.com
> [mailto:zbigniew.bodek@caviumnetworks.com]
> Sent: Wednesday, January 04, 2017 5:33 PM
> To: dev@dpdk.org
> Cc: De Lara Guarch, Pablo; Doherty, Declan;
> jerin.jacob@caviumnetworks.com; Zbigniew Bodek
> Subject: [PATCH v3 0/8] Add crypto PMD optimized for ARMv8
> 
> From: Zbigniew Bodek <zbigniew.bodek@caviumnetworks.com>

...

> 
> Zbigniew Bodek (8):
>   mk: fix build of assembly files for ARM64
>   lib: add cryptodev type for the upcoming ARMv8 PMD
>   crypto/armv8: add PMD optimized for ARMv8 processors
>   mk/crypto/armv8: add PMD to the build system
>   doc/armv8: update documentation about crypto PMD
>   crypto/armv8: enable ARMv8 PMD in the configuration
>   crypto/armv8: update MAINTAINERS entry for ARMv8 crypto
>   app/test: add ARMv8 crypto tests and test vectors

Thanks for this patchset.

Could you change the titles of some of these patches?
The prefix should be "mk:" and not "mk/crypto/armv8", for instance.
The other ones that should be changed are "doc/armv8" -> "doc" and "crypto/armv8: update MAINTAINERS" to "MAINTAINERS:".

I can do this for you, if you are OK with these changes.

Apart from this, can anyone review these changes? I do not have access to an ARM board,
so it is a bit difficult for me to review it.

Thanks,
Pablo
zbigniew.bodek@caviumnetworks.com Jan. 10, 2017, 5:50 p.m. UTC | #4
Hello Pablo,

Please check my answers in-line below.

Kind regards
Zbigniew

On 10.01.2017 18:11, De Lara Guarch, Pablo wrote:
> Hi Zbigniew,
>
>
>> -----Original Message-----
>> From: zbigniew.bodek@caviumnetworks.com
>> [mailto:zbigniew.bodek@caviumnetworks.com]
>> Sent: Wednesday, January 04, 2017 5:33 PM
>> To: dev@dpdk.org
>> Cc: De Lara Guarch, Pablo; Doherty, Declan;
>> jerin.jacob@caviumnetworks.com; Zbigniew Bodek
>> Subject: [PATCH v3 0/8] Add crypto PMD optimized for ARMv8
>>
>> From: Zbigniew Bodek <zbigniew.bodek@caviumnetworks.com>
>
> ...
>
>>
>> Zbigniew Bodek (8):
>>   mk: fix build of assembly files for ARM64
>>   lib: add cryptodev type for the upcoming ARMv8 PMD
>>   crypto/armv8: add PMD optimized for ARMv8 processors
>>   mk/crypto/armv8: add PMD to the build system
>>   doc/armv8: update documentation about crypto PMD
>>   crypto/armv8: enable ARMv8 PMD in the configuration
>>   crypto/armv8: update MAINTAINERS entry for ARMv8 crypto
>>   app/test: add ARMv8 crypto tests and test vectors
>
> Thanks for this patchset.
>
> Could you change the titles of some of these patches?
> The prefix should be "mk:" and not "mk/crypto/armv8", for instance.
> The other ones that should be changed are "doc/armv8" -> "doc" and "crypto/armv8: update MAINTAINERS" to "MAINTAINERS:".
>
> I can do this for you, if you are OK with these changes.

I'm OK with the changes and I will appreciate changing those names if 
this is not an inconvenience for you.

>
> Apart from this, can anyone review these changes? I do not have access to an ARM board,
> so it is a bit difficult for me to review it.

I would like to add that I can help with the build and installation in 
case the documentation is not sufficient (this would also mean changing 
the documentation).

>
> Thanks,
> Pablo
>
Hemant Agrawal Jan. 13, 2017, 8:07 a.m. UTC | #5
On 1/4/2017 11:03 PM, zbigniew.bodek@caviumnetworks.com wrote:
> From: Zbigniew Bodek <zbigniew.bodek@caviumnetworks.com>
>
> Introduce crypto poll mode driver using ARMv8
> cryptographic extensions. This PMD is optimized
> to provide performance boost for chained
> crypto operations processing, such as:
> * encryption + HMAC generation
> * decryption + HMAC validation.
> In particular, cipher only or hash only
> operations are not provided.

Do you have a plan to add the crypto only, auth/hash only support into 
this driver?
Also, do you plan to add additional cases w.r.t supported by other 
crypto driver?

> Performance gain can be observed in tests
> against OpenSSL PMD which also uses ARM
> crypto extensions for packets processing.
>
> Exemplary crypto performance tests comparison:
>
> cipher_hash. cipher algo: AES_CBC
> auth algo: SHA1_HMAC cipher key size=16.
> burst_size: 64 ops
>
> ARMv8 PMD improvement over OpenSSL PMD
> (Optimized for ARMv8 cipher only and hash
> only cases):
>
> Buffer
> Size(B)   OPS(M)      Throughput(Gbps)
> 64        729 %        742 %
> 128       577 %        592 %
> 256       483 %        476 %
> 512       336 %        351 %
> 768       300 %        286 %
> 1024      263 %        250 %
> 1280      225 %        229 %
> 1536      214 %        213 %
> 1792      186 %        203 %
> 2048      200 %        193 %
>
> The driver currently supports AES-128-CBC
> in combination with: SHA256 HMAC and SHA1 HMAC.
> The core crypto functionality of this driver is
> provided by the external armv8_crypto library
> that can be downloaded from the Cavium repository:
> https://github.com/caviumnetworks/armv8_crypto
>
> CPU compatibility with this virtual device
> is detected in run-time and virtual crypto
> device will not be created if CPU doesn't
> provide AES, SHA1, SHA2 and NEON.
>
> The functionality and performance of this
> code can be tested using generic test application
> with the following commands:
> * cryptodev_sw_armv8_autotest
> * cryptodev_sw_armv8_perftest
> New test vectors and cases have been added
> to the general pool. In particular SHA1 and
> SHA256 HMAC for short cases were introduced.
> This is because low-level ARM assembly code
> is using different code paths for long and
> short data sets, so in order to test the
> mentioned driver correctly, two different
> data sets need to be provided.
>
> ---
> v3:
> * Addressed review remarks
> * Moved low-level assembly code to the external library
> * Removed SHA256 MAC cases
> * Various fixes: interface to the library, digest destination
>   and source address interpreting, missing mbuf manipulations.
>
> v2:
> * Fixed checkpatch warnings
> * Divide patches into smaller logical parts
>
> Zbigniew Bodek (8):
>   mk: fix build of assembly files for ARM64
>   lib: add cryptodev type for the upcoming ARMv8 PMD
>   crypto/armv8: add PMD optimized for ARMv8 processors
>   mk/crypto/armv8: add PMD to the build system
>   doc/armv8: update documentation about crypto PMD
>   crypto/armv8: enable ARMv8 PMD in the configuration
>   crypto/armv8: update MAINTAINERS entry for ARMv8 crypto
>   app/test: add ARMv8 crypto tests and test vectors
>
>  MAINTAINERS                                    |   6 +
>  app/test/test_cryptodev.c                      |  63 ++
>  app/test/test_cryptodev_aes_test_vectors.h     | 144 +++-
>  app/test/test_cryptodev_blockcipher.c          |   4 +
>  app/test/test_cryptodev_blockcipher.h          |   1 +
>  app/test/test_cryptodev_perf.c                 | 480 +++++++++++++
>  config/common_base                             |   6 +
>  doc/guides/cryptodevs/armv8.rst                |  96 +++
>  doc/guides/cryptodevs/index.rst                |   1 +
>  doc/guides/rel_notes/release_17_02.rst         |   5 +
>  drivers/crypto/Makefile                        |   1 +
>  drivers/crypto/armv8/Makefile                  |  73 ++
>  drivers/crypto/armv8/rte_armv8_pmd.c           | 926 +++++++++++++++++++++++++
>  drivers/crypto/armv8/rte_armv8_pmd_ops.c       | 369 ++++++++++
>  drivers/crypto/armv8/rte_armv8_pmd_private.h   | 211 ++++++
>  drivers/crypto/armv8/rte_armv8_pmd_version.map |   3 +
>  lib/librte_cryptodev/rte_cryptodev.h           |   3 +
>  mk/arch/arm64/rte.vars.mk                      |   1 -
>  mk/rte.app.mk                                  |   2 +
>  mk/toolchain/gcc/rte.vars.mk                   |   6 +-
>  20 files changed, 2390 insertions(+), 11 deletions(-)
>  create mode 100644 doc/guides/cryptodevs/armv8.rst
>  create mode 100644 drivers/crypto/armv8/Makefile
>  create mode 100644 drivers/crypto/armv8/rte_armv8_pmd.c
>  create mode 100644 drivers/crypto/armv8/rte_armv8_pmd_ops.c
>  create mode 100644 drivers/crypto/armv8/rte_armv8_pmd_private.h
>  create mode 100644 drivers/crypto/armv8/rte_armv8_pmd_version.map
>
zbigniew.bodek@caviumnetworks.com Jan. 13, 2017, 6:59 p.m. UTC | #6
Hello Hemant,

Thank you for your remarks and comments. Please check my answer below.

Kind regards
Zbigniew

On 13.01.2017 09:07, Hemant Agrawal wrote:
> On 1/4/2017 11:03 PM, zbigniew.bodek@caviumnetworks.com wrote:
>> From: Zbigniew Bodek <zbigniew.bodek@caviumnetworks.com>
>>
>> Introduce crypto poll mode driver using ARMv8
>> cryptographic extensions. This PMD is optimized
>> to provide performance boost for chained
>> crypto operations processing, such as:
>> * encryption + HMAC generation
>> * decryption + HMAC validation.
>> In particular, cipher only or hash only
>> operations are not provided.
>
> Do you have a plan to add the crypto only, auth/hash only support into
> this driver?

OpenSSL driver is already implementing that and it is optimized for ARMv8.

> Also, do you plan to add additional cases w.r.t supported by other
> crypto driver?

We may do it in the future but this depends on our resource availability.

>
>> Performance gain can be observed in tests
>> against OpenSSL PMD which also uses ARM
>> crypto extensions for packets processing.
>>
>> Exemplary crypto performance tests comparison:
>>
>> cipher_hash. cipher algo: AES_CBC
>> auth algo: SHA1_HMAC cipher key size=16.
>> burst_size: 64 ops
>>
>> ARMv8 PMD improvement over OpenSSL PMD
>> (Optimized for ARMv8 cipher only and hash
>> only cases):
>>
>> Buffer
>> Size(B)   OPS(M)      Throughput(Gbps)
>> 64        729 %        742 %
>> 128       577 %        592 %
>> 256       483 %        476 %
>> 512       336 %        351 %
>> 768       300 %        286 %
>> 1024      263 %        250 %
>> 1280      225 %        229 %
>> 1536      214 %        213 %
>> 1792      186 %        203 %
>> 2048      200 %        193 %
>>
>> The driver currently supports AES-128-CBC
>> in combination with: SHA256 HMAC and SHA1 HMAC.
>> The core crypto functionality of this driver is
>> provided by the external armv8_crypto library
>> that can be downloaded from the Cavium repository:
>> https://github.com/caviumnetworks/armv8_crypto
>>
>> CPU compatibility with this virtual device
>> is detected in run-time and virtual crypto
>> device will not be created if CPU doesn't
>> provide AES, SHA1, SHA2 and NEON.
>>
>> The functionality and performance of this
>> code can be tested using generic test application
>> with the following commands:
>> * cryptodev_sw_armv8_autotest
>> * cryptodev_sw_armv8_perftest
>> New test vectors and cases have been added
>> to the general pool. In particular SHA1 and
>> SHA256 HMAC for short cases were introduced.
>> This is because low-level ARM assembly code
>> is using different code paths for long and
>> short data sets, so in order to test the
>> mentioned driver correctly, two different
>> data sets need to be provided.
>>
>> ---
>> v3:
>> * Addressed review remarks
>> * Moved low-level assembly code to the external library
>> * Removed SHA256 MAC cases
>> * Various fixes: interface to the library, digest destination
>>   and source address interpreting, missing mbuf manipulations.
>>
>> v2:
>> * Fixed checkpatch warnings
>> * Divide patches into smaller logical parts
>>
>> Zbigniew Bodek (8):
>>   mk: fix build of assembly files for ARM64
>>   lib: add cryptodev type for the upcoming ARMv8 PMD
>>   crypto/armv8: add PMD optimized for ARMv8 processors
>>   mk/crypto/armv8: add PMD to the build system
>>   doc/armv8: update documentation about crypto PMD
>>   crypto/armv8: enable ARMv8 PMD in the configuration
>>   crypto/armv8: update MAINTAINERS entry for ARMv8 crypto
>>   app/test: add ARMv8 crypto tests and test vectors
>>
>>  MAINTAINERS                                    |   6 +
>>  app/test/test_cryptodev.c                      |  63 ++
>>  app/test/test_cryptodev_aes_test_vectors.h     | 144 +++-
>>  app/test/test_cryptodev_blockcipher.c          |   4 +
>>  app/test/test_cryptodev_blockcipher.h          |   1 +
>>  app/test/test_cryptodev_perf.c                 | 480 +++++++++++++
>>  config/common_base                             |   6 +
>>  doc/guides/cryptodevs/armv8.rst                |  96 +++
>>  doc/guides/cryptodevs/index.rst                |   1 +
>>  doc/guides/rel_notes/release_17_02.rst         |   5 +
>>  drivers/crypto/Makefile                        |   1 +
>>  drivers/crypto/armv8/Makefile                  |  73 ++
>>  drivers/crypto/armv8/rte_armv8_pmd.c           | 926
>> +++++++++++++++++++++++++
>>  drivers/crypto/armv8/rte_armv8_pmd_ops.c       | 369 ++++++++++
>>  drivers/crypto/armv8/rte_armv8_pmd_private.h   | 211 ++++++
>>  drivers/crypto/armv8/rte_armv8_pmd_version.map |   3 +
>>  lib/librte_cryptodev/rte_cryptodev.h           |   3 +
>>  mk/arch/arm64/rte.vars.mk                      |   1 -
>>  mk/rte.app.mk                                  |   2 +
>>  mk/toolchain/gcc/rte.vars.mk                   |   6 +-
>>  20 files changed, 2390 insertions(+), 11 deletions(-)
>>  create mode 100644 doc/guides/cryptodevs/armv8.rst
>>  create mode 100644 drivers/crypto/armv8/Makefile
>>  create mode 100644 drivers/crypto/armv8/rte_armv8_pmd.c
>>  create mode 100644 drivers/crypto/armv8/rte_armv8_pmd_ops.c
>>  create mode 100644 drivers/crypto/armv8/rte_armv8_pmd_private.h
>>  create mode 100644 drivers/crypto/armv8/rte_armv8_pmd_version.map
>>
>
>
Hemant Agrawal Jan. 16, 2017, 6:57 a.m. UTC | #7
Hi Zbigniew,


> -----Original Message-----
> From: Zbigniew Bodek [mailto:zbigniew.bodek@caviumnetworks.com]
> Subject: Re: [PATCH v3 0/8] Add crypto PMD optimized for ARMv8
> On 13.01.2017 09:07, Hemant Agrawal wrote:
> > On 1/4/2017 11:03 PM, zbigniew.bodek@caviumnetworks.com wrote:
> >> From: Zbigniew Bodek <zbigniew.bodek@caviumnetworks.com>
> >>
> >> Introduce crypto poll mode driver using ARMv8 cryptographic
> >> extensions. This PMD is optimized to provide performance boost for
> >> chained crypto operations processing, such as:
> >> * encryption + HMAC generation
> >> * decryption + HMAC validation.
> >> In particular, cipher only or hash only operations are not provided.
> >
> > Do you have a plan to add the crypto only, auth/hash only support into
> > this driver?
> 
> OpenSSL driver is already implementing that and it is optimized for ARMv8.
> 
[Hemant]  Agreed that openSSL driver implement it, however it will make the application little complex to initiates both driver instances and then choose the driver based on the algorithm.

> > Also, do you plan to add additional cases w.r.t supported by other
> > crypto driver?
> 
> We may do it in the future but this depends on our resource availability.
> >
> >> Performance gain can be observed in tests against OpenSSL PMD which
> >> also uses ARM crypto extensions for packets processing.
> >>
> >> Exemplary crypto performance tests comparison:
> >>
> >> cipher_hash. cipher algo: AES_CBC
> >> auth algo: SHA1_HMAC cipher key size=16.
> >> burst_size: 64 ops
> >>
> >> ARMv8 PMD improvement over OpenSSL PMD (Optimized for ARMv8 cipher
> >> only and hash only cases):
> >>
> >> Buffer
> >> Size(B)   OPS(M)      Throughput(Gbps)
> >> 64        729 %        742 %
> >> 128       577 %        592 %
> >> 256       483 %        476 %
> >> 512       336 %        351 %
> >> 768       300 %        286 %
> >> 1024      263 %        250 %
> >> 1280      225 %        229 %
> >> 1536      214 %        213 %
> >> 1792      186 %        203 %
> >> 2048      200 %        193 %
> >>
> >> The driver currently supports AES-128-CBC in combination with: SHA256
> >> HMAC and SHA1 HMAC.
> >> The core crypto functionality of this driver is provided by the
> >> external armv8_crypto library that can be downloaded from the Cavium
> >> repository:
> >> https://github.com/caviumnetworks/armv8_crypto
> >>
[Hemant] Thanks for the good work. 
Is it possible to get it hosted on a standard and neutral place? E.g. Linaro
It will make it easier for other ARM vendors to contribute. 

> >> CPU compatibility with this virtual device is detected in run-time
> >> and virtual crypto device will not be created if CPU doesn't provide
> >> AES, SHA1, SHA2 and NEON.
> >>
> >> The functionality and performance of this code can be tested using
> >> generic test application with the following commands:
> >> * cryptodev_sw_armv8_autotest
> >> * cryptodev_sw_armv8_perftest
> >> New test vectors and cases have been added to the general pool. In
> >> particular SHA1 and
> >> SHA256 HMAC for short cases were introduced.
> >> This is because low-level ARM assembly code is using different code
> >> paths for long and short data sets, so in order to test the mentioned
> >> driver correctly, two different data sets need to be provided.
> >>
> >> ---
> >> v3:
> >> * Addressed review remarks
> >> * Moved low-level assembly code to the external library
> >> * Removed SHA256 MAC cases
> >> * Various fixes: interface to the library, digest destination
> >>   and source address interpreting, missing mbuf manipulations.
> >>
> >> v2:
> >> * Fixed checkpatch warnings
> >> * Divide patches into smaller logical parts
> >>
> >> Zbigniew Bodek (8):
> >>   mk: fix build of assembly files for ARM64
> >>   lib: add cryptodev type for the upcoming ARMv8 PMD
> >>   crypto/armv8: add PMD optimized for ARMv8 processors
> >>   mk/crypto/armv8: add PMD to the build system
> >>   doc/armv8: update documentation about crypto PMD
> >>   crypto/armv8: enable ARMv8 PMD in the configuration
> >>   crypto/armv8: update MAINTAINERS entry for ARMv8 crypto
> >>   app/test: add ARMv8 crypto tests and test vectors
> >>
> >>  MAINTAINERS                                    |   6 +
> >>  app/test/test_cryptodev.c                      |  63 ++
> >>  app/test/test_cryptodev_aes_test_vectors.h     | 144 +++-
> >>  app/test/test_cryptodev_blockcipher.c          |   4 +
> >>  app/test/test_cryptodev_blockcipher.h          |   1 +
> >>  app/test/test_cryptodev_perf.c                 | 480 +++++++++++++
> >>  config/common_base                             |   6 +
> >>  doc/guides/cryptodevs/armv8.rst                |  96 +++
> >>  doc/guides/cryptodevs/index.rst                |   1 +
> >>  doc/guides/rel_notes/release_17_02.rst         |   5 +
> >>  drivers/crypto/Makefile                        |   1 +
> >>  drivers/crypto/armv8/Makefile                  |  73 ++
> >>  drivers/crypto/armv8/rte_armv8_pmd.c           | 926
> >> +++++++++++++++++++++++++
> >>  drivers/crypto/armv8/rte_armv8_pmd_ops.c       | 369 ++++++++++
> >>  drivers/crypto/armv8/rte_armv8_pmd_private.h   | 211 ++++++
> >>  drivers/crypto/armv8/rte_armv8_pmd_version.map |   3 +
> >>  lib/librte_cryptodev/rte_cryptodev.h           |   3 +
> >>  mk/arch/arm64/rte.vars.mk                      |   1 -
> >>  mk/rte.app.mk                                  |   2 +
> >>  mk/toolchain/gcc/rte.vars.mk                   |   6 +-
> >>  20 files changed, 2390 insertions(+), 11 deletions(-)  create mode
> >> 100644 doc/guides/cryptodevs/armv8.rst  create mode 100644
> >> drivers/crypto/armv8/Makefile  create mode 100644
> >> drivers/crypto/armv8/rte_armv8_pmd.c
> >>  create mode 100644 drivers/crypto/armv8/rte_armv8_pmd_ops.c
> >>  create mode 100644 drivers/crypto/armv8/rte_armv8_pmd_private.h
> >>  create mode 100644 drivers/crypto/armv8/rte_armv8_pmd_version.map
> >>
> >
> >
Jerin Jacob Jan. 16, 2017, 8:02 a.m. UTC | #8
On Mon, Jan 16, 2017 at 06:57:12AM +0000, Hemant Agrawal wrote:
> Hi Zbigniew,
> 
> 
> > -----Original Message-----
> > From: Zbigniew Bodek [mailto:zbigniew.bodek@caviumnetworks.com]
> > Subject: Re: [PATCH v3 0/8] Add crypto PMD optimized for ARMv8
> > On 13.01.2017 09:07, Hemant Agrawal wrote:
> > > On 1/4/2017 11:03 PM, zbigniew.bodek@caviumnetworks.com wrote:
> > >> From: Zbigniew Bodek <zbigniew.bodek@caviumnetworks.com>
> > >>
> > >> Introduce crypto poll mode driver using ARMv8 cryptographic
> > >> extensions. This PMD is optimized to provide performance boost for
> > >> chained crypto operations processing, such as:
> > >> * encryption + HMAC generation
> > >> * decryption + HMAC validation.
> > >> In particular, cipher only or hash only operations are not provided.
> > >
> > > Do you have a plan to add the crypto only, auth/hash only support into
> > > this driver?
> > 
> > OpenSSL driver is already implementing that and it is optimized for ARMv8.
> > 
> [Hemant]  Agreed that openSSL driver implement it, however it will make the application little complex to initiates both driver instances and then choose the driver based on the algorithm.

We started with chained crypto as primary data-plane use-case like IPSec
need the chained operation. Agreed on single driver for both chained and non
chained. Feel free to contribute.

> 
> > > Also, do you plan to add additional cases w.r.t supported by other
> > > crypto driver?
> > 
> > We may do it in the future but this depends on our resource availability.
> > >
> > >> Performance gain can be observed in tests against OpenSSL PMD which
> > >> also uses ARM crypto extensions for packets processing.
> > >>
> > >> Exemplary crypto performance tests comparison:
> > >>
> > >> cipher_hash. cipher algo: AES_CBC
> > >> auth algo: SHA1_HMAC cipher key size=16.
> > >> burst_size: 64 ops
> > >>
> > >> ARMv8 PMD improvement over OpenSSL PMD (Optimized for ARMv8 cipher
> > >> only and hash only cases):
> > >>
> > >> Buffer
> > >> Size(B)   OPS(M)      Throughput(Gbps)
> > >> 64        729 %        742 %
> > >> 128       577 %        592 %
> > >> 256       483 %        476 %
> > >> 512       336 %        351 %
> > >> 768       300 %        286 %
> > >> 1024      263 %        250 %
> > >> 1280      225 %        229 %
> > >> 1536      214 %        213 %
> > >> 1792      186 %        203 %
> > >> 2048      200 %        193 %
> > >>
> > >> The driver currently supports AES-128-CBC in combination with: SHA256
> > >> HMAC and SHA1 HMAC.
> > >> The core crypto functionality of this driver is provided by the
> > >> external armv8_crypto library that can be downloaded from the Cavium
> > >> repository:
> > >> https://github.com/caviumnetworks/armv8_crypto
> > >>
> [Hemant] Thanks for the good work. 
> Is it possible to get it hosted on a standard and neutral place? E.g. Linaro
> It will make it easier for other ARM vendors to contribute. 
>

Sure. We are OK to host any place you suggest.
This was one of the reasons why I thought of having asm code in
driver/crypto/armv8 itself. But maintainers had a different view on it.
diff mbox

Patch

diff --git a/mk/arch/arm64/rte.vars.mk b/mk/arch/arm64/rte.vars.mk
index c168426..3b1178a 100644
--- a/mk/arch/arm64/rte.vars.mk
+++ b/mk/arch/arm64/rte.vars.mk
@@ -53,7 +53,6 @@  CROSS ?=
 
 CPU_CFLAGS  ?=
 CPU_LDFLAGS ?=
-CPU_ASFLAGS ?= -felf
 
 export ARCH CROSS CPU_CFLAGS CPU_LDFLAGS CPU_ASFLAGS
 
diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk
index ff70f3d..94f6412 100644
--- a/mk/toolchain/gcc/rte.vars.mk
+++ b/mk/toolchain/gcc/rte.vars.mk
@@ -41,9 +41,11 @@ 
 CC        = $(CROSS)gcc
 KERNELCC  = $(CROSS)gcc
 CPP       = $(CROSS)cpp
-# for now, we don't use as but nasm.
-# AS      = $(CROSS)as
+ifeq ($(CONFIG_RTE_ARCH_X86),y)
 AS        = nasm
+else
+AS        = $(CROSS)as
+endif
 AR        = $(CROSS)ar
 LD        = $(CROSS)ld
 OBJCOPY   = $(CROSS)objcopy