Re: [dpdk-dev] [PATCH v6 5/5] net: replace Windows networking shim
From: Thomas Monjalon <hidden>
Date: 2021-03-26 09:28:47
20/03/2021 14:05, Dmitry Kozlyuk:
Remove networking shim from Windows EAL. Replace it with system headers with two workarounds: 1. Windows Sockets headers contain `#define s_addr S_un.S_addr`, which conflicts with `s_addr` field of `struct rte_ether_hdr`. Undefining this macro in <rte_ether.h> had been breaking some usages of DPDK and Windows headers in one file.
I don't understand this last sentence.
Renaming is planned: https://mails.dpdk.org/archives/dev/2021-March/201444.html Temporarily disable `s_addr` macro around `struct rte_ether_hdr` definition to avoid conflict. Place source MAC address in both `s_addr` and `S_un.S_addr` fields, so that access works either directly or through the macro.
It could be a patch in itself.
2. Provide some IPPROTO_* constants and IPVERSION, missing on Windows.
I think it belongs to previous patch about extending the IP-related API.
quoted hunk ↗ jump to hunk
--- a/drivers/net/i40e/i40e_fdir.c +++ b/drivers/net/i40e/i40e_fdir.c@@ -22,6 +22,7 @@ #include <rte_sctp.h> #include <rte_hash_crc.h> #include <rte_bitmap.h> +#include <rte_os_internal.h>
Why is it needed? [...]
quoted hunk ↗ jump to hunk
--- a/lib/librte_net/rte_ip.h +++ b/lib/librte_net/rte_ip.h@@ -17,11 +17,15 @@ #include <stdint.h> +#ifdef RTE_EXEC_ENV_WINDOWS +#include <ws2tcpip.h> +#else #include <sys/socket.h> #include <sys/types.h> #include <arpa/inet.h> #include <netinet/in.h> #include <netinet/ip.h> +#endif
Should be in previous patch about extending IP API to any OS.
quoted hunk ↗ jump to hunk
--- a/lib/librte_net/rte_net.c +++ b/lib/librte_net/rte_net.c@@ -15,6 +15,7 @@ #include <rte_gre.h> #include <rte_mpls.h> #include <rte_net.h> +#include <rte_os_internal.h>
Why is it needed?