Skip to contentSkip to conversation

Support ice PMD on Windows

PATCH Superseded Pallavi Kadam 5 participants 32 messages Mar 3, 2021 – Apr 6, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Support ice PMD on Windows

This patch-set enables building the Intel ice PMD on Windows.

Depends-on: series-15230 ("bus/pci: fix probing for non-netuio bound devices")

Pallavi Kadam (4):
build: enable iavf driver on Windows
net/ice: build on Windows
net/ice: disable ice DDP package on Windows
doc: update ice PMD and 21.05 release notes

 doc/guides/nics/features/ice.ini       |  1 +
 doc/guides/nics/ice.rst                | 16 ++++++++++++++--
 doc/guides/rel_notes/release_21_05.rst |  4 ++++
 drivers/common/cpt/meson.build         |  6 ++++++
 drivers/common/iavf/iavf_osdep.h       |  9 +++++++++
 drivers/common/meson.build             |  3 ---
 drivers/common/mvep/meson.build        |  6 ++++++
 drivers/common/octeontx/meson.build    |  6 ++++++
 drivers/common/octeontx2/meson.build   |  6 ++++++
 drivers/common/qat/meson.build         |  6 ++++++
 drivers/common/sfc_efx/meson.build     |  6 ++++++
 drivers/net/ice/base/ice_flow.c        |  2 +-
 drivers/net/ice/base/ice_flow.h        |  2 +-
 drivers/net/ice/base/ice_osdep.h       | 15 +++++++++++++++
 drivers/net/ice/base/ice_switch.c      |  2 +-
 drivers/net/ice/base/ice_vlan_mode.h   |  1 +
 drivers/net/ice/ice_dcf_ethdev.c       |  1 -
 drivers/net/ice/ice_dcf_parent.c       | 10 +++++-----
 drivers/net/ice/ice_ethdev.c           | 12 +++++++++---
 drivers/net/ice/ice_rxtx_vec_avx2.c    |  2 +-
 drivers/net/ice/ice_rxtx_vec_avx512.c  |  2 +-
 drivers/net/ice/meson.build            | 10 ++++------
 22 files changed, 103 insertions(+), 25 deletions(-)
Signature · 1 line
2.18.0.windows.1
#1 lore raw

PATCH 1/4 build: enable iavf driver on Windows

Enable IAVF driver to build on Windows as it is required to build ice PMD.
Disable all other drivers from common directory. This patch also includes fix for a macro redefinition warning in the IAVF driver.

---
 drivers/common/cpt/meson.build       | 6 ++++++
 drivers/common/iavf/iavf_osdep.h     | 9 +++++++++
 drivers/common/meson.build           | 3 ---
 drivers/common/mvep/meson.build      | 6 ++++++
 drivers/common/octeontx/meson.build  | 6 ++++++
 drivers/common/octeontx2/meson.build | 6 ++++++
 drivers/common/qat/meson.build       | 6 ++++++
 drivers/common/sfc_efx/meson.build   | 6 ++++++
 8 files changed, 45 insertions(+), 3 deletions(-)
drivers/common/cpt/meson.build +6 -0
index beecf0da3..1127267ba 100644
@@ -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
+
 sources = files('cpt_fpm_tables.c',
 		'cpt_pmd_ops_helper.c')
 
drivers/common/iavf/iavf_osdep.h +9 -0
index eaefde88e..76c186a5b 100644
@@ -55,6 +55,15 @@ typedef uint64_t        s64;
 #define __be64          uint64_t
 #endif
 
+/* Avoid macro redefinition warning on Windows */
+#ifdef RTE_EXEC_ENV_WINDOWS
+#ifdef min
+#undef min
+#endif
+#ifdef max
+#undef max
+#endif
+#endif
 #define min(a, b) RTE_MIN(a, b)
 #define max(a, b) RTE_MAX(a, b)
 
drivers/common/meson.build +0 -3
index ba6325adf..2a0c43054 100644
@@ -1,9 +1,6 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Cavium, Inc
 
-if is_windows
-	subdir_done()
-endif
 
 std_deps = ['eal']
 drivers = ['cpt', 'dpaax', 'iavf', 'mvep', 'octeontx', 'octeontx2', 'sfc_efx']
drivers/common/mvep/meson.build +6 -0
index 7cd968b38..a929e2311 100644
@@ -4,6 +4,12 @@
 # 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
drivers/common/octeontx/meson.build +6 -0
index 203d1ef49..02b57b95c 100644
@@ -2,4 +2,10 @@
 # Copyright(c) 2018 Cavium, Inc
 #
 
+if is_windows
+	build = false
+	reason = 'not supported on Windows'
+	subdir_done()
+endif
+
 sources = files('octeontx_mbox.c')
drivers/common/octeontx2/meson.build +6 -0
index 84fb11524..97293d1a7 100644
@@ -2,6 +2,12 @@
 # Copyright(C) 2019 Marvell International Ltd.
 #
 
+if is_windows
+	build = false
+	reason = 'not supported on Windows'
+	subdir_done()
+endif
+
 if not dpdk_conf.get('RTE_ARCH_64')
 	build = false
 	reason = 'only supported on 64-bit'
drivers/common/qat/meson.build +6 -0
index 67f7aca97..3ad7dd501 100644
@@ -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
+
 qat_crypto = true
 qat_crypto_path = 'crypto/qat'
 qat_crypto_relpath = '../../' + qat_crypto_path
drivers/common/sfc_efx/meson.build +6 -0
index 6cb9f0737..a2dfed0ec 100644
@@ -5,6 +5,12 @@
 # This software was jointly developed between OKTET Labs (under contract
 # for Solarflare) and Solarflare Communications, Inc.
 
+if is_windows
+	build = false
+	reason = 'not supported on Windows'
+	subdir_done()
+endif
+
 if (arch_subdir != 'x86' or not dpdk_conf.get('RTE_ARCH_64')) and (arch_subdir != 'arm' or not host_machine.cpu_family().startswith('aarch64'))
 	build = false
 	reason = 'only supported on x86_64 and aarch64'
Signature · 1 line
2.18.0.windows.1
#2 lore raw

PATCH 2/4 net/ice: build on Windows

In reply to Pallavi Kadam

Add Intel ice PMD support on Windows.
Remove #include sys/ioctl header file as it is not needed. Replace x86intrin.h with rte_vect.h to avoid __m_prefetchw conflicting types.
Replace POSIX usleep() API with rte API.
Add a new macro for the access() API as the original function has been deprecated on Windows.
Add extra cflags '-fno-asynchronous-unwind-tables'
to avoid MinGW build error:
Error: invalid register for .seh_savexmm

---
 drivers/net/ice/base/ice_flow.c       |  2 +-
 drivers/net/ice/base/ice_flow.h       |  2 +-
 drivers/net/ice/base/ice_osdep.h      | 15 +++++++++++++++
 drivers/net/ice/base/ice_switch.c     |  2 +-
 drivers/net/ice/base/ice_vlan_mode.h  |  1 +
 drivers/net/ice/ice_dcf_ethdev.c      |  1 -
 drivers/net/ice/ice_dcf_parent.c      | 10 +++++-----
 drivers/net/ice/ice_ethdev.c          |  6 +++---
 drivers/net/ice/ice_rxtx_vec_avx2.c   |  2 +-
 drivers/net/ice/ice_rxtx_vec_avx512.c |  2 +-
 drivers/net/ice/meson.build           | 10 ++++------
 11 files changed, 33 insertions(+), 20 deletions(-)
