[v3,5/5] crypto/mlx5: support on Windows

Message ID 20211025084617.4952-6-talshn@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series Support MLX5 crypto driver on Windows |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-spell-check-testing warning Testing issues
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing fail Testing issues
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional fail Functional Testing issues
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS

Commit Message

Tal Shnaiderman Oct. 25, 2021, 8:46 a.m. UTC
  Add support for mlx5 crypto pmd on Windows OS.
Add changes to release note and pmd guide.

Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 doc/guides/cryptodevs/mlx5.rst               | 15 ++++++++++++---
 doc/guides/rel_notes/release_21_11.rst       |  1 +
 drivers/common/mlx5/version.map              |  2 +-
 drivers/common/mlx5/windows/mlx5_common_os.c |  2 +-
 drivers/crypto/mlx5/meson.build              |  4 ++--
 5 files changed, 17 insertions(+), 7 deletions(-)
  

Comments

Akhil Goyal Oct. 27, 2021, 12:04 p.m. UTC | #1
> Add support for mlx5 crypto pmd on Windows OS.
> Add changes to release note and pmd guide.
> 
> Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>
> ---
>  doc/guides/cryptodevs/mlx5.rst               | 15 ++++++++++++---
>  doc/guides/rel_notes/release_21_11.rst       |  1 +
>  drivers/common/mlx5/version.map              |  2 +-
>  drivers/common/mlx5/windows/mlx5_common_os.c |  2 +-
>  drivers/crypto/mlx5/meson.build              |  4 ++--
>  5 files changed, 17 insertions(+), 7 deletions(-)
> 
> diff --git a/doc/guides/cryptodevs/mlx5.rst
> b/doc/guides/cryptodevs/mlx5.rst
> index 68bfdf3a83..7338c0c493 100644
> --- a/doc/guides/cryptodevs/mlx5.rst
> +++ b/doc/guides/cryptodevs/mlx5.rst
> @@ -39,12 +39,12 @@ or to access the hardware components directly.
>  There are different levels of objects and bypassing abilities.
>  To get the best performances:
> 
> -- Verbs is a complete high-level generic API.
> -- Direct Verbs is a device-specific API.
> +- Verbs is a complete high-level generic API (Linux only).
> +- Direct Verbs is a device-specific API (Linux only).
>  - DevX allows to access firmware objects.
> 
>  Enabling ``librte_crypto_mlx5`` causes DPDK applications
> -to be linked against libibverbs.
> +to be linked against libibverbs on Linux OS.
> 
>  In order to move the device to crypto operational mode, credential and KEK
>  (Key Encrypting Key) should be set as the first step.
> @@ -155,8 +155,17 @@ Limitations
>  Prerequisites
>  -------------
> 
> +Linux Prerequisites
> +~~~~~~~~~~~~~~~~~~~
> +
>  - Mellanox OFED version: **5.3**
>    see :doc:`../../nics/mlx5` guide for more Mellanox OFED details.
> 
>  - Compilation can be done also with rdma-core v15+.
>    see :doc:`../../nics/mlx5` guide for more rdma-core details.
> +
> +Windows Prerequisites
> +~~~~~~~~~~~~~~~~~~~~~
> +
> +- Mellanox WINOF-2 version: **2.60** or higher.
> +  see :doc:`../../nics/mlx5` guide for more Mellanox WINOF-2 details.

I do not see a way to cross compile this driver with MinGW. How are we expected to
Test compilation for such cases? Do we need to build it over Windows? I personally don't
Think it is a good idea.

Others please suggest.
  
