Skip to content

msvc integration changes

Tyler Retzlaff dpdk-dev 11 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v11 Latest16 patches 25 repliesIn review
  2. v1013 patches 0 repliesSuperseded
  3. v914 patches 0 repliesSuperseded
Earlier versions · 8
VersionPostedPatchesRepliesStatus
v814 patches0 repliesSuperseded
v714 patches2 repliesSuperseded
v615 patches1 replySuperseded
v514 patches11 repliesSuperseded
v414 patches8 repliesSuperseded
v311 patches12 repliesSuperseded
v29 patches9 repliesSuperseded
v19 patches18 repliesSuperseded

Changes in v11 from the cover letter

* rebase for log lib split: introduces 2 patches to convert to portable use of ternary operator
* rebase for log lib split: introduce MSVC versions of RTE_INIT_PRIO and RTE_FINI_PRIO since it is needed by log

Patches in v11 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16eal: use rdtsc intrinsiclib/eal/x86/include/rte_cycles.h+8 -66 replies
2/16eal: use rtm and xtest intrinsicsconfig/x86/meson.build lib/eal/x86/include/rte_rtm.h+11 -130 replies
3/16eal: use barrier intrinsicslib/eal/include/generic/rte_atomic.h lib/eal/x86/include/rte_atomic.h+8 -00 replies
4/16eal: use cpuid and cpuidex intrinsicslib/eal/x86/rte_cpuflags.c lib/eal/x86/rte_cpuid.h lib/eal/x86/rte_cycles.c +1 more+52 -10 replies
5/16eal: use umonitor umwait and tpause intrinsicslib/eal/x86/rte_power_intrinsics.c+12 -04 replies
6/16eal: use prefetch intrinsicslib/eal/x86/include/rte_prefetch.h+21 -49 replies
7/16eal: use byte swap intrinsicslib/eal/include/generic/rte_byteorder.h lib/eal/x86/include/rte_byteorder.h+15 -01 reply
8/16eal: hide GCC extension based alignment markerslib/eal/include/rte_common.h+4 -00 replies
9/16eal: hide typedefs based on GCC vector extensionslib/eal/include/generic/rte_vect.h+4 -00 replies
10/16eal: expand most macros to empty when using MSVClib/eal/include/rte_branch_prediction.h lib/eal/include/rte_common.h lib/eal/include/rte_compat.h+82 -00 replies
11/16eal: exclude exposure of rte atomic APIs for MSVC buildslib/eal/include/generic/rte_atomic.h lib/eal/x86/include/rte_atomic.h+11 -00 replies
12/16eal: always define MSVC as little endianlib/eal/include/generic/rte_byteorder.h+2 -00 replies
13/16eal: do not define typeof macro when building with MSVClib/eal/include/rte_common.h+2 -00 replies
14/16log: use standard ternary operator instead of GCC extensionlib/log/log.c+1 -12 replies
15/16eal: use standard ternary operator instead of GCC extensionlib/eal/common/eal_common_hexdump.c+1 -11 reply
16/16eal: define priority based ctor dtor for MSVClib/eal/include/rte_common.h+37 -01 reply

Reviews trailers per patch

All 16 patches have a Reviewed-by or Acked-by.

PatchBruce RichardsonKonstantin AnanyevMorten Brørup
1/16A-b A-b
2/16A-b A-b A-b
3/16A-b A-b A-b
4/16A-b
5/16A-b A-b
6/16A-b A-b A-b
7/16A-b
8/16A-b
9/16A-b
10/16A-b
11/16A-b
12/16A-b
13/16A-b
14/16R-b
15/16R-b
16/16A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v11 thread

Cover letter [PATCH v11 00/16] msvc integration changes

In accordance with draft plan
http://mails.dpdk.org/archives/web/2023-February/002023.html
introduces conditionally compiled code to enable building with MSVC that _does not_ require C99/C11 meaning it can be integrated now.

This series covers minimal changes for item #2 in draft plan for EAL dependencies log, kvargs, telemetry and consumed EAL public headers.

Note if any patch in the series requires in-depth discussion I'll detach it from this series for separate submission & more focused discussion so it doesn't block the entire series.

Note other "common" intrinsics were investigated for viability but were not adopted either because they were not available on older versions of GCC or because they generate different code for msvc vs GCC.

v11:
* rebase for log lib split: introduces 2 patches to convert to portable use of ternary operator
* rebase for log lib split: introduce MSVC versions of RTE_INIT_PRIO and RTE_FINI_PRIO since it is needed by log

