DPDK patches and discussions
 help / color / mirror / Atom feed
From: William Tu <u9012063@gmail.com>
To: dev@dpdk.org
Cc: Pallavi Kadam <pallavi.kadam@intel.com>,
	Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Subject: [dpdk-dev] [PATCH v5 4/4] net/ixgbe: build on Windows
Date: Wed,  6 Oct 2021 22:35:44 +0000	[thread overview]
Message-ID: <20211006223544.1882-5-u9012063@gmail.com> (raw)
In-Reply-To: <20211006223544.1882-1-u9012063@gmail.com>

This patch enables building the ixgbe driver for Windows.
It also enables its dependencies on security and cryptodev.
I tested on AWS using ixgbe VF device, using dpdk-testpmd.

Signed-off-by: William Tu <u9012063@gmail.com>
Acked-by: Pallavi Kadam <pallavi.kadam@intel.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
---
 doc/guides/nics/features/ixgbe.ini     |  1 +
 doc/guides/nics/features/ixgbe_vf.ini  |  1 +
 doc/guides/nics/ixgbe.rst              | 19 +++++++++++++++++--
 doc/guides/rel_notes/release_21_11.rst |  4 ++++
 drivers/net/ixgbe/base/ixgbe_hv_vf.c   |  1 +
 drivers/net/ixgbe/base/ixgbe_osdep.h   |  9 +++++++++
 drivers/net/ixgbe/base/meson.build     |  2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c       |  2 +-
 drivers/net/ixgbe/ixgbe_ethdev.h       |  1 +
 drivers/net/ixgbe/ixgbe_flow.c         |  2 +-
 drivers/net/ixgbe/ixgbe_tm.c           |  2 +-
 drivers/net/ixgbe/meson.build          |  9 +++------
 12 files changed, 41 insertions(+), 12 deletions(-)

diff --git a/doc/guides/nics/features/ixgbe.ini b/doc/guides/nics/features/ixgbe.ini
index aa947b510f..a29d01fe6f 100644
--- a/doc/guides/nics/features/ixgbe.ini
+++ b/doc/guides/nics/features/ixgbe.ini
@@ -52,6 +52,7 @@ Registers dump       = Y
 Multiprocess aware   = Y
 FreeBSD              = Y
 Linux                = Y
+Windows              = Y
 ARMv8                = Y
 x86-32               = Y
 x86-64               = Y
diff --git a/doc/guides/nics/features/ixgbe_vf.ini b/doc/guides/nics/features/ixgbe_vf.ini
index 32fb1b7ac8..9241aebd21 100644
--- a/doc/guides/nics/features/ixgbe_vf.ini
+++ b/doc/guides/nics/features/ixgbe_vf.ini
@@ -36,6 +36,7 @@ Registers dump       = Y
 Multiprocess aware   = Y
 FreeBSD              = Y
 Linux                = Y
+Windows              = Y
 ARMv8                = Y
 x86-32               = Y
 x86-64               = Y
diff --git a/doc/guides/nics/ixgbe.rst b/doc/guides/nics/ixgbe.rst
index b82e634382..b7fdc52882 100644
--- a/doc/guides/nics/ixgbe.rst
+++ b/doc/guides/nics/ixgbe.rst
@@ -22,8 +22,8 @@ The following sections explain RX and TX constraints in the vPMD.
 RX Constraints
 ~~~~~~~~~~~~~~
 
-Prerequisites and Pre-conditions
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Linux Prerequisites and Pre-conditions
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 The following prerequisites apply:
 
@@ -47,6 +47,21 @@ vPMD for RX would be disabled.
 
 By default, IXGBE_MAX_RING_DESC is set to 4096 and RTE_PMD_IXGBE_RX_MAX_BURST is set to 32.
 
+Windows Prerequisites and Pre-conditions
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+- 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.
+
+
 Feature not Supported by RX Vector PMD
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index dfc2cbdeed..efeffe37a0 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -85,6 +85,10 @@ New Features
   * Added DEV_RX_OFFLOAD_TIMESTAMP support.
   * Added timesync API support under scalar path.
 
+* **Updated Intel ixgbe driver.**
+
+  * Added Intel ixgbe support on Windows.
+
 * **Updated Marvell cnxk ethdev driver.**
 
   * Added rte_flow support for dual VLAN insert and strip actions.