Tal Shnaiderman Oct. 27, 2021, 1:33 p.m. UTC | #2
> Subject: RE: [EXT] [PATCH v3 5/5] crypto/mlx5: support on Windows
> 
> External email: Use caution opening links or attachments
> 
> 
> > Add support for mlx5 crypto pmd on Windows OS.
> > Add changes to release note and pmd guide.
> >
> > Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
> > Acked-by: Matan Azrad <matan@nvidia.com>
> > ---
> >  doc/guides/cryptodevs/mlx5.rst               | 15 ++++++++++++---
> >  doc/guides/rel_notes/release_21_11.rst       |  1 +
> >  drivers/common/mlx5/version.map              |  2 +-
> >  drivers/common/mlx5/windows/mlx5_common_os.c |  2 +-
> >  drivers/crypto/mlx5/meson.build              |  4 ++--
> >  5 files changed, 17 insertions(+), 7 deletions(-)
> >
> > diff --git a/doc/guides/cryptodevs/mlx5.rst
> > b/doc/guides/cryptodevs/mlx5.rst index 68bfdf3a83..7338c0c493 100644
> > --- a/doc/guides/cryptodevs/mlx5.rst
> > +++ b/doc/guides/cryptodevs/mlx5.rst
> > @@ -39,12 +39,12 @@ or to access the hardware components directly.
> >  There are different levels of objects and bypassing abilities.
> >  To get the best performances:
> >
> > -- Verbs is a complete high-level generic API.
> > -- Direct Verbs is a device-specific API.
> > +- Verbs is a complete high-level generic API (Linux only).
> > +- Direct Verbs is a device-specific API (Linux only).
> >  - DevX allows to access firmware objects.
> >
> >  Enabling ``librte_crypto_mlx5`` causes DPDK applications -to be
> > linked against libibverbs.
> > +to be linked against libibverbs on Linux OS.
> >
> >  In order to move the device to crypto operational mode, credential
> > and KEK  (Key Encrypting Key) should be set as the first step.
> > @@ -155,8 +155,17 @@ Limitations
> >  Prerequisites
> >  -------------
> >
> > +Linux Prerequisites
> > +~~~~~~~~~~~~~~~~~~~
> > +
> >  - Mellanox OFED version: **5.3**
> >    see :doc:`../../nics/mlx5` guide for more Mellanox OFED details.
> >
> >  - Compilation can be done also with rdma-core v15+.
> >    see :doc:`../../nics/mlx5` guide for more rdma-core details.
> > +
> > +Windows Prerequisites
> > +~~~~~~~~~~~~~~~~~~~~~
> > +
> > +- Mellanox WINOF-2 version: **2.60** or higher.
> > +  see :doc:`../../nics/mlx5` guide for more Mellanox WINOF-2 details.
> 
> I do not see a way to cross compile this driver with MinGW. How are we
> expected to Test compilation for such cases? Do we need to build it over
> Windows? I personally don't Think it is a good idea.
> 
> Others please suggest.

Yes, this driver can be built only using clang on Windows, net/mlx5 behaves the same way.

DPDK CI has a compilation test for Windows [1], it will fail if a patch is introduced that caused compilation to fail on Windows.

[1] https://lab.dpdk.org/results/dashboard/patchsets/19686/
  
Tal Shnaiderman Oct. 31, 2021, 2:06 p.m. UTC | #3
> Subject: RE: [EXT] [PATCH v3 5/5] crypto/mlx5: support on Windows
> 
> > Subject: RE: [EXT] [PATCH v3 5/5] crypto/mlx5: support on Windows
> >
> > External email: Use caution opening links or attachments
> >
> >
> > > Add support for mlx5 crypto pmd on Windows OS.
> > > Add changes to release note and pmd guide.
> > >
> > > Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
> > > Acked-by: Matan Azrad <matan@nvidia.com>
> > > ---
> > >  doc/guides/cryptodevs/mlx5.rst               | 15 ++++++++++++---
> > >  doc/guides/rel_notes/release_21_11.rst       |  1 +
> > >  drivers/common/mlx5/version.map              |  2 +-
> > >  drivers/common/mlx5/windows/mlx5_common_os.c |  2 +-
> > >  drivers/crypto/mlx5/meson.build              |  4 ++--
> > >  5 files changed, 17 insertions(+), 7 deletions(-)
> > >
> > > diff --git a/doc/guides/cryptodevs/mlx5.rst
> > > b/doc/guides/cryptodevs/mlx5.rst index 68bfdf3a83..7338c0c493 100644
> > > --- a/doc/guides/cryptodevs/mlx5.rst
> > > +++ b/doc/guides/cryptodevs/mlx5.rst
> > > @@ -39,12 +39,12 @@ or to access the hardware components directly.
> > >  There are different levels of objects and bypassing abilities.
> > >  To get the best performances:
> > >
> > > -- Verbs is a complete high-level generic API.
> > > -- Direct Verbs is a device-specific API.
> > > +- Verbs is a complete high-level generic API (Linux only).
> > > +- Direct Verbs is a device-specific API (Linux only).
> > >  - DevX allows to access firmware objects.
> > >
> > >  Enabling ``librte_crypto_mlx5`` causes DPDK applications -to be
> > > linked against libibverbs.
> > > +to be linked against libibverbs on Linux OS.
> > >
> > >  In order to move the device to crypto operational mode, credential
> > > and KEK  (Key Encrypting Key) should be set as the first step.
> > > @@ -155,8 +155,17 @@ Limitations
> > >  Prerequisites
> > >  -------------
> > >
> > > +Linux Prerequisites
> > > +~~~~~~~~~~~~~~~~~~~
> > > +
> > >  - Mellanox OFED version: **5.3**
> > >    see :doc:`../../nics/mlx5` guide for more Mellanox OFED details.
> > >
> > >  - Compilation can be done also with rdma-core v15+.
> > >    see :doc:`../../nics/mlx5` guide for more rdma-core details.
> > > +
> > > +Windows Prerequisites
> > > +~~~~~~~~~~~~~~~~~~~~~
> > > +
> > > +- Mellanox WINOF-2 version: **2.60** or higher.
> > > +  see :doc:`../../nics/mlx5` guide for more Mellanox WINOF-2 details.
> >
> > I do not see a way to cross compile this driver with MinGW. How are we
> > expected to Test compilation for such cases? Do we need to build it
> > over Windows? I personally don't Think it is a good idea.
> >
> > Others please suggest.
> 
> Yes, this driver can be built only using clang on Windows, net/mlx5 behaves
> the same way.
> 
> DPDK CI has a compilation test for Windows [1], it will fail if a patch is
> introduced that caused compilation to fail on Windows.
> 
> [1] https://lab.dpdk.org/results/dashboard/patchsets/19686/