drivers/net/ice/base/ice_flow.c +1 -1
index a081fbe5a..a4c233d4c 100644
@@ -3139,7 +3139,7 @@ enum ice_status ice_flow_rem_entry(struct ice_hw *hw, enum ice_block blk,
 	if (entry_h == ICE_FLOW_ENTRY_HANDLE_INVAL)
 		return ICE_ERR_PARAM;
 
-	entry = ICE_FLOW_ENTRY_PTR((unsigned long)entry_h);
+	entry = ICE_FLOW_ENTRY_PTR((intptr_t)entry_h);
 
 	/* Retain the pointer to the flow profile as the entry will be freed */
 	prof = entry->prof;
drivers/net/ice/base/ice_flow.h +1 -1
index c3bce1319..af15ecb0f 100644
@@ -446,7 +446,7 @@ struct ice_flow_entry {
 	u8 acts_cnt;
 };
 
-#define ICE_FLOW_ENTRY_HNDL(e)	((unsigned long)e)
+#define ICE_FLOW_ENTRY_HNDL(e)	((intptr_t)e)
 #define ICE_FLOW_ENTRY_PTR(h)	((struct ice_flow_entry *)(h))
 
 struct ice_flow_prof {
drivers/net/ice/base/ice_osdep.h +15 -0
index 46ac86834..f4cc762e9 100644
@@ -62,9 +62,24 @@ typedef uint64_t        s64;
 #define __be64          uint64_t
 #endif
 
+/* Avoid macro redefinition warning on Windows */
+#ifdef RTE_EXEC_ENV_WINDOWS
+#ifdef min
+#undef min
+#endif
+#ifdef max
+#undef max
+#endif
+#endif
 #define min(a, b) RTE_MIN(a, b)
 #define max(a, b) RTE_MAX(a, b)
 
+#ifdef RTE_EXEC_ENV_WINDOWS
+#define ice_access _access
+#else
+#define ice_access access
+#endif
+
 #define FIELD_SIZEOF(t, f) RTE_SIZEOF_FIELD(t, f)
 #define ARRAY_SIZE(arr) RTE_DIM(arr)
 
drivers/net/ice/base/ice_switch.c +1 -1
index 4568242c1..b546e3d4e 100644
@@ -6684,7 +6684,7 @@ ice_fill_valid_words(struct ice_adv_lkup_elem *rule,
 
 	for (j = 0; j < sizeof(rule->m_u) / sizeof(u16); j++)
 		if (((u16 *)&rule->m_u)[j] &&
-		    rule->type < ARRAY_SIZE(ice_prot_ext)) {
+		    (unsigned long long)rule->type < ARRAY_SIZE(ice_prot_ext)) {
 			/* No more space to accommodate */
 			if (word >= ICE_MAX_CHAIN_WORDS)
 				return 0;
drivers/net/ice/base/ice_vlan_mode.h +1 -0
index e9f13e781..bcb6ff713 100644
@@ -6,6 +6,7 @@
 #define _ICE_VLAN_MODE_H_
 
 #include "ice_osdep.h"
+#include "ice_status.h"
 
 struct ice_hw;
 
drivers/net/ice/ice_dcf_ethdev.c +0 -1
index e0772295e..af4731f55 100644
@@ -5,7 +5,6 @@
 #include <errno.h>
 #include <stdbool.h>
 #include <sys/types.h>
-#include <sys/ioctl.h>
 #include <unistd.h>
 
 #include <rte_interrupts.h>
drivers/net/ice/ice_dcf_parent.c +5 -5
index 476fd4906..a8571b35e 100644
@@ -121,7 +121,7 @@ ice_dcf_vsi_update_service_handler(void *param)
 	struct ice_dcf_hw *hw = reset_param->dcf_hw;
 	struct ice_dcf_adapter *adapter;
 
-	usleep(ICE_DCF_VSI_UPDATE_SERVICE_INTERVAL);
+	rte_delay_us(ICE_DCF_VSI_UPDATE_SERVICE_INTERVAL);
 
 	rte_spinlock_lock(&vsi_update_lock);
 
@@ -315,24 +315,24 @@ ice_dcf_request_pkg_name(struct ice_hw *hw, char *pkg_name)
 	snprintf(pkg_name, ICE_MAX_PKG_FILENAME_SIZE,
 		 ICE_PKG_FILE_SEARCH_PATH_UPDATES "ice-%016llx.pkg",
 		 (unsigned long long)dsn);
-	if (!access(pkg_name, 0))
+	if (!ice_access(pkg_name, 0))
 		return 0;
 
 	snprintf(pkg_name, ICE_MAX_PKG_FILENAME_SIZE,
 		 ICE_PKG_FILE_SEARCH_PATH_DEFAULT "ice-%016llx.pkg",
 		 (unsigned long long)dsn);
-	if (!access(pkg_name, 0))
+	if (!ice_access(pkg_name, 0))
 		return 0;
 
 pkg_file_direct:
 	snprintf(pkg_name,
 		 ICE_MAX_PKG_FILENAME_SIZE, "%s", ICE_PKG_FILE_UPDATES);
-	if (!access(pkg_name, 0))
+	if (!ice_access(pkg_name, 0))
 		return 0;
 
 	snprintf(pkg_name,
 		 ICE_MAX_PKG_FILENAME_SIZE, "%s", ICE_PKG_FILE_DEFAULT);
-	if (!access(pkg_name, 0))
+	if (!ice_access(pkg_name, 0))
 		return 0;
 
 	return -1;
drivers/net/ice/ice_ethdev.c +3 -3
index dfd99ace9..d22bc92ff 100644
@@ -1674,17 +1674,17 @@ ice_pkg_file_search_path(struct rte_pci_device *pci_dev, char *pkg_file)
 
 	strncpy(pkg_file, ICE_PKG_FILE_SEARCH_PATH_UPDATES,
 		ICE_MAX_PKG_FILENAME_SIZE);
-	if (!access(strcat(pkg_file, opt_ddp_filename), 0))
+	if (!ice_access(strcat(pkg_file, opt_ddp_filename), 0))
 		return 0;
 
 	strncpy(pkg_file, ICE_PKG_FILE_SEARCH_PATH_DEFAULT,
 		ICE_MAX_PKG_FILENAME_SIZE);
-	if (!access(strcat(pkg_file, opt_ddp_filename), 0))
+	if (!ice_access(strcat(pkg_file, opt_ddp_filename), 0))
 		return 0;
 
 fail_dsn:
 	strncpy(pkg_file, ICE_PKG_FILE_UPDATES, ICE_MAX_PKG_FILENAME_SIZE);
-	if (!access(pkg_file, 0))
+	if (!ice_access(pkg_file, 0))
 		return 0;
 	strncpy(pkg_file, ICE_PKG_FILE_DEFAULT, ICE_MAX_PKG_FILENAME_SIZE);
 	return 0;
drivers/net/ice/ice_rxtx_vec_avx2.c +1 -1
index 7838e1778..a56fdd9a9 100644
@@ -4,7 +4,7 @@
 
 #include "ice_rxtx_vec_common.h"
 
-#include <x86intrin.h>
+#include <rte_vect.h>
 
 #ifndef __INTEL_COMPILER
 #pragma GCC diagnostic ignored "-Wcast-qual"
drivers/net/ice/ice_rxtx_vec_avx512.c +1 -1
index fd5d72432..00de45479 100644
@@ -4,7 +4,7 @@
 
 #include "ice_rxtx_vec_common.h"
 
-#include <x86intrin.h>
+#include <rte_vect.h>
 
 #ifndef __INTEL_COMPILER
 #pragma GCC diagnostic ignored "-Wcast-qual"
drivers/net/ice/meson.build +4 -6
index 9a67c8f7b..44ef64b4c 100644
@@ -1,12 +1,6 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
-if is_windows
-	build = false
-	reason = 'not supported on Windows'
-	subdir_done()
-endif
-
 subdir('base')
 objs = [base_objs]
 
@@ -26,6 +20,10 @@ includes += include_directories('base', '../../common/iavf')
 if arch_subdir == 'x86'
 	sources += files('ice_rxtx_vec_sse.c')
 
+	if is_windows and cc.get_id() != 'clang'
+		cflags += ['-fno-asynchronous-unwind-tables']
+	endif
+
 	# compile AVX2 version if either:
 	# a. we have AVX supported in minimum instruction set baseline
 	# b. it's not minimum instruction set, but supported by compiler
Signature · 1 line
2.18.0.windows.1
#3 lore raw

Re: [dpdk-dev] [PATCH 2/4] net/ice: build on Windows

Quoted 11 lines · Pallavi Kadam

Add Intel ice PMD support on Windows.
Remove #include sys/ioctl header file as it is not needed. Replace x86intrin.h with rte_vect.h to avoid __m_prefetchw conflicting types.
Replace POSIX usleep() API with rte API.
Add a new macro for the access() API as the original function has been deprecated on Windows.
Add extra cflags '-fno-asynchronous-unwind-tables'
to avoid MinGW build error:
Error: invalid register for .seh_savexmm

Fyi, caught at the UNH lab:

http://mails.dpdk.org/archives/test-report/2021-March/180813.html

[205/277] Compiling C object drivers/net/ice/base/a42f040@@ice_base at sta/ice_acl_ctrl.c.obj.
[206/277] Compiling C object drivers/net/ice/base/a42f040@@ice_base at sta/ice_flow.c.obj.
FAILED: drivers/net/ice/base/a42f040@@ice_base at sta/ice_flow.c.obj gcc @drivers/net/ice/base/a42f040@@ice_base at sta/ice_flow.c.obj.rsp {standard input}: Assembler messages:
{standard input}:1677: Error: invalid register for .seh_savexmm {standard input}:3985: Error: invalid register for .seh_savexmm [207/277] Linking static target drivers/libtmp_rte_net_i40e.a. [208/277] Compiling C object drivers/net/ice/base/a42f040@@ice_base at sta/ice_sched.c.obj.
[209/277] Compiling C object drivers/net/ice/base/a42f040@@ice_base at sta/ice_dcb.c.obj.
[210/277] Compiling C object drivers/net/ice/base/a42f040@@ice_base at sta/ice_flex_pipe.c.obj.
[211/277] Compiling C object drivers/a715181@@tmp_rte_net_ice at sta/net_ice_ice_ethdev.c.obj.
ninja: build stopped: subcommand failed.

I suppose this is because "-fno-asynchronous-unwind-tables" is not passed to the base driver cflags.
Bonus question: should we make this workaround global for mingw compilation?

Signature · 1 line
David Marchand
#4 lore raw

Re: [dpdk-dev] [PATCH 2/4] net/ice: build on Windows

Hi David

Quoted 35 lines · David Marchand
Quoted 10 lines · Pallavi Kadam

Add Intel ice PMD support on Windows.
Remove #include sys/ioctl header file as it is not needed. Replace x86intrin.h with rte_vect.h to avoid __m_prefetchw conflicting types.
Replace POSIX usleep() API with rte API.
Add a new macro for the access() API as the original function has been deprecated on Windows.
Add extra cflags '-fno-asynchronous-unwind-tables'
to avoid MinGW build error:
Error: invalid register for .seh_savexmm

Fyi, caught at the UNH lab:

http://mails.dpdk.org/archives/test-report/2021-March/180813.html

[205/277] Compiling C object drivers/net/ice/base/a42f040@@ice_base at sta/ice_acl_ctrl.c.obj.
[206/277] Compiling C object drivers/net/ice/base/a42f040@@ice_base at sta/ice_flow.c.obj.
FAILED: drivers/net/ice/base/a42f040@@ice_base at sta/ice_flow.c.obj gcc @drivers/net/ice/base/a42f040@@ice_base at sta/ice_flow.c.obj.rsp {standard input}: Assembler messages:
{standard input}:1677: Error: invalid register for .seh_savexmm {standard input}:3985: Error: invalid register for .seh_savexmm [207/277] Linking static target drivers/libtmp_rte_net_i40e.a. [208/277] Compiling C object drivers/net/ice/base/a42f040@@ice_base at sta/ice_sched.c.obj.
[209/277] Compiling C object drivers/net/ice/base/a42f040@@ice_base at sta/ice_dcb.c.obj.
[210/277] Compiling C object drivers/net/ice/base/a42f040@@ice_base at sta/ice_flex_pipe.c.obj.
[211/277] Compiling C object drivers/a715181@@tmp_rte_net_ice at sta/net_ice_ice_ethdev.c.obj.
ninja: build stopped: subcommand failed.

Quoted 3 lines

I suppose this is because "-fno-asynchronous-unwind-tables" is not passed to the base driver cflags.
Bonus question: should we make this workaround global for mingw compilation?

Thanks for the log. We will send a fix by passing the cflag to the base driver in v2.

However, I am not able to reproduce this error on my system.

I tried using the same version as UNH lab has: gcc 8.1.0 "gcc (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0"

Quoted 2 lines
#5 lore raw

PATCH 3/4 net/ice: disable ice DDP package on Windows

In reply to Pallavi Kadam

Disable loading of private DDP packages in ice PMD on Windows.

---
 drivers/net/ice/ice_ethdev.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/ice/ice_ethdev.c +6 -0
index d22bc92ff..1f5f16d42 100644
@@ -1652,6 +1652,7 @@ ice_pf_setup(struct ice_pf *pf)
  * Extract device serial number from PCIe Configuration Space and
  * determine the pkg file path according to the DSN.
  */
+#ifndef RTE_EXEC_ENV_WINDOWS
 static int
 ice_pkg_file_search_path(struct rte_pci_device *pci_dev, char *pkg_file)
 {
@@ -1689,6 +1690,7 @@ ice_pkg_file_search_path(struct rte_pci_device *pci_dev, char *pkg_file)
 	strncpy(pkg_file, ICE_PKG_FILE_DEFAULT, ICE_MAX_PKG_FILENAME_SIZE);
 	return 0;
 }
+#endif
 
 enum ice_pkg_type
 ice_load_pkg_type(struct ice_hw *hw)
@@ -1714,6 +1716,7 @@ ice_load_pkg_type(struct ice_hw *hw)
 	return package_type;
 }
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 static int ice_load_pkg(struct rte_eth_dev *dev)
 {
 	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
@@ -1785,6 +1788,7 @@ static int ice_load_pkg(struct rte_eth_dev *dev)
 	rte_free(buf);
 	return err;
 }
+#endif
 
 static void
 ice_base_queue_get(struct ice_pf *pf)
@@ -2065,6 +2069,7 @@ ice_dev_init(struct rte_eth_dev *dev)
 		return -EINVAL;
 	}
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 	ret = ice_load_pkg(dev);
 	if (ret) {
 		if (ad->devargs.safe_mode_support == 0) {
@@ -2077,6 +2082,7 @@ ice_dev_init(struct rte_eth_dev *dev)
 					"Entering Safe Mode");
 		ad->is_safe_mode = 1;
 	}
+#endif
 
 	PMD_INIT_LOG(INFO, "FW %d.%d.%05d API %d.%d",
 		     hw->fw_maj_ver, hw->fw_min_ver, hw->fw_build,
Signature · 1 line
2.18.0.windows.1
#6 lore raw

Re: [dpdk-dev] [PATCH 3/4] net/ice: disable ice DDP package on Windows

2021-03-03 13:59, Pallavi Kadam:

Quoted 7 lines

Disable loading of private DDP packages in ice PMD on Windows.

---
 drivers/net/ice/ice_ethdev.c | 6 ++++++
 1 file changed, 6 insertions(+)

Are DDP packages unavailable on Windows or is their loading disabled because reading from PCI config space is not implemented by netuio? In the former case, please document the reason in commit (and probably in used guide?). In the latter case, could you instead fix rte_pci_config_read() to return (-1) on Windows, so that DDP loading automatically fails at reading capabilities? This would ensure ICE PMD remains portable by compiling all of its code in every platform.

#7 lore raw

Re: [dpdk-dev] [PATCH 3/4] net/ice: disable ice DDP package on Windows

Hi Dmitry,

Quoted 8 lines · Dmitry Kozlyuk

2021-03-03 13:59, Pallavi Kadam:

Quoted 7 lines

Disable loading of private DDP packages in ice PMD on Windows.

---
  drivers/net/ice/ice_ethdev.c | 6 ++++++
  1 file changed, 6 insertions(+)
Quoted 7 lines

Are DDP packages unavailable on Windows or is their loading disabled because reading from PCI config space is not implemented by netuio? In the former case, please document the reason in commit (and probably in used guide?). In the latter case, could you instead fix rte_pci_config_read() to return (-1) on Windows, so that DDP loading automatically fails at reading capabilities? This would ensure ICE PMD remains portable by compiling all of its code in every platform.

Yes, loading of external DDP package is not supported on Windows.

Will update the commit message and the ice user guide accordingly in v2.

#8 lore raw

PATCH 4/4 doc: update ice PMD and 21.05 release notes

In reply to Pallavi Kadam

Add documentation to support ice PMD on Windows. Update the release notes and features list for the same.

---
 doc/guides/nics/features/ice.ini       |  1 +
 doc/guides/nics/ice.rst                | 16 ++++++++++++++--
 doc/guides/rel_notes/release_21_05.rst |  4 ++++
 3 files changed, 19 insertions(+), 2 deletions(-)
doc/guides/nics/features/ice.ini +1 -0
index e30a7d2e5..2b93872b1 100644
@@ -40,5 +40,6 @@ Module EEPROM dump   = Y
 Multiprocess aware   = Y
 FreeBSD              = Y
 Linux                = Y
+Windows              = Y
 x86-32               = Y
 x86-64               = Y
doc/guides/nics/ice.rst +14 -2
index ccda26f82..d9d4da505 100644
@@ -8,8 +8,8 @@ The ice PMD (**librte_net_ice**) provides poll mode driver support for
 10/25/50/100 Gbps Intel® Ethernet 800 Series Network Adapters based on
 the Intel Ethernet Controller E810 and Intel Ethernet Connection E822/E823.
 
-Prerequisites
--------------
+Linux Prerequisites
+-------------------
 
 - Follow the DPDK :ref:`Getting Started Guide for Linux <linux_gsg>` to setup the basic DPDK environment.
 
@@ -25,6 +25,18 @@ Prerequisites
 - To understand DDP for COMMs usage with DPDK, please review `Intel® Ethernet 800 Series Telecommunication (Comms)
   Dynamic Device Personalization (DDP) Package <https://cdrdv2.intel.com/v1/dl/getContent/618651>`_.
 
+Windows Prerequisites
+---------------------
+
+- Follow the DPDK `Getting Started Guide for Windows <https://doc.dpdk.org/guides/windows_gsg/index.html>`_ to setup the basic DPDK environment.
+
+- Identify the Intel® Ethernet adapter and get the latest NVM/FW version.
+
+- To access any Intel® Ethernet hardware, load the NetUIO driver in place of existing built-in (inbox) driver.
+
+- To load NetUIO driver, follow the steps mentioned in `dpdk-kmods repository
+  <https://git.dpdk.org/dpdk-kmods/tree/windows/netuio/README.rst>`_.
+
 
 Recommended Matching List
 -------------------------
doc/guides/rel_notes/release_21_05.rst +4 -0
index 5aa9ed7db..e28d9a6c8 100644
@@ -55,6 +55,10 @@ New Features
      Also, make sure to start the actual text at the margin.
      =======================================================
 
+* **Updated Intel ice driver.**
+
+  * Added Intel ice support on Windows.
+
 
 Removed Items
 -------------
Signature · 1 line
2.18.0.windows.1
#9 lore raw

Re: [dpdk-dev] [PATCH 4/4] doc: update ice PMD and 21.05 release notes

2021-03-03 13:59, Pallavi Kadam:

Quoted 10 lines

Add documentation to support ice PMD on Windows. Update the release notes and features list for the same.

---
 doc/guides/nics/features/ice.ini       |  1 +
 doc/guides/nics/ice.rst                | 16 ++++++++++++++--
 doc/guides/rel_notes/release_21_05.rst |  4 ++++
 3 files changed, 19 insertions(+), 2 deletions(-)

It is preferred to update docs in single commit with code.

#10 lore raw

Re: [dpdk-dev] [PATCH 4/4] doc: update ice PMD and 21.05 release notes

Quoted 4 lines · Dmitry Kozlyuk

2021-03-03 13:59, Pallavi Kadam:

Quoted 3 lines

Add documentation to support ice PMD on Windows. Update the release notes and features list for the same.

Quoted 8 lines
Quoted 7 lines
---
  doc/guides/nics/features/ice.ini       |  1 +
  doc/guides/nics/ice.rst                | 16 ++++++++++++++--
  doc/guides/rel_notes/release_21_05.rst |  4 ++++
  3 files changed, 19 insertions(+), 2 deletions(-)

It is preferred to update docs in single commit with code.

Thanks, Dmitry. Ok, will include the doc changes in the same patch where the ice PMD code is enabled.

#11 lore raw

v2 cover Support ice PMD on Windows

In reply to Pallavi Kadam

This patch-set enables building the Intel ice PMD on Windows.

v2 changes:
- Updated patch#1 title to reflect the iavf base code support
- Added cflag '-fno-asynchronous-unwind-tables' to base driver
- Updated doc patch with the DDP documentation and integrated it with the respective code commit

Depends-on: series-15230 ("bus/pci: fix probing for non-netuio bound devices")

Pallavi Kadam (3):
build: enable iavf base code to build on windows net/ice: build on Windows
net/ice: disable ice DDP package on Windows

 doc/guides/nics/features/ice.ini       |  1 +
 doc/guides/nics/ice.rst                | 18 ++++++++++++++++--
 doc/guides/rel_notes/release_21_05.rst |  4 ++++
 drivers/common/cpt/meson.build         |  6 ++++++
 drivers/common/iavf/iavf_osdep.h       |  9 +++++++++
 drivers/common/meson.build             |  3 ---
 drivers/common/mvep/meson.build        |  6 ++++++
 drivers/common/octeontx/meson.build    |  6 ++++++
 drivers/common/octeontx2/meson.build   |  6 ++++++
 drivers/common/qat/meson.build         |  6 ++++++
 drivers/common/sfc_efx/meson.build     |  6 ++++++
 drivers/net/ice/base/ice_flow.c        |  2 +-
 drivers/net/ice/base/ice_flow.h        |  2 +-
 drivers/net/ice/base/ice_osdep.h       | 15 +++++++++++++++
 drivers/net/ice/base/ice_switch.c      |  2 +-
 drivers/net/ice/base/ice_vlan_mode.h   |  1 +
 drivers/net/ice/base/meson.build       |  4 ++++
 drivers/net/ice/ice_dcf_ethdev.c       |  1 -
 drivers/net/ice/ice_dcf_parent.c       | 10 +++++-----
 drivers/net/ice/ice_ethdev.c           | 12 +++++++++---
 drivers/net/ice/ice_rxtx_vec_avx2.c    |  2 +-
 drivers/net/ice/ice_rxtx_vec_avx512.c  |  2 +-
 drivers/net/ice/meson.build            | 10 ++++------
 23 files changed, 109 insertions(+), 25 deletions(-)
Signature · 1 line
2.18.0.windows.1
#12 lore raw

PATCH v2 1/3 build: enable iavf base code to build on windows

Enable IAVF driver to build on Windows as it is required to build ice PMD.
Disable all other drivers from common directory. This patch also includes fix for a macro redefinition warning in the IAVF driver.

---
 drivers/common/cpt/meson.build       | 6 ++++++
 drivers/common/iavf/iavf_osdep.h     | 9 +++++++++
 drivers/common/meson.build           | 3 ---
 drivers/common/mvep/meson.build      | 6 ++++++
 drivers/common/octeontx/meson.build  | 6 ++++++
 drivers/common/octeontx2/meson.build | 6 ++++++
 drivers/common/qat/meson.build       | 6 ++++++
 drivers/common/sfc_efx/meson.build   | 6 ++++++
 8 files changed, 45 insertions(+), 3 deletions(-)
drivers/common/cpt/meson.build +6 -0
index beecf0da3..1127267ba 100644
@@ -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
+
 sources = files('cpt_fpm_tables.c',
 		'cpt_pmd_ops_helper.c')
 
drivers/common/iavf/iavf_osdep.h +9 -0
index eaefde88e..76c186a5b 100644
@@ -55,6 +55,15 @@ typedef uint64_t        s64;
 #define __be64          uint64_t
 #endif
 
+/* Avoid macro redefinition warning on Windows */
+#ifdef RTE_EXEC_ENV_WINDOWS
+#ifdef min
+#undef min
+#endif
+#ifdef max
+#undef max
+#endif
+#endif
 #define min(a, b) RTE_MIN(a, b)
 #define max(a, b) RTE_MAX(a, b)
 
drivers/common/meson.build +0 -3
index ba6325adf..2a0c43054 100644
@@ -1,9 +1,6 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Cavium, Inc
 
-if is_windows
-	subdir_done()
-endif
 
 std_deps = ['eal']
 drivers = ['cpt', 'dpaax', 'iavf', 'mvep', 'octeontx', 'octeontx2', 'sfc_efx']
drivers/common/mvep/meson.build +6 -0
index 7cd968b38..a929e2311 100644
@@ -4,6 +4,12 @@
 # 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
drivers/common/octeontx/meson.build +6 -0
index 203d1ef49..02b57b95c 100644
@@ -2,4 +2,10 @@
 # Copyright(c) 2018 Cavium, Inc
 #
 
+if is_windows
+	build = false
+	reason = 'not supported on Windows'
+	subdir_done()
+endif
+
 sources = files('octeontx_mbox.c')
drivers/common/octeontx2/meson.build +6 -0
index 84fb11524..97293d1a7 100644
@@ -2,6 +2,12 @@
 # Copyright(C) 2019 Marvell International Ltd.
 #
 
+if is_windows
+	build = false
+	reason = 'not supported on Windows'
+	subdir_done()
+endif
+
 if not dpdk_conf.get('RTE_ARCH_64')
 	build = false
 	reason = 'only supported on 64-bit'
drivers/common/qat/meson.build +6 -0
index 67f7aca97..3ad7dd501 100644
@@ -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
+
 qat_crypto = true
 qat_crypto_path = 'crypto/qat'
 qat_crypto_relpath = '../../' + qat_crypto_path
drivers/common/sfc_efx/meson.build +6 -0
index 6cb9f0737..a2dfed0ec 100644
@@ -5,6 +5,12 @@
 # This software was jointly developed between OKTET Labs (under contract
 # for Solarflare) and Solarflare Communications, Inc.
 
+if is_windows
+	build = false
+	reason = 'not supported on Windows'
+	subdir_done()
+endif
+
 if (arch_subdir != 'x86' or not dpdk_conf.get('RTE_ARCH_64')) and (arch_subdir != 'arm' or not host_machine.cpu_family().startswith('aarch64'))
 	build = false
 	reason = 'only supported on x86_64 and aarch64'
Signature · 1 line
2.18.0.windows.1
Acked-by on v2 1/3
#13 lore raw

Re: [dpdk-dev] [PATCH v2 1/3] build: enable iavf base code to build on windows

Quoted 8 lines · Pallavi Kadam

Enable IAVF driver to build on Windows as it is required to build ice PMD.
Disable all other drivers from common directory. This patch also includes fix for a macro redefinition warning in the IAVF driver.

Quoted 11 lines
---
 drivers/common/cpt/meson.build       | 6 ++++++
 drivers/common/iavf/iavf_osdep.h     | 9 +++++++++
 drivers/common/meson.build           | 3 ---
 drivers/common/mvep/meson.build      | 6 ++++++
 drivers/common/octeontx/meson.build  | 6 ++++++
 drivers/common/octeontx2/meson.build | 6 ++++++
 drivers/common/qat/meson.build       | 6 ++++++
 drivers/common/sfc_efx/meson.build   | 6 ++++++
 8 files changed, 45 insertions(+), 3 deletions(-)
#14 lore raw

Re: [dpdk-dev] [PATCH v2 1/3] build: enable iavf base code to build on windows

In reply to Pallavi Kadam
Quoted 8 lines · Pallavi Kadam

Enable IAVF driver to build on Windows as it is required to build ice PMD.
Disable all other drivers from common directory. This patch also includes fix for a macro redefinition warning in the IAVF driver.

<...>

drivers/common/sfc_efx/meson.build line 13

Quoted 13 lines

index 6cb9f0737..a2dfed0ec 100644

drivers/common/sfc_efx/meson.build +6 -0
@@ -5,6 +5,12 @@
  # This software was jointly developed between OKTET Labs (under contract
  # for Solarflare) and Solarflare Communications, Inc.
 
+if is_windows
+	build = false
+	reason = 'not supported on Windows'
+	subdir_done()
+endif
+

'common/sfc_efx/meson.build' already has similar update in the upstream, can you please rebase on latest head of the repo.

#15 lore raw

Re: [dpdk-dev] [PATCH v2 1/3] build: enable iavf base code to build on windows

Quoted 12 lines · Ferruh Yigit
Quoted 8 lines · Pallavi Kadam

Enable IAVF driver to build on Windows as it is required to build ice PMD.
Disable all other drivers from common directory. This patch also includes fix for a macro redefinition warning in the IAVF driver.

<...>

Quoted 14 lines

drivers/common/sfc_efx/meson.build

Quoted 12 lines

index 6cb9f0737..a2dfed0ec 100644

drivers/common/sfc_efx/meson.build +0 -0
@@ -5,6 +5,12 @@
   # This software was jointly developed between OKTET Labs (under contract
   # for Solarflare) and Solarflare Communications, Inc.

  +if is_windows
+    build = false
+    reason = 'not supported on Windows'
+    subdir_done()

drivers/common/sfc_efx/meson.build +2 -0
+endif
+

'common/sfc_efx/meson.build' already has similar update in the upstream, can you please rebase on latest head of the repo.

Sure, I'll rebase the code in v3 along with other suggested changes.

Thank you.

#16 lore raw

PATCH v2 2/3 net/ice: build on Windows

In reply to Pallavi Kadam

- Add Intel ice PMD support on Windows.
- Remove #include sys/ioctl header file as it is not needed.
- Replace x86intrin.h with rte_vect.h to avoid __m_prefetchw conflicting types.
- Replace POSIX usleep() API with rte API.
- Add a new macro for the access() API as the original function has been deprecated on Windows.
- Add extra cflags '-fno-asynchronous-unwind-tables'
to avoid MinGW build error:
Error: invalid register for .seh_savexmm
- Add documentation to support ice PMD on Windows.
Update the release notes and features list for the same.

---
 doc/guides/nics/features/ice.ini       |  1 +
 doc/guides/nics/ice.rst                | 18 ++++++++++++++++--
 doc/guides/rel_notes/release_21_05.rst |  4 ++++
 drivers/net/ice/base/ice_flow.c        |  2 +-
 drivers/net/ice/base/ice_flow.h        |  2 +-
 drivers/net/ice/base/ice_osdep.h       | 15 +++++++++++++++
 drivers/net/ice/base/ice_switch.c      |  2 +-
 drivers/net/ice/base/ice_vlan_mode.h   |  1 +
 drivers/net/ice/base/meson.build       |  4 ++++
 drivers/net/ice/ice_dcf_ethdev.c       |  1 -
 drivers/net/ice/ice_dcf_parent.c       | 10 +++++-----
 drivers/net/ice/ice_ethdev.c           |  6 +++---
 drivers/net/ice/ice_rxtx_vec_avx2.c    |  2 +-
 drivers/net/ice/ice_rxtx_vec_avx512.c  |  2 +-
 drivers/net/ice/meson.build            | 10 ++++------
 15 files changed, 58 insertions(+), 22 deletions(-)
doc/guides/nics/features/ice.ini +1 -0
index e30a7d2e5..2b93872b1 100644
@@ -40,5 +40,6 @@ Module EEPROM dump   = Y
 Multiprocess aware   = Y
 FreeBSD              = Y
 Linux                = Y
+Windows              = Y
 x86-32               = Y
 x86-64               = Y
doc/guides/nics/ice.rst +16 -2
index ccda26f82..100086132 100644
@@ -8,8 +8,8 @@ The ice PMD (**librte_net_ice**) provides poll mode driver support for
 10/25/50/100 Gbps Intel® Ethernet 800 Series Network Adapters based on
 the Intel Ethernet Controller E810 and Intel Ethernet Connection E822/E823.
 
-Prerequisites
--------------
+Linux Prerequisites
+-------------------
 
 - Follow the DPDK :ref:`Getting Started Guide for Linux <linux_gsg>` to setup the basic DPDK environment.
 
@@ -25,6 +25,20 @@ Prerequisites
 - To understand DDP for COMMs usage with DPDK, please review `Intel® Ethernet 800 Series Telecommunication (Comms)
   Dynamic Device Personalization (DDP) Package <https://cdrdv2.intel.com/v1/dl/getContent/618651>`_.
 
+Windows Prerequisites
+---------------------
+
+- Follow the DPDK `Getting Started Guide for Windows <https://doc.dpdk.org/guides/windows_gsg/index.html>`_ to setup the basic DPDK environment.
+
+- Identify the Intel® Ethernet adapter and get the latest NVM/FW version.
+
+- To access any Intel® Ethernet hardware, load the NetUIO driver in place of existing built-in (inbox) driver.
+
+- To load NetUIO driver, follow the steps mentioned in `dpdk-kmods repository
+  <https://git.dpdk.org/dpdk-kmods/tree/windows/netuio/README.rst>`_.
+
+- Loading of private Dynamic Device Personalization (DDP) package is not supported on Windows.
+
 
 Recommended Matching List
 -------------------------
doc/guides/rel_notes/release_21_05.rst +4 -0
index 23f7f0bff..15b812ac5 100644
@@ -70,6 +70,10 @@ New Features
   * Added command to display Rx queue used descriptor count.
     ``show port (port_id) rxq (queue_id) desc used count``
 
+* **Updated Intel ice driver.**
+
+  * Added Intel ice support on Windows.
+
 
 Removed Items
 -------------
drivers/net/ice/base/ice_flow.c +1 -1
index a081fbe5a..a4c233d4c 100644
@@ -3139,7 +3139,7 @@ enum ice_status ice_flow_rem_entry(struct ice_hw *hw, enum ice_block blk,
 	if (entry_h == ICE_FLOW_ENTRY_HANDLE_INVAL)
 		return ICE_ERR_PARAM;
 
-	entry = ICE_FLOW_ENTRY_PTR((unsigned long)entry_h);
+	entry = ICE_FLOW_ENTRY_PTR((intptr_t)entry_h);
 
 	/* Retain the pointer to the flow profile as the entry will be freed */
 	prof = entry->prof;
drivers/net/ice/base/ice_flow.h +1 -1
index c3bce1319..af15ecb0f 100644
@@ -446,7 +446,7 @@ struct ice_flow_entry {
 	u8 acts_cnt;
 };
 
-#define ICE_FLOW_ENTRY_HNDL(e)	((unsigned long)e)
+#define ICE_FLOW_ENTRY_HNDL(e)	((intptr_t)e)
 #define ICE_FLOW_ENTRY_PTR(h)	((struct ice_flow_entry *)(h))
 
 struct ice_flow_prof {
drivers/net/ice/base/ice_osdep.h +15 -0
index 46ac86834..f4cc762e9 100644
@@ -62,9 +62,24 @@ typedef uint64_t        s64;
 #define __be64          uint64_t
 #endif
 
+/* Avoid macro redefinition warning on Windows */
+#ifdef RTE_EXEC_ENV_WINDOWS
+#ifdef min
+#undef min
+#endif
+#ifdef max
+#undef max
+#endif
+#endif
 #define min(a, b) RTE_MIN(a, b)
 #define max(a, b) RTE_MAX(a, b)
 
+#ifdef RTE_EXEC_ENV_WINDOWS
+#define ice_access _access
+#else
+#define ice_access access
+#endif
+
 #define FIELD_SIZEOF(t, f) RTE_SIZEOF_FIELD(t, f)
 #define ARRAY_SIZE(arr) RTE_DIM(arr)
 
drivers/net/ice/base/ice_switch.c +1 -1
index 4568242c1..b546e3d4e 100644
@@ -6684,7 +6684,7 @@ ice_fill_valid_words(struct ice_adv_lkup_elem *rule,
 
 	for (j = 0; j < sizeof(rule->m_u) / sizeof(u16); j++)
 		if (((u16 *)&rule->m_u)[j] &&
-		    rule->type < ARRAY_SIZE(ice_prot_ext)) {
+		    (unsigned long long)rule->type < ARRAY_SIZE(ice_prot_ext)) {
 			/* No more space to accommodate */
 			if (word >= ICE_MAX_CHAIN_WORDS)
 				return 0;
drivers/net/ice/base/ice_vlan_mode.h +1 -0
index e9f13e781..bcb6ff713 100644
@@ -6,6 +6,7 @@
 #define _ICE_VLAN_MODE_H_
 
 #include "ice_osdep.h"
+#include "ice_status.h"
 
 struct ice_hw;
 
drivers/net/ice/base/meson.build +4 -0
index b82d05fe7..01f8f409d 100644
@@ -29,6 +29,10 @@ foreach flag: error_cflags
 	endif
 endforeach
 
+if is_windows and cc.get_id() != 'clang'
+	cflags += ['-fno-asynchronous-unwind-tables']
+endif
+
 base_lib = static_library('ice_base', sources,
 	dependencies: static_rte_eal,
 	c_args: c_args)
drivers/net/ice/ice_dcf_ethdev.c +0 -1
index e0772295e..af4731f55 100644
@@ -5,7 +5,6 @@
 #include <errno.h>
 #include <stdbool.h>
 #include <sys/types.h>
-#include <sys/ioctl.h>
 #include <unistd.h>
 
 #include <rte_interrupts.h>
drivers/net/ice/ice_dcf_parent.c +5 -5
index 476fd4906..a8571b35e 100644
@@ -121,7 +121,7 @@ ice_dcf_vsi_update_service_handler(void *param)
 	struct ice_dcf_hw *hw = reset_param->dcf_hw;
 	struct ice_dcf_adapter *adapter;
 
-	usleep(ICE_DCF_VSI_UPDATE_SERVICE_INTERVAL);
+	rte_delay_us(ICE_DCF_VSI_UPDATE_SERVICE_INTERVAL);
 
 	rte_spinlock_lock(&vsi_update_lock);
 
@@ -315,24 +315,24 @@ ice_dcf_request_pkg_name(struct ice_hw *hw, char *pkg_name)
 	snprintf(pkg_name, ICE_MAX_PKG_FILENAME_SIZE,
 		 ICE_PKG_FILE_SEARCH_PATH_UPDATES "ice-%016llx.pkg",
 		 (unsigned long long)dsn);
-	if (!access(pkg_name, 0))
+	if (!ice_access(pkg_name, 0))
 		return 0;
 
 	snprintf(pkg_name, ICE_MAX_PKG_FILENAME_SIZE,
 		 ICE_PKG_FILE_SEARCH_PATH_DEFAULT "ice-%016llx.pkg",
 		 (unsigned long long)dsn);
-	if (!access(pkg_name, 0))
+	if (!ice_access(pkg_name, 0))
 		return 0;
 
 pkg_file_direct:
 	snprintf(pkg_name,
 		 ICE_MAX_PKG_FILENAME_SIZE, "%s", ICE_PKG_FILE_UPDATES);
-	if (!access(pkg_name, 0))
+	if (!ice_access(pkg_name, 0))
 		return 0;
 
 	snprintf(pkg_name,
 		 ICE_MAX_PKG_FILENAME_SIZE, "%s", ICE_PKG_FILE_DEFAULT);
-	if (!access(pkg_name, 0))
+	if (!ice_access(pkg_name, 0))
 		return 0;
 
 	return -1;
drivers/net/ice/ice_ethdev.c +3 -3
index dfd99ace9..d22bc92ff 100644
@@ -1674,17 +1674,17 @@ ice_pkg_file_search_path(struct rte_pci_device *pci_dev, char *pkg_file)
 
 	strncpy(pkg_file, ICE_PKG_FILE_SEARCH_PATH_UPDATES,
 		ICE_MAX_PKG_FILENAME_SIZE);
-	if (!access(strcat(pkg_file, opt_ddp_filename), 0))
+	if (!ice_access(strcat(pkg_file, opt_ddp_filename), 0))
 		return 0;
 
 	strncpy(pkg_file, ICE_PKG_FILE_SEARCH_PATH_DEFAULT,
 		ICE_MAX_PKG_FILENAME_SIZE);
-	if (!access(strcat(pkg_file, opt_ddp_filename), 0))
+	if (!ice_access(strcat(pkg_file, opt_ddp_filename), 0))
 		return 0;
 
 fail_dsn:
 	strncpy(pkg_file, ICE_PKG_FILE_UPDATES, ICE_MAX_PKG_FILENAME_SIZE);
-	if (!access(pkg_file, 0))
+	if (!ice_access(pkg_file, 0))
 		return 0;
 	strncpy(pkg_file, ICE_PKG_FILE_DEFAULT, ICE_MAX_PKG_FILENAME_SIZE);
 	return 0;
drivers/net/ice/ice_rxtx_vec_avx2.c +1 -1
index 1cc54903c..25efd30e6 100644
@@ -4,7 +4,7 @@
 
 #include "ice_rxtx_vec_common.h"
 
-#include <x86intrin.h>
+#include <rte_vect.h>
 
 #ifndef __INTEL_COMPILER
 #pragma GCC diagnostic ignored "-Wcast-qual"
drivers/net/ice/ice_rxtx_vec_avx512.c +1 -1
index 0e5a676e6..835d0aa70 100644
@@ -4,7 +4,7 @@
 
 #include "ice_rxtx_vec_common.h"
 
-#include <x86intrin.h>
+#include <rte_vect.h>
 
 #ifndef __INTEL_COMPILER
 #pragma GCC diagnostic ignored "-Wcast-qual"
drivers/net/ice/meson.build +4 -6
index 9a67c8f7b..44ef64b4c 100644
@@ -1,12 +1,6 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
-if is_windows
-	build = false
-	reason = 'not supported on Windows'
-	subdir_done()
-endif
-
 subdir('base')
 objs = [base_objs]
 
@@ -26,6 +20,10 @@ includes += include_directories('base', '../../common/iavf')
 if arch_subdir == 'x86'
 	sources += files('ice_rxtx_vec_sse.c')
 
+	if is_windows and cc.get_id() != 'clang'
+		cflags += ['-fno-asynchronous-unwind-tables']
+	endif
+
 	# compile AVX2 version if either:
 	# a. we have AVX supported in minimum instruction set baseline
 	# b. it's not minimum instruction set, but supported by compiler
Signature · 1 line
2.18.0.windows.1
Acked-by on v2 2/3
#17 lore raw

Re: [dpdk-dev] [PATCH v2 2/3] net/ice: build on Windows

Quoted 13 lines · Pallavi Kadam

- Add Intel ice PMD support on Windows.
- Remove #include sys/ioctl header file as it is not needed.
- Replace x86intrin.h with rte_vect.h to avoid __m_prefetchw conflicting types.
- Replace POSIX usleep() API with rte API.
- Add a new macro for the access() API as the original function has been deprecated on Windows.
- Add extra cflags '-fno-asynchronous-unwind-tables'
to avoid MinGW build error:
Error: invalid register for .seh_savexmm
- Add documentation to support ice PMD on Windows.
Update the release notes and features list for the same.

Quoted 2 lines
Quoted 18 lines
---
 doc/guides/nics/features/ice.ini       |  1 +
 doc/guides/nics/ice.rst                | 18 ++++++++++++++++--
 doc/guides/rel_notes/release_21_05.rst |  4 ++++
 drivers/net/ice/base/ice_flow.c        |  2 +-
 drivers/net/ice/base/ice_flow.h        |  2 +-
 drivers/net/ice/base/ice_osdep.h       | 15 +++++++++++++++
 drivers/net/ice/base/ice_switch.c      |  2 +-
 drivers/net/ice/base/ice_vlan_mode.h   |  1 +
 drivers/net/ice/base/meson.build       |  4 ++++
 drivers/net/ice/ice_dcf_ethdev.c       |  1 -
 drivers/net/ice/ice_dcf_parent.c       | 10 +++++-----
 drivers/net/ice/ice_ethdev.c           |  6 +++---
 drivers/net/ice/ice_rxtx_vec_avx2.c    |  2 +-
 drivers/net/ice/ice_rxtx_vec_avx512.c  |  2 +-
 drivers/net/ice/meson.build            | 10 ++++------
 15 files changed, 58 insertions(+), 22 deletions(-)
#18 lore raw

Re: [dpdk-dev] [PATCH v2 2/3] net/ice: build on Windows

In reply to Pallavi Kadam
Quoted 15 lines · Pallavi Kadam

- Add Intel ice PMD support on Windows.
- Remove #include sys/ioctl header file as it is not needed.
- Replace x86intrin.h with rte_vect.h to avoid __m_prefetchw conflicting types.
- Replace POSIX usleep() API with rte API.
- Add a new macro for the access() API as the original function has been deprecated on Windows.
- Add extra cflags '-fno-asynchronous-unwind-tables'
to avoid MinGW build error:
Error: invalid register for .seh_savexmm
- Add documentation to support ice PMD on Windows.
Update the release notes and features list for the same.

<...>

drivers/net/ice/base/ice_switch.c ice_fill_valid_words(struct ice_adv_lkup_elem *rule, · line 6687

Quoted 8 lines
drivers/net/ice/base/ice_switch.c +1 -1
@@ -6684,7 +6684,7 @@ ice_fill_valid_words(struct ice_adv_lkup_elem *rule,
 
  	for (j = 0; j < sizeof(rule->m_u) / sizeof(u16); j++)
  		if (((u16 *)&rule->m_u)[j] &&
-		    rule->type < ARRAY_SIZE(ice_prot_ext)) {
+		    (unsigned long long)rule->type < ARRAY_SIZE(ice_prot_ext)) {

isn't 'ARRAY_SIZE' return type is 'size_t', if 'size_t' is supported in Windows why not cast to it, instead of "unsigned long long".

<...>

drivers/net/ice/base/meson.build foreach flag: error_cflags · line 35

Quoted 11 lines

index b82d05fe7..01f8f409d 100644

drivers/net/ice/base/meson.build +4 -0
@@ -29,6 +29,10 @@ foreach flag: error_cflags
  	endif
  endforeach
 
+if is_windows and cc.get_id() != 'clang'
+	cflags += ['-fno-asynchronous-unwind-tables']
+endif
+

This seems not having affect [1], may be because 'cflags' is not used for build but 'c_args', moving the block above "c_args = cflags" assignment may work.

[1]
http://mails.dpdk.org/archives/test-report/2021-March/182218.html

#19 lore raw

Re: [dpdk-dev] [PATCH v2 2/3] net/ice: build on Windows

Quoted 19 lines · Ferruh Yigit
Quoted 15 lines · Pallavi Kadam

- Add Intel ice PMD support on Windows.
- Remove #include sys/ioctl header file as it is not needed.
- Replace x86intrin.h with rte_vect.h to avoid __m_prefetchw conflicting types.
- Replace POSIX usleep() API with rte API.
- Add a new macro for the access() API as the original function has been deprecated on Windows.
- Add extra cflags '-fno-asynchronous-unwind-tables'
to avoid MinGW build error:
    Error: invalid register for .seh_savexmm
- Add documentation to support ice PMD on Windows.
Update the release notes and features list for the same.

<...>

Quoted 11 lines
Quoted 9 lines
drivers/net/ice/base/ice_switch.c +0 -0
@@ -6684,7 +6684,7 @@ ice_fill_valid_words(struct ice_adv_lkup_elem 
 *rule,
         for (j = 0; j < sizeof(rule->m_u) / sizeof(u16); j++)

          if (((u16 *)&rule->m_u)[j] &&
-            rule->type < ARRAY_SIZE(ice_prot_ext)) { +            (unsigned long long)rule->type < ARRAY_SIZE(ice_prot_ext)) {

isn't 'ARRAY_SIZE' return type is 'size_t', if 'size_t' is supported in Windows why not cast to it, instead of "unsigned long long".

Ok. Yes, size_t works on Windows. Will replace it in v3.

Quoted 16 lines

<...>

drivers/net/ice/base/meson.build

Quoted 10 lines

index b82d05fe7..01f8f409d 100644

drivers/net/ice/base/meson.build +0 -0
@@ -29,6 +29,10 @@ foreach flag: error_cflags

      endif
  endforeach
  +if is_windows and cc.get_id() != 'clang' +    cflags += ['-fno-asynchronous-unwind-tables']

drivers/net/ice/base/meson.build +2 -0
+endif
+

This seems not having affect [1], may be because 'cflags' is not used for build but 'c_args', moving the block above "c_args = cflags" assignment may work.

Quoted 2 lines

[1]
http://mails.dpdk.org/archives/test-report/2021-March/182218.html

Thanks, Ferrruh. Ok, will move this cflag above the assignment and give it a try.

Either way I am not able to reproduce this error. Let's see if UNH lab still reports it.

#20 lore raw

Re: [dpdk-dev] [PATCH v2 2/3] net/ice: build on Windows

In reply to Pallavi Kadam
Quoted 15 lines · Pallavi Kadam

- Add Intel ice PMD support on Windows.
- Remove #include sys/ioctl header file as it is not needed.
- Replace x86intrin.h with rte_vect.h to avoid __m_prefetchw conflicting types.
- Replace POSIX usleep() API with rte API.
- Add a new macro for the access() API as the original function has been deprecated on Windows.
- Add extra cflags '-fno-asynchronous-unwind-tables'
to avoid MinGW build error:
Error: invalid register for .seh_savexmm
- Add documentation to support ice PMD on Windows.
Update the release notes and features list for the same.

<...>

doc/guides/rel_notes/release_21_05.rst New Features · line 77

Quoted 12 lines

index 23f7f0bff..15b812ac5 100644

doc/guides/rel_notes/release_21_05.rst +4 -0
@@ -70,6 +70,10 @@ New Features
    * Added command to display Rx queue used descriptor count.
      ``show port (port_id) rxq (queue_id) desc used count``
 
+* **Updated Intel ice driver.**
+
+  * Added Intel ice support on Windows.
+
 

Can you please move the update just after 'Hisilicon' PMD update, we are trying to keep PMD updates in order base on vendor alphabetical order. Overall the release note update order is described more in the section comment of the document.

#21 lore raw

Re: [dpdk-dev] [PATCH v2 2/3] net/ice: build on Windows

Quoted 19 lines · Ferruh Yigit
Quoted 15 lines · Pallavi Kadam

- Add Intel ice PMD support on Windows.
- Remove #include sys/ioctl header file as it is not needed.
- Replace x86intrin.h with rte_vect.h to avoid __m_prefetchw conflicting types.
- Replace POSIX usleep() API with rte API.
- Add a new macro for the access() API as the original function has been deprecated on Windows.
- Add extra cflags '-fno-asynchronous-unwind-tables'
to avoid MinGW build error:
    Error: invalid register for .seh_savexmm
- Add documentation to support ice PMD on Windows.
Update the release notes and features list for the same.

<...>

Quoted 14 lines

doc/guides/rel_notes/release_21_05.rst New Features · line 76

Quoted 11 lines

index 23f7f0bff..15b812ac5 100644

doc/guides/rel_notes/release_21_05.rst +0 -0
@@ -70,6 +70,10 @@ New Features
     * Added command to display Rx queue used descriptor count.

      ``show port (port_id) rxq (queue_id) desc used count`` +* **Updated Intel ice driver.**

doc/guides/rel_notes/release_21_05.rst +3 -0
+
+  * Added Intel ice support on Windows.
+

Can you please move the update just after 'Hisilicon' PMD update, we are trying to keep PMD updates in order base on vendor alphabetical order. Overall the release note update order is described more in the section comment of the document.

Ok, I'll update the order in v3.

#22 lore raw

PATCH v2 3/3 net/ice: disable ice DDP package on Windows

In reply to Pallavi Kadam

Disable loading of external DDP package as it is not supported on Windows.

---
 drivers/net/ice/ice_ethdev.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/ice/ice_ethdev.c +6 -0
index d22bc92ff..1f5f16d42 100644
@@ -1652,6 +1652,7 @@ ice_pf_setup(struct ice_pf *pf)
  * Extract device serial number from PCIe Configuration Space and
  * determine the pkg file path according to the DSN.
  */
+#ifndef RTE_EXEC_ENV_WINDOWS
 static int
 ice_pkg_file_search_path(struct rte_pci_device *pci_dev, char *pkg_file)
 {
@@ -1689,6 +1690,7 @@ ice_pkg_file_search_path(struct rte_pci_device *pci_dev, char *pkg_file)
 	strncpy(pkg_file, ICE_PKG_FILE_DEFAULT, ICE_MAX_PKG_FILENAME_SIZE);
 	return 0;
 }
+#endif
 
 enum ice_pkg_type
 ice_load_pkg_type(struct ice_hw *hw)
@@ -1714,6 +1716,7 @@ ice_load_pkg_type(struct ice_hw *hw)
 	return package_type;
 }
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 static int ice_load_pkg(struct rte_eth_dev *dev)
 {
 	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
@@ -1785,6 +1788,7 @@ static int ice_load_pkg(struct rte_eth_dev *dev)
 	rte_free(buf);
 	return err;
 }
+#endif
 
 static void
 ice_base_queue_get(struct ice_pf *pf)
@@ -2065,6 +2069,7 @@ ice_dev_init(struct rte_eth_dev *dev)
 		return -EINVAL;
 	}
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 	ret = ice_load_pkg(dev);
 	if (ret) {
 		if (ad->devargs.safe_mode_support == 0) {
@@ -2077,6 +2082,7 @@ ice_dev_init(struct rte_eth_dev *dev)
 					"Entering Safe Mode");
 		ad->is_safe_mode = 1;
 	}
+#endif
 
 	PMD_INIT_LOG(INFO, "FW %d.%d.%05d API %d.%d",
 		     hw->fw_maj_ver, hw->fw_min_ver, hw->fw_build,
Signature · 1 line
2.18.0.windows.1
#25 lore raw

Re: [dpdk-dev] [PATCH v2 3/3] net/ice: disable ice DDP package on Windows

Quoted 6 lines · Ferruh Yigit
Quoted 3 lines · Pallavi Kadam

Disable loading of external DDP package as it is not supported on Windows.

Should this be documented in driver documentation as Windows support limitation?

We have mentioned about it in Windows prerequisite section.

Yes, we can include it in the Windows limitation section as well. Will add it in v3.

Quoted 7 lines
Quoted 3 lines

<...>

#26 lore raw

v3 cover Support ice PMD on Windows

In reply to Pallavi Kadam

This patch-set enables building the Intel ice PMD on Windows.

v3 changes:
- Rebase on latest head
- Replaced 'unsigned long long' with 'size_t'
- Moved cflag '-fno-asynchronous-unwind-tables' above the assignment "c_args = cflags"
- Updated release notes to add ice support on Windows in alphabetical order
- Added a note on Windows limitation in ice driver document

v2 changes:
- Updated patch#1 title to reflect the iavf base code support
- Added cflag '-fno-asynchronous-unwind-tables' to base driver
- Updated doc patch with the DDP documentation and integrated it with the respective code commit

Pallavi Kadam (3):
build: enable iavf base code to build on windows net/ice: build on Windows
net/ice: disable ice DDP package on Windows

 doc/guides/nics/features/ice.ini       |  1 +
 doc/guides/nics/ice.rst                | 23 +++++++++++++++++++++--
 doc/guides/rel_notes/release_21_05.rst |  4 ++++
 drivers/common/cpt/meson.build         |  6 ++++++
 drivers/common/iavf/iavf_osdep.h       |  9 +++++++++
 drivers/common/meson.build             |  3 ---
 drivers/common/mvep/meson.build        |  6 ++++++
 drivers/common/octeontx/meson.build    |  6 ++++++
 drivers/common/octeontx2/meson.build   |  6 ++++++
 drivers/common/qat/meson.build         |  6 ++++++
 drivers/net/ice/base/ice_flow.c        |  2 +-
 drivers/net/ice/base/ice_flow.h        |  2 +-
 drivers/net/ice/base/ice_osdep.h       | 15 +++++++++++++++
 drivers/net/ice/base/ice_switch.c      |  2 +-
 drivers/net/ice/base/ice_vlan_mode.h   |  1 +
 drivers/net/ice/base/meson.build       |  5 +++++
 drivers/net/ice/ice_dcf_ethdev.c       |  1 -
 drivers/net/ice/ice_dcf_parent.c       | 10 +++++-----
 drivers/net/ice/ice_ethdev.c           | 12 +++++++++---
 drivers/net/ice/ice_rxtx_vec_avx2.c    |  2 +-
 drivers/net/ice/ice_rxtx_vec_avx512.c  |  2 +-
 drivers/net/ice/meson.build            | 10 ++++------
 22 files changed, 109 insertions(+), 25 deletions(-)
Signature · 1 line
2.18.0.windows.1
#27 lore raw

PATCH v3 1/3 build: enable iavf base code to build on windows

Enable IAVF driver to build on Windows as it is required to build ice PMD.
Disable all other drivers from common directory. This patch also includes fix for a macro redefinition warning in the IAVF driver.

---
 drivers/common/cpt/meson.build       | 6 ++++++
 drivers/common/iavf/iavf_osdep.h     | 9 +++++++++
 drivers/common/meson.build           | 3 ---
 drivers/common/mvep/meson.build      | 6 ++++++
 drivers/common/octeontx/meson.build  | 6 ++++++
 drivers/common/octeontx2/meson.build | 6 ++++++
 drivers/common/qat/meson.build       | 6 ++++++
 7 files changed, 39 insertions(+), 3 deletions(-)
drivers/common/cpt/meson.build +6 -0
index beecf0da3..1127267ba 100644
@@ -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
+
 sources = files('cpt_fpm_tables.c',
 		'cpt_pmd_ops_helper.c')
 
drivers/common/iavf/iavf_osdep.h +9 -0
index eaefde88e..76c186a5b 100644
@@ -55,6 +55,15 @@ typedef uint64_t        s64;
 #define __be64          uint64_t
 #endif
 
+/* Avoid macro redefinition warning on Windows */
+#ifdef RTE_EXEC_ENV_WINDOWS
+#ifdef min
+#undef min
+#endif
+#ifdef max
+#undef max
+#endif
+#endif
 #define min(a, b) RTE_MIN(a, b)
 #define max(a, b) RTE_MAX(a, b)
 
drivers/common/meson.build +0 -3
index 66e12143b..438302e76 100644
@@ -1,9 +1,6 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Cavium, Inc
 
-if is_windows
-	subdir_done()
-endif
 
 std_deps = ['eal']
 drivers = ['cpt', 'dpaax', 'iavf', 'mvep', 'octeontx', 'octeontx2']
drivers/common/mvep/meson.build +6 -0
index 7cd968b38..a929e2311 100644
@@ -4,6 +4,12 @@
 # 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
drivers/common/octeontx/meson.build +6 -0
index 203d1ef49..02b57b95c 100644
@@ -2,4 +2,10 @@
 # Copyright(c) 2018 Cavium, Inc
 #
 
+if is_windows
+	build = false
+	reason = 'not supported on Windows'
+	subdir_done()
+endif
+
 sources = files('octeontx_mbox.c')
drivers/common/octeontx2/meson.build +6 -0
index 84fb11524..97293d1a7 100644
@@ -2,6 +2,12 @@
 # Copyright(C) 2019 Marvell International Ltd.
 #
 
+if is_windows
+	build = false
+	reason = 'not supported on Windows'
+	subdir_done()
+endif
+
 if not dpdk_conf.get('RTE_ARCH_64')
 	build = false
 	reason = 'only supported on 64-bit'
drivers/common/qat/meson.build +6 -0
index 67f7aca97..3ad7dd501 100644
@@ -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
+
 qat_crypto = true
 qat_crypto_path = 'crypto/qat'
 qat_crypto_relpath = '../../' + qat_crypto_path
Signature · 1 line
2.18.0.windows.1
#28 lore raw

PATCH v3 2/3 net/ice: build on Windows

In reply to Pallavi Kadam

- Add Intel ice PMD support on Windows.
- Remove #include sys/ioctl header file as it is not needed.
- Replace x86intrin.h with rte_vect.h to avoid __m_prefetchw conflicting types.
- Replace POSIX usleep() API with rte API.
- Add a new macro for the access() API as the original function has been deprecated on Windows.
- Add extra cflags '-fno-asynchronous-unwind-tables'
to avoid MinGW build error:
Error: invalid register for .seh_savexmm
- Add documentation to support ice PMD on Windows.
Update the release notes and features list for the same.

---
 doc/guides/nics/features/ice.ini       |  1 +
 doc/guides/nics/ice.rst                | 18 ++++++++++++++++--
 doc/guides/rel_notes/release_21_05.rst |  4 ++++
 drivers/net/ice/base/ice_flow.c        |  2 +-
 drivers/net/ice/base/ice_flow.h        |  2 +-
 drivers/net/ice/base/ice_osdep.h       | 15 +++++++++++++++
 drivers/net/ice/base/ice_switch.c      |  2 +-
 drivers/net/ice/base/ice_vlan_mode.h   |  1 +
 drivers/net/ice/base/meson.build       |  5 +++++
 drivers/net/ice/ice_dcf_ethdev.c       |  1 -
 drivers/net/ice/ice_dcf_parent.c       | 10 +++++-----
 drivers/net/ice/ice_ethdev.c           |  6 +++---
 drivers/net/ice/ice_rxtx_vec_avx2.c    |  2 +-
 drivers/net/ice/ice_rxtx_vec_avx512.c  |  2 +-
 drivers/net/ice/meson.build            | 10 ++++------
 15 files changed, 59 insertions(+), 22 deletions(-)
doc/guides/nics/features/ice.ini +1 -0
index e30a7d2e5..2b93872b1 100644
@@ -40,5 +40,6 @@ Module EEPROM dump   = Y
 Multiprocess aware   = Y
 FreeBSD              = Y
 Linux                = Y
+Windows              = Y
 x86-32               = Y
 x86-64               = Y
doc/guides/nics/ice.rst +16 -2
index ccda26f82..100086132 100644
@@ -8,8 +8,8 @@ The ice PMD (**librte_net_ice**) provides poll mode driver support for
 10/25/50/100 Gbps Intel® Ethernet 800 Series Network Adapters based on
 the Intel Ethernet Controller E810 and Intel Ethernet Connection E822/E823.
 
-Prerequisites
--------------
+Linux Prerequisites
+-------------------
 
 - Follow the DPDK :ref:`Getting Started Guide for Linux <linux_gsg>` to setup the basic DPDK environment.
 
@@ -25,6 +25,20 @@ Prerequisites
 - To understand DDP for COMMs usage with DPDK, please review `Intel® Ethernet 800 Series Telecommunication (Comms)
   Dynamic Device Personalization (DDP) Package <https://cdrdv2.intel.com/v1/dl/getContent/618651>`_.
 
+Windows Prerequisites
+---------------------
+
+- Follow the DPDK `Getting Started Guide for Windows <https://doc.dpdk.org/guides/windows_gsg/index.html>`_ to setup the basic DPDK environment.
+
+- Identify the Intel® Ethernet adapter and get the latest NVM/FW version.
+
+- To access any Intel® Ethernet hardware, load the NetUIO driver in place of existing built-in (inbox) driver.
+
+- To load NetUIO driver, follow the steps mentioned in `dpdk-kmods repository
+  <https://git.dpdk.org/dpdk-kmods/tree/windows/netuio/README.rst>`_.
+
+- Loading of private Dynamic Device Personalization (DDP) package is not supported on Windows.
+
 
 Recommended Matching List
 -------------------------
doc/guides/rel_notes/release_21_05.rst +4 -0
index 19cec62c7..935ac088b 100644
@@ -97,6 +97,10 @@ New Features
 
   * Added flow filter to support GTPU inner L3/L4 fields matching.
 
+* **Updated Intel ice driver.**
+
+  * Added Intel ice support on Windows.
+
 * **Updated NXP DPAA driver.**
 
   * Added support for shared ethernet interface.
drivers/net/ice/base/ice_flow.c +1 -1
index bceb257d6..c12ddfa24 100644
@@ -3144,7 +3144,7 @@ enum ice_status ice_flow_rem_entry(struct ice_hw *hw, enum ice_block blk,
 	if (entry_h == ICE_FLOW_ENTRY_HANDLE_INVAL)
 		return ICE_ERR_PARAM;
 
-	entry = ICE_FLOW_ENTRY_PTR((unsigned long)entry_h);
+	entry = ICE_FLOW_ENTRY_PTR((intptr_t)entry_h);
 
 	/* Retain the pointer to the flow profile as the entry will be freed */
 	prof = entry->prof;
drivers/net/ice/base/ice_flow.h +1 -1
index c3bce1319..af15ecb0f 100644
@@ -446,7 +446,7 @@ struct ice_flow_entry {
 	u8 acts_cnt;
 };
 
-#define ICE_FLOW_ENTRY_HNDL(e)	((unsigned long)e)
+#define ICE_FLOW_ENTRY_HNDL(e)	((intptr_t)e)
 #define ICE_FLOW_ENTRY_PTR(h)	((struct ice_flow_entry *)(h))
 
 struct ice_flow_prof {
drivers/net/ice/base/ice_osdep.h +15 -0
index 46ac86834..f4cc762e9 100644
@@ -62,9 +62,24 @@ typedef uint64_t        s64;
 #define __be64          uint64_t
 #endif
 
+/* Avoid macro redefinition warning on Windows */
+#ifdef RTE_EXEC_ENV_WINDOWS
+#ifdef min
+#undef min
+#endif
+#ifdef max
+#undef max
+#endif
+#endif
 #define min(a, b) RTE_MIN(a, b)
 #define max(a, b) RTE_MAX(a, b)
 
+#ifdef RTE_EXEC_ENV_WINDOWS
+#define ice_access _access
+#else
+#define ice_access access
+#endif
+
 #define FIELD_SIZEOF(t, f) RTE_SIZEOF_FIELD(t, f)
 #define ARRAY_SIZE(arr) RTE_DIM(arr)
 
drivers/net/ice/base/ice_switch.c +1 -1
index 3dc764266..9233c5fd2 100644
@@ -6683,7 +6683,7 @@ ice_fill_valid_words(struct ice_adv_lkup_elem *rule,
 
 	for (j = 0; j < sizeof(rule->m_u) / sizeof(u16); j++)
 		if (((u16 *)&rule->m_u)[j] &&
-		    rule->type < ARRAY_SIZE(ice_prot_ext)) {
+		    (size_t)rule->type < ARRAY_SIZE(ice_prot_ext)) {
 			/* No more space to accommodate */
 			if (word >= ICE_MAX_CHAIN_WORDS)
 				return 0;
drivers/net/ice/base/ice_vlan_mode.h +1 -0
index e9f13e781..bcb6ff713 100644
@@ -6,6 +6,7 @@
 #define _ICE_VLAN_MODE_H_
 
 #include "ice_osdep.h"
+#include "ice_status.h"
 
 struct ice_hw;
 
drivers/net/ice/base/meson.build +5 -0
index b82d05fe7..c44d0e035 100644
@@ -21,6 +21,11 @@ error_cflags = ['-Wno-unused-value',
 		'-Wno-unused-variable',
 		'-Wno-unused-parameter',
 ]
+
+if is_windows and cc.get_id() != 'clang'
+	cflags += ['-fno-asynchronous-unwind-tables']
+endif
+
 c_args = cflags
 
 foreach flag: error_cflags
drivers/net/ice/ice_dcf_ethdev.c +0 -1
index 215d71e1b..b937cbbb0 100644
@@ -5,7 +5,6 @@
 #include <errno.h>
 #include <stdbool.h>
 #include <sys/types.h>
-#include <sys/ioctl.h>
 #include <unistd.h>
 
 #include <rte_interrupts.h>
drivers/net/ice/ice_dcf_parent.c +5 -5
index 476fd4906..a8571b35e 100644
@@ -121,7 +121,7 @@ ice_dcf_vsi_update_service_handler(void *param)
 	struct ice_dcf_hw *hw = reset_param->dcf_hw;
 	struct ice_dcf_adapter *adapter;
 
-	usleep(ICE_DCF_VSI_UPDATE_SERVICE_INTERVAL);
+	rte_delay_us(ICE_DCF_VSI_UPDATE_SERVICE_INTERVAL);
 
 	rte_spinlock_lock(&vsi_update_lock);
 
@@ -315,24 +315,24 @@ ice_dcf_request_pkg_name(struct ice_hw *hw, char *pkg_name)
 	snprintf(pkg_name, ICE_MAX_PKG_FILENAME_SIZE,
 		 ICE_PKG_FILE_SEARCH_PATH_UPDATES "ice-%016llx.pkg",
 		 (unsigned long long)dsn);
-	if (!access(pkg_name, 0))
+	if (!ice_access(pkg_name, 0))
 		return 0;
 
 	snprintf(pkg_name, ICE_MAX_PKG_FILENAME_SIZE,
 		 ICE_PKG_FILE_SEARCH_PATH_DEFAULT "ice-%016llx.pkg",
 		 (unsigned long long)dsn);
-	if (!access(pkg_name, 0))
+	if (!ice_access(pkg_name, 0))
 		return 0;
 
 pkg_file_direct:
 	snprintf(pkg_name,
 		 ICE_MAX_PKG_FILENAME_SIZE, "%s", ICE_PKG_FILE_UPDATES);
-	if (!access(pkg_name, 0))
+	if (!ice_access(pkg_name, 0))
 		return 0;
 
 	snprintf(pkg_name,
 		 ICE_MAX_PKG_FILENAME_SIZE, "%s", ICE_PKG_FILE_DEFAULT);
-	if (!access(pkg_name, 0))
+	if (!ice_access(pkg_name, 0))
 		return 0;
 
 	return -1;
drivers/net/ice/ice_ethdev.c +3 -3
index f0dc54357..81558fd8d 100644
@@ -1678,17 +1678,17 @@ ice_pkg_file_search_path(struct rte_pci_device *pci_dev, char *pkg_file)
 
 	strncpy(pkg_file, ICE_PKG_FILE_SEARCH_PATH_UPDATES,
 		ICE_MAX_PKG_FILENAME_SIZE);
-	if (!access(strcat(pkg_file, opt_ddp_filename), 0))
+	if (!ice_access(strcat(pkg_file, opt_ddp_filename), 0))
 		return 0;
 
 	strncpy(pkg_file, ICE_PKG_FILE_SEARCH_PATH_DEFAULT,
 		ICE_MAX_PKG_FILENAME_SIZE);
-	if (!access(strcat(pkg_file, opt_ddp_filename), 0))
+	if (!ice_access(strcat(pkg_file, opt_ddp_filename), 0))
 		return 0;
 
 fail_dsn:
 	strncpy(pkg_file, ICE_PKG_FILE_UPDATES, ICE_MAX_PKG_FILENAME_SIZE);
-	if (!access(pkg_file, 0))
+	if (!ice_access(pkg_file, 0))
 		return 0;
 	strncpy(pkg_file, ICE_PKG_FILE_DEFAULT, ICE_MAX_PKG_FILENAME_SIZE);
 	return 0;
drivers/net/ice/ice_rxtx_vec_avx2.c +1 -1
index 1cc54903c..25efd30e6 100644
@@ -4,7 +4,7 @@
 
 #include "ice_rxtx_vec_common.h"
 
-#include <x86intrin.h>
+#include <rte_vect.h>
 
 #ifndef __INTEL_COMPILER
 #pragma GCC diagnostic ignored "-Wcast-qual"
drivers/net/ice/ice_rxtx_vec_avx512.c +1 -1
index 0e5a676e6..835d0aa70 100644
@@ -4,7 +4,7 @@
 
 #include "ice_rxtx_vec_common.h"
 
-#include <x86intrin.h>
+#include <rte_vect.h>
 
 #ifndef __INTEL_COMPILER
 #pragma GCC diagnostic ignored "-Wcast-qual"
drivers/net/ice/meson.build +4 -6
index 9a67c8f7b..44ef64b4c 100644
@@ -1,12 +1,6 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
-if is_windows
-	build = false
-	reason = 'not supported on Windows'
-	subdir_done()
-endif
-
 subdir('base')
 objs = [base_objs]
 
@@ -26,6 +20,10 @@ includes += include_directories('base', '../../common/iavf')
 if arch_subdir == 'x86'
 	sources += files('ice_rxtx_vec_sse.c')
 
+	if is_windows and cc.get_id() != 'clang'
+		cflags += ['-fno-asynchronous-unwind-tables']
+	endif
+
 	# compile AVX2 version if either:
 	# a. we have AVX supported in minimum instruction set baseline
 	# b. it's not minimum instruction set, but supported by compiler
Signature · 1 line
2.18.0.windows.1
#29 lore raw

PATCH v3 3/3 net/ice: disable ice DDP package on Windows

In reply to Pallavi Kadam

Disable loading of external DDP package as it is not supported on Windows.

---
 doc/guides/nics/ice.rst      | 5 +++++
 drivers/net/ice/ice_ethdev.c | 6 ++++++
 2 files changed, 11 insertions(+)
doc/guides/nics/ice.rst +5 -0
index 100086132..8d40d1741 100644
@@ -330,3 +330,8 @@ is stored in ``ice_adapter->active_pkg_type``.
 
 A symbolic link to the DDP package file is also ok. The same package
 file is used by both the kernel driver and the DPDK PMD.
+
+   .. Note::
+
+      Windows support: The DDP package is not supported on Windows so,
+      loading of the package is disabled on Windows.
drivers/net/ice/ice_ethdev.c +6 -0
index 81558fd8d..1dea6421c 100644
@@ -1650,6 +1650,7 @@ ice_pf_setup(struct ice_pf *pf)
  * Extract device serial number from PCIe Configuration Space and
  * determine the pkg file path according to the DSN.
  */
+#ifndef RTE_EXEC_ENV_WINDOWS
 static int
 ice_pkg_file_search_path(struct rte_pci_device *pci_dev, char *pkg_file)
 {
@@ -1693,6 +1694,7 @@ ice_pkg_file_search_path(struct rte_pci_device *pci_dev, char *pkg_file)
 	strncpy(pkg_file, ICE_PKG_FILE_DEFAULT, ICE_MAX_PKG_FILENAME_SIZE);
 	return 0;
 }
+#endif
 
 enum ice_pkg_type
 ice_load_pkg_type(struct ice_hw *hw)
@@ -1718,6 +1720,7 @@ ice_load_pkg_type(struct ice_hw *hw)
 	return package_type;
 }
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 static int ice_load_pkg(struct rte_eth_dev *dev)
 {
 	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
@@ -1793,6 +1796,7 @@ static int ice_load_pkg(struct rte_eth_dev *dev)
 	rte_free(buf);
 	return err;
 }
+#endif
 
 static void
 ice_base_queue_get(struct ice_pf *pf)
@@ -2073,6 +2077,7 @@ ice_dev_init(struct rte_eth_dev *dev)
 		return -EINVAL;
 	}
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 	ret = ice_load_pkg(dev);
 	if (ret) {
 		if (ad->devargs.safe_mode_support == 0) {
@@ -2085,6 +2090,7 @@ ice_dev_init(struct rte_eth_dev *dev)
 					"Entering Safe Mode");
 		ad->is_safe_mode = 1;
 	}
+#endif
 
 	PMD_INIT_LOG(INFO, "FW %d.%d.%05d API %d.%d",
 		     hw->fw_maj_ver, hw->fw_min_ver, hw->fw_build,
Signature · 1 line
2.18.0.windows.1
Reviewed-by on the v3 series
#30 lore raw
In reply to Pallavi Kadam
Quoted 17 lines · Pallavi Kadam

This patch-set enables building the Intel ice PMD on Windows.

v3 changes:
- Rebase on latest head
- Replaced 'unsigned long long' with 'size_t'
- Moved cflag '-fno-asynchronous-unwind-tables' above the assignment "c_args = cflags"
- Updated release notes to add ice support on Windows in alphabetical order
- Added a note on Windows limitation in ice driver document

v2 changes:
- Updated patch#1 title to reflect the iavf base code support
- Added cflag '-fno-asynchronous-unwind-tables' to base driver
- Updated doc patch with the DDP documentation and integrated it with the respective code commit

Quoted 5 lines

Pallavi Kadam (3):
build: enable iavf base code to build on windows net/ice: build on Windows
net/ice: disable ice DDP package on Windows

For series,

#31 lore raw
Quoted 18 lines · Ferruh Yigit
Quoted 17 lines · Pallavi Kadam

This patch-set enables building the Intel ice PMD on Windows.

v3 changes:
    - Rebase on latest head
    - Replaced 'unsigned long long' with 'size_t'
    - Moved cflag '-fno-asynchronous-unwind-tables' above the assignment "c_args = cflags"
    - Updated release notes to add ice support on Windows in alphabetical order
    - Added a note on Windows limitation in ice driver document

v2 changes:
    - Updated patch#1 title to reflect the iavf base code support
    - Added cflag '-fno-asynchronous-unwind-tables' to base driver
    - Updated doc patch with the DDP documentation and integrated it with the respective code commit

Quoted 8 lines
Quoted 5 lines

Pallavi Kadam (3):
   build: enable iavf base code to build on windows net/ice: build on Windows
   net/ice: disable ice DDP package on Windows

For series,

Series applied to dpdk-next-net/main, thanks.