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

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

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation warning apply issues

Commit Message

Tal Shnaiderman Oct. 12, 2021, 3:53 p.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>
---
 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/aesni_gcm/meson.build         |  6 ++++++
 drivers/crypto/aesni_mb/meson.build          |  6 ++++++
 drivers/crypto/armv8/meson.build             |  6 ++++++
 drivers/crypto/bcmfs/meson.build             |  6 ++++++
 drivers/crypto/ccp/meson.build               |  1 +
 drivers/crypto/kasumi/meson.build            |  6 ++++++
 drivers/crypto/meson.build                   |  3 ---
 drivers/crypto/mlx5/meson.build              |  4 ++--
 drivers/crypto/mvsam/meson.build             |  6 ++++++
 drivers/crypto/null/meson.build              |  6 ++++++
 drivers/crypto/octeontx/meson.build          |  6 ++++++
 drivers/crypto/openssl/meson.build           |  6 ++++++
 drivers/crypto/qat/meson.build               |  6 ++++++
 drivers/crypto/scheduler/meson.build         |  6 ++++++
 drivers/crypto/snow3g/meson.build            |  6 ++++++
 drivers/crypto/virtio/meson.build            |  6 ++++++
 drivers/crypto/zuc/meson.build               |  6 ++++++
 21 files changed, 102 insertions(+), 10 deletions(-)
  

Comments

Akhil Goyal Oct. 16, 2021, 3:05 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>
> ---
>  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/aesni_gcm/meson.build         |  6 ++++++
>  drivers/crypto/aesni_mb/meson.build          |  6 ++++++
>  drivers/crypto/armv8/meson.build             |  6 ++++++
>  drivers/crypto/bcmfs/meson.build             |  6 ++++++
>  drivers/crypto/ccp/meson.build               |  1 +
>  drivers/crypto/kasumi/meson.build            |  6 ++++++
>  drivers/crypto/meson.build                   |  3 ---
>  drivers/crypto/mlx5/meson.build              |  4 ++--
>  drivers/crypto/mvsam/meson.build             |  6 ++++++
>  drivers/crypto/null/meson.build              |  6 ++++++
>  drivers/crypto/octeontx/meson.build          |  6 ++++++
>  drivers/crypto/openssl/meson.build           |  6 ++++++
>  drivers/crypto/qat/meson.build               |  6 ++++++
>  drivers/crypto/scheduler/meson.build         |  6 ++++++
>  drivers/crypto/snow3g/meson.build            |  6 ++++++
>  drivers/crypto/virtio/meson.build            |  6 ++++++
>  drivers/crypto/zuc/meson.build               |  6 ++++++
>  21 files changed, 102 insertions(+), 10 deletions(-)
> 

Please split this patch into two
- one for all drivers meson.build changes and
- one for enabling Windows compilation for mlx5.
  