Any other comments? If not, can this series be merged?
  
Akhil Goyal Oct. 31, 2021, 7:08 p.m. UTC | #4
> > >
> > > > Add support for mlx5 crypto pmd on Windows OS.
> > > > Add changes to release note and pmd guide.
> > > >
> > > > Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
> > > > Acked-by: Matan Azrad <matan@nvidia.com>
> > > > ---
> > > >  doc/guides/cryptodevs/mlx5.rst               | 15 ++++++++++++---
> > > >  doc/guides/rel_notes/release_21_11.rst       |  1 +
> > > >  drivers/common/mlx5/version.map              |  2 +-
> > > >  drivers/common/mlx5/windows/mlx5_common_os.c |  2 +-
> > > >  drivers/crypto/mlx5/meson.build              |  4 ++--
> > > >  5 files changed, 17 insertions(+), 7 deletions(-)
> > > >
> > > > diff --git a/doc/guides/cryptodevs/mlx5.rst
> > > > b/doc/guides/cryptodevs/mlx5.rst index 68bfdf3a83..7338c0c493
> 100644
> > > > --- a/doc/guides/cryptodevs/mlx5.rst
> > > > +++ b/doc/guides/cryptodevs/mlx5.rst
> > > > @@ -39,12 +39,12 @@ or to access the hardware components directly.
> > > >  There are different levels of objects and bypassing abilities.
> > > >  To get the best performances:
> > > >
> > > > -- Verbs is a complete high-level generic API.
> > > > -- Direct Verbs is a device-specific API.
> > > > +- Verbs is a complete high-level generic API (Linux only).
> > > > +- Direct Verbs is a device-specific API (Linux only).
> > > >  - DevX allows to access firmware objects.
> > > >
> > > >  Enabling ``librte_crypto_mlx5`` causes DPDK applications -to be
> > > > linked against libibverbs.
> > > > +to be linked against libibverbs on Linux OS.
> > > >
> > > >  In order to move the device to crypto operational mode, credential
> > > > and KEK  (Key Encrypting Key) should be set as the first step.
> > > > @@ -155,8 +155,17 @@ Limitations
> > > >  Prerequisites
> > > >  -------------
> > > >
> > > > +Linux Prerequisites
> > > > +~~~~~~~~~~~~~~~~~~~
> > > > +
> > > >  - Mellanox OFED version: **5.3**
> > > >    see :doc:`../../nics/mlx5` guide for more Mellanox OFED details.
> > > >
> > > >  - Compilation can be done also with rdma-core v15+.
> > > >    see :doc:`../../nics/mlx5` guide for more rdma-core details.
> > > > +
> > > > +Windows Prerequisites
> > > > +~~~~~~~~~~~~~~~~~~~~~
> > > > +
> > > > +- Mellanox WINOF-2 version: **2.60** or higher.
> > > > +  see :doc:`../../nics/mlx5` guide for more Mellanox WINOF-2 details.
> > >
> > > I do not see a way to cross compile this driver with MinGW. How are we
> > > expected to Test compilation for such cases? Do we need to build it
> > > over Windows? I personally don't Think it is a good idea.
> > >
> > > Others please suggest.
> >
> > Yes, this driver can be built only using clang on Windows, net/mlx5 behaves
> > the same way.
> >
> > DPDK CI has a compilation test for Windows [1], it will fail if a patch is
> > introduced that caused compilation to fail on Windows.
> >
This dependency is not good. At times we have dependent series and 
we cannot just rely on CI to do compilation.
Please remove this dependency as soon as possible.
This series is applied on dpdk-next-crypto for now.
But would need to take this patch out in future if there are frequent 
Compilation breaks. We cannot ask developers working on common
Code base to check compilation of the patches explicitly on Windows
Machine. There may be many people who do not work on Windows
Machine.