v10:
* rebase series post 23.07 release. no changes except
telemetry: avoid expanding versioned symbol macros on MSVC has been dropped from the series as 23.11 has removed the versioned symbols

v9:
* invert macro conditional evaluation and use to be #ifdef RTE_TOOLCHAIN_MSVC instead of #ifndef RTE_TOOLCHAIN_MSVC wherever it doesn't make evaluation more complex than it already is

v8:
* use waitpkg intrinsics if __WAITPKG__ is defined by the compiler

v7:
* remove patch typedef of rte_cpuflags_t as an int. for now we will just allow warning to be emitted to avoid adding conditional compilation

v6:
* convert / expand likely/unlikely macros to _Bool type
* expand __extension__ empty it's cleaner to do this for now instead of modifying the whole tree
* provide msvc container_of not based on gcc expression statement extension
* add patch that stops defining typeof (C23 keyword) when building with msvc

v5:
* remove accidental line removal in barrier patch
* update prefetch patch to use intrinsics for all toolchains
* remove x86 specific changes for byte swap patch since msvc intrinsics are processor agnostic always use intrinsics from generic include
* expand __rte_packed empty for msvc packing will be addressed in a separate series

v4:
* update rdtsc patch to use gcc intrinsics
* update rtm patch to use gcc intrinsics
* drop patch disable json print formatting, we will utilize series removing VLAs from Bruce
* added patch using prefetch intrinsics for msvc
* added patch using byte swap intrinsics for msvc
* added patch hiding typdefs for msvc using gcc vector extension
* added patch defining MSVC as little endian always

v3:
* v3 does not group together conditional blocks when experimented with it didn't reduce conditionals enough to make it worth while. once msvc tests are at a running point i suggest a narrow targeted discussion about code organization without blocking this series
* v3 does not attempt to refactor to use intrinsics for non-msvc compilers. again this should be done as a separate follow-up series later if desired
* fix expansion of likely and unlikely macros
* remove unnecessary define for rte_smp_{r,w}mb it is sufficient for these to be compiler barriers on x86
* add a new patch to use __cpuid and __cpuidex intrinsics when building with msvc
* add a new patch to use _umonitor, _umwait and _tpause intrinsics when building with msvc

v2:
* use _mm_{l,s,m}fence intrinsics for rte_smp_{r,w,}mb macros are intended to be memory barriers not compiler barriers on x86_64

Tyler Retzlaff (16):
eal: use rdtsc intrinsic
eal: use rtm and xtest intrinsics
eal: use barrier intrinsics
eal: use cpuid and cpuidex intrinsics
eal: use umonitor umwait and tpause intrinsics
eal: use prefetch intrinsics
eal: use byte swap intrinsics
eal: hide GCC extension based alignment markers
eal: hide typedefs based on GCC vector extensions
eal: expand most macros to empty when using MSVC
eal: exclude exposure of rte atomic APIs for MSVC builds
eal: always define MSVC as little endian
eal: do not define typeof macro when building with MSVC
log: use standard ternary operator instead of GCC extension
eal: use standard ternary operator instead of GCC extension
eal: define priority based ctor dtor for MSVC

 config/x86/meson.build                  |  6 ++
 lib/eal/common/eal_common_hexdump.c     |  2 +-
 lib/eal/include/generic/rte_atomic.h    | 11 ++++
 lib/eal/include/generic/rte_byteorder.h | 13 +++++
 lib/eal/include/generic/rte_vect.h      |  4 ++
 lib/eal/include/rte_branch_prediction.h |  8 +++
 lib/eal/include/rte_common.h            | 97 +++++++++++++++++++++++++++++++++
 lib/eal/include/rte_compat.h            | 20 +++++++
 lib/eal/x86/include/rte_atomic.h        |  8 +++
 lib/eal/x86/include/rte_byteorder.h     |  4 ++
 lib/eal/x86/include/rte_cycles.h        | 14 +++--
 lib/eal/x86/include/rte_prefetch.h      | 25 +++++++--
 lib/eal/x86/include/rte_rtm.h           | 18 ++----
 lib/eal/x86/rte_cpuflags.c              |  6 +-
 lib/eal/x86/rte_cpuid.h                 |  7 +++
 lib/eal/x86/rte_cycles.c                | 36 ++++++++++++
 lib/eal/x86/rte_hypervisor.c            |  4 ++
 lib/eal/x86/rte_power_intrinsics.c      | 12 ++++
 lib/log/log.c                           |  2 +-
 19 files changed, 271 insertions(+), 26 deletions(-)
Signature · 1 line
1.8.3.1