diff --git a/drivers/net/ixgbe/base/ixgbe_hv_vf.c b/drivers/net/ixgbe/base/ixgbe_hv_vf.c
index b7ad44ab8c..4572411d39 100644
--- a/drivers/net/ixgbe/base/ixgbe_hv_vf.c
+++ b/drivers/net/ixgbe/base/ixgbe_hv_vf.c
@@ -4,6 +4,7 @@
 
 #include "ixgbe_vf.h"
 #include "ixgbe_hv_vf.h"
+#include "ixgbe_osdep.h"
 
 /**
  * Hyper-V variant - just a stub.
diff --git a/drivers/net/ixgbe/base/ixgbe_osdep.h b/drivers/net/ixgbe/base/ixgbe_osdep.h
index cacf724198..6c25f608b1 100644
--- a/drivers/net/ixgbe/base/ixgbe_osdep.h
+++ b/drivers/net/ixgbe/base/ixgbe_osdep.h
@@ -16,10 +16,15 @@
 #include <rte_log.h>
 #include <rte_byteorder.h>
 #include <rte_io.h>
+#include <rte_ip.h>
 
 #include "../ixgbe_logs.h"
 #include "../ixgbe_bypass_defines.h"
 
+#ifndef IPPROTO_SCTP
+#define IPPROTO_SCTP 132
+#endif
+
 #define ASSERT(x) if(!(x)) rte_panic("IXGBE: x")
 
 #define DELAY(x) rte_delay_us_sleep(x)
@@ -43,12 +48,16 @@
 
 #define false               0
 #define true                1
+#ifndef RTE_EXEC_ENV_WINDOWS
 #define min(a,b)	RTE_MIN(a,b) 
+#endif
 
 #define EWARN(hw, S, args...)     DEBUGOUT1(S, ##args)
 
 /* Bunch of defines for shared code bogosity */
+#ifndef UNREFERENCED_PARAMETER
 #define UNREFERENCED_PARAMETER(_p)  
+#endif
 #define UNREFERENCED_1PARAMETER(_p) 
 #define UNREFERENCED_2PARAMETER(_p, _q)
 #define UNREFERENCED_3PARAMETER(_p, _q, _r) 
diff --git a/drivers/net/ixgbe/base/meson.build b/drivers/net/ixgbe/base/meson.build
index 22972c6b56..f6497014da 100644
--- a/drivers/net/ixgbe/base/meson.build
+++ b/drivers/net/ixgbe/base/meson.build
@@ -29,6 +29,6 @@ foreach flag: error_cflags
 endforeach
 
 base_lib = static_library('ixgbe_base', sources,
-    dependencies: static_rte_eal,
+    dependencies: [static_rte_eal, static_rte_net],
     c_args: c_args)
 base_objs = base_lib.extract_all_objects(recursive: true)
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 47693c0c47..8b33897ca1 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -10,7 +10,6 @@
 #include <unistd.h>
 #include <stdarg.h>
 #include <inttypes.h>
-#include <netinet/in.h>
 #include <rte_string_fns.h>
 #include <rte_byteorder.h>
 #include <rte_common.h>
@@ -46,6 +45,7 @@
 #include "ixgbe_rxtx.h"
 #include "base/ixgbe_type.h"
 #include "base/ixgbe_phy.h"