> 
> Any other comments? If not, can this series be merged?
  

Patch

diff --git a/doc/guides/cryptodevs/mlx5.rst b/doc/guides/cryptodevs/mlx5.rst
index 68bfdf3a83..7338c0c493 100644
--- a/doc/guides/cryptodevs/mlx5.rst
+++ b/doc/guides/cryptodevs/mlx5.rst
@@ -39,12 +39,12 @@  or to access the hardware components directly.
 There are different levels of objects and bypassing abilities.
 To get the best performances:
 
-- Verbs is a complete high-level generic API.
-- Direct Verbs is a device-specific API.
+- Verbs is a complete high-level generic API (Linux only).
+- Direct Verbs is a device-specific API (Linux only).
 - DevX allows to access firmware objects.
 
 Enabling ``librte_crypto_mlx5`` causes DPDK applications
-to be linked against libibverbs.
+to be linked against libibverbs on Linux OS.
 
 In order to move the device to crypto operational mode, credential and KEK
 (Key Encrypting Key) should be set as the first step.
@@ -155,8 +155,17 @@  Limitations
 Prerequisites
 -------------
 
+Linux Prerequisites
+~~~~~~~~~~~~~~~~~~~
+
 - Mellanox OFED version: **5.3**
   see :doc:`../../nics/mlx5` guide for more Mellanox OFED details.
 
 - Compilation can be done also with rdma-core v15+.
   see :doc:`../../nics/mlx5` guide for more rdma-core details.
+
+Windows Prerequisites
+~~~~~~~~~~~~~~~~~~~~~
+
+- Mellanox WINOF-2 version: **2.60** or higher.
+  see :doc:`../../nics/mlx5` guide for more Mellanox WINOF-2 details.
diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index 4fb2abf4ad..035a98d814 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -189,6 +189,7 @@  New Features
 
   * Added implicit mempool registration to avoid data path hiccups (opt-out).
   * Added NIC offloads for the PMD on Windows (TSO, VLAN strip, CRC keep).
+  * Added support for mlx5 crypto PMD on Windows operating system.
 
 * **Updated Solarflare network PMD.**
 
diff --git a/drivers/common/mlx5/version.map b/drivers/common/mlx5/version.map
index 0ea8325f9a..71cd7c625e 100644
--- a/drivers/common/mlx5/version.map
+++ b/drivers/common/mlx5/version.map
@@ -16,7 +16,7 @@  INTERNAL {
 	mlx5_dev_mempool_unregister;
 	mlx5_dev_mempool_subscribe;
 
-	mlx5_devx_alloc_uar; # WINDOWS_NO_EXPORT
+	mlx5_devx_alloc_uar;
 
 	mlx5_devx_cmd_alloc_pd;
 	mlx5_devx_cmd_create_conn_track_offload_obj;
diff --git a/drivers/common/mlx5/windows/mlx5_common_os.c b/drivers/common/mlx5/windows/mlx5_common_os.c
index 44e8ebec2b..ea478d7395 100644
--- a/drivers/common/mlx5/windows/mlx5_common_os.c
+++ b/drivers/common/mlx5/windows/mlx5_common_os.c
@@ -202,7 +202,7 @@  mlx5_os_open_device(struct mlx5_common_device *cdev, uint32_t classes)
 	struct mlx5_context *mlx5_ctx = NULL;
 	int n;
 
-	if (classes != MLX5_CLASS_ETH) {
+	if (classes != MLX5_CLASS_ETH && classes != MLX5_CLASS_CRYPTO) {
 		DRV_LOG(ERR,
 			"The chosen classes are not supported on Windows.");
 		rte_errno = ENOTSUP;
diff --git a/drivers/crypto/mlx5/meson.build b/drivers/crypto/mlx5/meson.build
index 1d6e413dd5..9d9c9c00bc 100644
--- a/drivers/crypto/mlx5/meson.build
+++ b/drivers/crypto/mlx5/meson.build
@@ -1,9 +1,9 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright (c) 2021 NVIDIA Corporation & Affiliates
 
-if not is_linux
+if not (is_linux or is_windows)
     build = false
-    reason = 'only supported on Linux'
+    reason = 'only supported on Linux and Windows'
     subdir_done()
 endif