Tal Shnaiderman Oct. 17, 2021, 8:15 a.m. UTC | #2
> Subject: RE: [EXT] [PATCH 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>
> > ---
> >  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/aesni_gcm/meson.build         |  6 ++++++
> >  drivers/crypto/aesni_mb/meson.build          |  6 ++++++
> >  drivers/crypto/armv8/meson.build             |  6 ++++++
> >  drivers/crypto/bcmfs/meson.build             |  6 ++++++
> >  drivers/crypto/ccp/meson.build               |  1 +
> >  drivers/crypto/kasumi/meson.build            |  6 ++++++
> >  drivers/crypto/meson.build                   |  3 ---
> >  drivers/crypto/mlx5/meson.build              |  4 ++--
> >  drivers/crypto/mvsam/meson.build             |  6 ++++++
> >  drivers/crypto/null/meson.build              |  6 ++++++
> >  drivers/crypto/octeontx/meson.build          |  6 ++++++
> >  drivers/crypto/openssl/meson.build           |  6 ++++++
> >  drivers/crypto/qat/meson.build               |  6 ++++++
> >  drivers/crypto/scheduler/meson.build         |  6 ++++++
> >  drivers/crypto/snow3g/meson.build            |  6 ++++++
> >  drivers/crypto/virtio/meson.build            |  6 ++++++
> >  drivers/crypto/zuc/meson.build               |  6 ++++++
> >  21 files changed, 102 insertions(+), 10 deletions(-)
> >
> 
> Please split this patch into two
> - one for all drivers meson.build changes and
> - one for enabling Windows compilation for mlx5.

Sure, I'll split and send a v2.
  

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 84278898b9..17a49c20ef 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -135,6 +135,7 @@  New Features
   Updated the Mellanox mlx5 driver with new features and improvements, including:
 
   * Added implicit mempool registration to avoid data path hiccups (opt-out).
+  * Added support for mlx5 crypto PMD on Windows operating system.
 
 
 Removed Items
diff --git a/drivers/common/mlx5/version.map b/drivers/common/mlx5/version.map
index 807043f22c..a30e0f9d12 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/aesni_gcm/meson.build b/drivers/crypto/aesni_gcm/meson.build
index 0fcac2a8eb..7d0140ff22 100644
--- a/drivers/crypto/aesni_gcm/meson.build
+++ b/drivers/crypto/aesni_gcm/meson.build
@@ -1,6 +1,12 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
+if is_windows
+    build = false
+    reason = 'not supported on Windows'
+    subdir_done()
+endif
+
 IMB_required_ver = '0.52.0'
 lib = cc.find_library('IPSec_MB', required: false)
 if not lib.found()
diff --git a/drivers/crypto/aesni_mb/meson.build b/drivers/crypto/aesni_mb/meson.build
index ed6b9f53e4..b7512383c3 100644
--- a/drivers/crypto/aesni_mb/meson.build
+++ b/drivers/crypto/aesni_mb/meson.build
@@ -1,6 +1,12 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
+if is_windows
+    build = false
+    reason = 'not supported on Windows'
+    subdir_done()
+endif
+
 IMB_required_ver = '0.52.0'
 lib = cc.find_library('IPSec_MB', required: false)
 if not lib.found()
diff --git a/drivers/crypto/armv8/meson.build b/drivers/crypto/armv8/meson.build
index 40a4dbb7bb..5effba8bbc 100644
--- a/drivers/crypto/armv8/meson.build
+++ b/drivers/crypto/armv8/meson.build
@@ -1,6 +1,12 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2019 Arm Limited
 
+if is_windows
+    build = false
+    reason = 'not supported on Windows'
+    subdir_done()
+endif
+
 dep = dependency('libAArch64crypto', required: false, method: 'pkg-config')
 if not dep.found()
     build = false
diff --git a/drivers/crypto/bcmfs/meson.build b/drivers/crypto/bcmfs/meson.build
index d67e78d51b..5842f83a3b 100644
--- a/drivers/crypto/bcmfs/meson.build
+++ b/drivers/crypto/bcmfs/meson.build
@@ -3,6 +3,12 @@ 
 # All rights reserved.
 #
 
+if is_windows
+    build = false
+    reason = 'not supported on Windows'
+    subdir_done()
+endif
+
 deps += ['eal', 'bus_vdev']
 sources = files(
         'bcmfs_logs.c',
diff --git a/drivers/crypto/ccp/meson.build b/drivers/crypto/ccp/meson.build
index 0f82b9b90b..a4f3406009 100644
--- a/drivers/crypto/ccp/meson.build
+++ b/drivers/crypto/ccp/meson.build
@@ -4,6 +4,7 @@ 
 if not is_linux
     build = false
     reason = 'only supported on Linux'
+    subdir_done()
 endif
 dep = dependency('libcrypto', required: false, method: 'pkg-config')
 if not dep.found()
diff --git a/drivers/crypto/kasumi/meson.build b/drivers/crypto/kasumi/meson.build
index e6e0f08c3d..966b8a5214 100644
--- a/drivers/crypto/kasumi/meson.build
+++ b/drivers/crypto/kasumi/meson.build
@@ -1,6 +1,12 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018-2020 Intel Corporation
 
+if is_windows
+    build = false
+    reason = 'not supported on Windows'
+    subdir_done()
+endif
+
 IMB_required_ver = '0.53.0'
 lib = cc.find_library('IPSec_MB', required: false)
 if not lib.found()
diff --git a/drivers/crypto/meson.build b/drivers/crypto/meson.build
index ea239f4c56..c49ec501d4 100644
--- a/drivers/crypto/meson.build
+++ b/drivers/crypto/meson.build
@@ -1,9 +1,6 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-if is_windows
-    subdir_done()
-endif
 
 drivers = [
         'aesni_gcm',
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
 
diff --git a/drivers/crypto/mvsam/meson.build b/drivers/crypto/mvsam/meson.build
index fec167bf29..bf3c4323de 100644
--- a/drivers/crypto/mvsam/meson.build
+++ b/drivers/crypto/mvsam/meson.build
@@ -3,6 +3,12 @@ 
 # Copyright(c) 2018 Semihalf.
 # All rights reserved.
 
+if is_windows
+    build = false
+    reason = 'not supported on Windows'
+    subdir_done()
+endif
+
 dep = dependency('libmusdk', required: false, method: 'pkg-config')
 if not dep.found()
     build = false
diff --git a/drivers/crypto/null/meson.build b/drivers/crypto/null/meson.build
index 1f7d644de1..acc16e7d81 100644
--- a/drivers/crypto/null/meson.build
+++ b/drivers/crypto/null/meson.build
@@ -1,5 +1,11 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
+if is_windows
+    build = false
+    reason = 'not supported on Windows'
+    subdir_done()
+endif
+
 deps += 'bus_vdev'
 sources = files('null_crypto_pmd.c', 'null_crypto_pmd_ops.c')
diff --git a/drivers/crypto/octeontx/meson.build b/drivers/crypto/octeontx/meson.build
index 244b16230e..48e8e263c1 100644
--- a/drivers/crypto/octeontx/meson.build
+++ b/drivers/crypto/octeontx/meson.build
@@ -1,6 +1,12 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Cavium, Inc
 
+if is_windows
+    build = false
+    reason = 'not supported on Windows'
+    subdir_done()
+endif
+
 deps += ['bus_pci']
 deps += ['bus_vdev']
 deps += ['common_cpt']
diff --git a/drivers/crypto/openssl/meson.build b/drivers/crypto/openssl/meson.build
index b21fca0be3..cd962da1d6 100644
--- a/drivers/crypto/openssl/meson.build
+++ b/drivers/crypto/openssl/meson.build
@@ -1,6 +1,12 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
+if is_windows
+    build = false
+    reason = 'not supported on Windows'
+    subdir_done()
+endif
+
 dep = dependency('libcrypto', required: false, method: 'pkg-config')
 if not dep.found()
     build = false
diff --git a/drivers/crypto/qat/meson.build b/drivers/crypto/qat/meson.build
index b3b2d17258..d08a24c7b3 100644
--- a/drivers/crypto/qat/meson.build
+++ b/drivers/crypto/qat/meson.build
@@ -1,6 +1,12 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017-2018 Intel Corporation
 
+if is_windows
+    build = false
+    reason = 'not supported on Windows'
+    subdir_done()
+endif
+
 # this does not build the QAT driver, instead that is done in the compression
 # driver which comes later. Here we just add our sources files to the list
 build = false
diff --git a/drivers/crypto/scheduler/meson.build b/drivers/crypto/scheduler/meson.build
index d510f49970..cd18efc791 100644
--- a/drivers/crypto/scheduler/meson.build
+++ b/drivers/crypto/scheduler/meson.build
@@ -1,6 +1,12 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
 
+if is_windows
+    build = false
+    reason = 'not supported on Windows'
+    subdir_done()
+endif
+
 deps += ['bus_vdev', 'reorder']
 sources = files(
         'rte_cryptodev_scheduler.c',
diff --git a/drivers/crypto/snow3g/meson.build b/drivers/crypto/snow3g/meson.build
index 0c087baa2a..ac4d0354ea 100644
--- a/drivers/crypto/snow3g/meson.build
+++ b/drivers/crypto/snow3g/meson.build
@@ -1,6 +1,12 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2019-2020 Intel Corporation
 
+if is_windows
+    build = false
+    reason = 'not supported on Windows'
+    subdir_done()
+endif
+
 IMB_required_ver = '0.53.0'
 lib = cc.find_library('IPSec_MB', required: false)
 if not lib.found()
diff --git a/drivers/crypto/virtio/meson.build b/drivers/crypto/virtio/meson.build
index 1b6d77f66f..45533c9b89 100644
--- a/drivers/crypto/virtio/meson.build
+++ b/drivers/crypto/virtio/meson.build
@@ -1,6 +1,12 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 HUAWEI TECHNOLOGIES CO., LTD.
 
+if is_windows
+    build = false
+    reason = 'not supported on Windows'
+    subdir_done()
+endif
+
 includes += include_directories('../../../lib/vhost')
 deps += 'bus_pci'
 sources = files(
diff --git a/drivers/crypto/zuc/meson.build b/drivers/crypto/zuc/meson.build
index a5f77a22d8..0a29885610 100644
--- a/drivers/crypto/zuc/meson.build
+++ b/drivers/crypto/zuc/meson.build
@@ -1,6 +1,12 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018-2020 Intel Corporation
 
+if is_windows
+    build = false
+    reason = 'not supported on Windows'
+    subdir_done()
+endif
+
 IMB_required_ver = '0.53.0'
 lib = cc.find_library('IPSec_MB', required: false)
 if not lib.found()