+#include "base/ixgbe_osdep.h"
 #include "ixgbe_regs.h"
 
 /*
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h
index a0ce18ca24..645207e130 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.h
+++ b/drivers/net/ixgbe/ixgbe_ethdev.h
@@ -6,6 +6,7 @@
 #define _IXGBE_ETHDEV_H_
 
 #include <stdint.h>
+#include <sys/queue.h>
 
 #include "base/ixgbe_type.h"
 #include "base/ixgbe_dcb.h"
diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
index 511b612f7f..27322ab903 100644
--- a/drivers/net/ixgbe/ixgbe_flow.c
+++ b/drivers/net/ixgbe/ixgbe_flow.c
@@ -10,7 +10,6 @@
 #include <unistd.h>
 #include <stdarg.h>
 #include <inttypes.h>
-#include <netinet/in.h>
 #include <rte_byteorder.h>
 #include <rte_common.h>
 #include <rte_cycles.h>
@@ -37,6 +36,7 @@
 #include "base/ixgbe_api.h"
 #include "base/ixgbe_vf.h"
 #include "base/ixgbe_common.h"
+#include "base/ixgbe_osdep.h"
 #include "ixgbe_ethdev.h"
 #include "ixgbe_bypass.h"
 #include "ixgbe_rxtx.h"
diff --git a/drivers/net/ixgbe/ixgbe_tm.c b/drivers/net/ixgbe/ixgbe_tm.c
index a8407e742e..ae03ea6e9d 100644
--- a/drivers/net/ixgbe/ixgbe_tm.c
+++ b/drivers/net/ixgbe/ixgbe_tm.c
@@ -665,7 +665,7 @@ ixgbe_node_add(struct rte_eth_dev *dev, uint32_t node_id,
 	}
 	/* check level */
 	if (level_id != RTE_TM_NODE_LEVEL_ID_ANY &&
-	    level_id != parent_node_type + 1) {
+	    level_id != (uint32_t)parent_node_type + 1) {
 		error->type = RTE_TM_ERROR_TYPE_NODE_PARAMS;
 		error->message = "Wrong level";
 		return -EINVAL;
diff --git a/drivers/net/ixgbe/meson.build b/drivers/net/ixgbe/meson.build
index 55ac91fcd1..162f8d5f46 100644
--- a/drivers/net/ixgbe/meson.build
+++ b/drivers/net/ixgbe/meson.build
@@ -1,12 +1,6 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-if is_windows
-    build = false
-    reason = 'not supported on Windows'
-    subdir_done()
-endif
-
 cflags += ['-DRTE_LIBRTE_IXGBE_BYPASS']
 
 subdir('base')
@@ -30,6 +24,9 @@ deps += ['hash', 'security']
 
 if arch_subdir == 'x86'
     sources += files('ixgbe_rxtx_vec_sse.c')
+    if is_windows and cc.get_id() != 'clang'
+        cflags += ['-fno-asynchronous-unwind-tables']
+    endif
 elif arch_subdir == 'arm'
     sources += files('ixgbe_rxtx_vec_neon.c')
 endif
-- 
2.33.0.windows.2


  parent reply	other threads:[~2021-10-06 22:36 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-02  0:33 [dpdk-dev] [PATCH v3 0/4] net/ixgbe: Add support for Windows William Tu
2021-10-02  0:33 ` [dpdk-dev] [PATCH v3 1/4] security: use the net library for IP structs William Tu
2021-10-05 10:52   ` [dpdk-dev] [EXT] " Akhil Goyal
2021-10-02  0:33 ` [dpdk-dev] [PATCH v3 2/4] security: build on Windows William Tu
2021-10-05 10:53   ` [dpdk-dev] [EXT] " Akhil Goyal
2021-10-02  0:33 ` [dpdk-dev] [PATCH v3 3/4] cryptodev: " William Tu
2021-10-05 10:53   ` [dpdk-dev] [EXT] " Akhil Goyal
2021-10-02  0:33 ` [dpdk-dev] [PATCH v3 4/4] net/ixgbe: Add support for Windows William Tu
2021-10-01 19:03   ` Dmitry Kozlyuk
2021-10-05 17:02 ` [dpdk-dev] [PATCH v4 0/4] net/ixgbe: build on Windows William Tu
2021-10-05 17:02   ` [dpdk-dev] [PATCH v4 1/4] security: use the net library for IP structs William Tu
2021-10-05 17:02   ` [dpdk-dev] [PATCH v4 2/4] security: build on Windows William Tu
2021-10-05 17:02   ` [dpdk-dev] [PATCH v4 3/4] cryptodev: " William Tu
2021-10-05 17:02   ` [dpdk-dev] [PATCH v4 4/4] net/ixgbe: " William Tu
2021-10-05 22:52     ` Dmitry Kozlyuk
2021-10-06  5:32     ` Kadam, Pallavi
2021-10-06 21:26       ` William Tu
2021-10-06 12:09   ` [dpdk-dev] [PATCH v4 0/4] " David Marchand
2021-10-06 21:48     ` William Tu
2021-10-06 22:35   ` William Tu
2021-10-06 22:35     ` [dpdk-dev] [PATCH v5 1/4] security: use the net library for IP structs William Tu
2021-10-06 22:35     ` [dpdk-dev] [PATCH v5 2/4] security: build on Windows William Tu
2021-10-07  7:44       ` Thomas Monjalon
2021-10-06 22:35     ` [dpdk-dev] [PATCH v5 3/4] cryptodev: " William Tu
2021-10-06 22:35     ` William Tu [this message]
2021-10-07  7:51       ` [dpdk-dev] [PATCH v5 4/4] net/ixgbe: " Thomas Monjalon
2021-10-07 11:53     ` [dpdk-dev] [PATCH v4 0/4] " Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211006223544.1882-5-u9012063@gmail.com \
    --to=u9012063@gmail.com \
    --cc=dev@dpdk.org \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=pallavi.kadam@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).