mbox series

[v3,0/7] eal/windows: do not expose POSIX symbols

Message ID 20210221142819.6769-1-dmitry.kozliuk@gmail.com (mailing list archive)
Headers
Series eal/windows: do not expose POSIX symbols |

Message

Dmitry Kozlyuk Feb. 21, 2021, 2:28 p.m. UTC
  On Windows, rte_os.h contains a small POSIX compatibility set of
functions and macros. Exposing it from EAL can break consumer own POSIX
compatibility layer and is against standards in general.

First define required wrappers, then fix POSIX dependencies in
Windows-enabled libraries and drivers, then eliminate POSIX symbols from
Windows EAL API. Commits are arranged so that they all compile and are
limited in scope; patches 5, 6, 7 can be squashed if needed.

No "Fixes" tags, because it's really an enhancement,
preventing issues rather then solving direct ones.

v3:
    * Fix indentation in 3/7 (Tal Shnaiderman).
    * Fix build failures in 6/7 and 7/7 (Tal Shnaiderman).
v2:
    * Fix compilation issues in 3/7 and 6/7 (self).

Dmitry Kozlyuk (7):
  eal: add wrappers for POSIX string functions
  eal: add macro for maximum path length
  eal: add sleep API
  eal: add asprintf() internal wrapper
  lib: remove POSIX dependencies
  drivers: remove POSIX dependencies
  eal/windows: do not expose POSIX symbols

 doc/guides/rel_notes/release_21_05.rst        |  9 ++
 drivers/bus/pci/private.h                     |  2 +-
 drivers/bus/vdev/vdev.c                       |  4 +-
 drivers/bus/vdev/vdev_params.c                |  3 +-
 drivers/common/mlx5/mlx5_common_pci.c         |  6 +-
 drivers/common/mlx5/mlx5_common_pci.h         |  1 +
 drivers/net/i40e/i40e_ethdev.c                | 56 +++++------
 drivers/net/mlx5/mlx5.c                       |  4 +
 lib/librte_cmdline/cmdline.c                  |  1 +
 lib/librte_eal/common/eal_common_config.c     |  2 +-
 lib/librte_eal/common/eal_common_dev.c        |  6 +-
 lib/librte_eal/common/eal_common_devargs.c    |  7 +-
 lib/librte_eal/common/eal_common_errno.c      |  4 +
 lib/librte_eal/common/eal_common_fbarray.c    |  8 +-
 lib/librte_eal/common/eal_common_lcore.c      |  2 +-
 lib/librte_eal/common/eal_common_log.c        |  5 +-
 lib/librte_eal/common/eal_common_options.c    | 42 ++++----
 lib/librte_eal/common/eal_common_timer.c      |  5 +-
 lib/librte_eal/common/eal_common_trace.c      |  2 +-
 lib/librte_eal/common/eal_common_trace_ctf.c  |  4 +-
 .../common/eal_common_trace_utils.c           | 13 +--
 lib/librte_eal/common/eal_filesystem.h        |  8 +-
 lib/librte_eal/common/eal_hugepages.h         |  2 +-
 lib/librte_eal/common/eal_internal_cfg.h      |  2 +-
 lib/librte_eal/common/eal_private.h           | 23 +++++
 lib/librte_eal/common/eal_trace.h             |  2 +-
 lib/librte_eal/freebsd/include/rte_os.h       |  6 +-
 lib/librte_eal/include/rte_string_fns.h       | 42 ++++++++
 lib/librte_eal/include/rte_thread.h           | 11 +++
 lib/librte_eal/linux/include/rte_os.h         |  6 +-
 lib/librte_eal/rte_eal_exports.def            |  2 +
 lib/librte_eal/unix/rte_thread.c              | 10 +-
 lib/librte_eal/version.map                    |  3 +
 lib/librte_eal/windows/eal.c                  | 30 ++++++
 lib/librte_eal/windows/eal_thread.c           |  9 +-
 lib/librte_eal/windows/include/dirent.h       | 21 ++--
 lib/librte_eal/windows/include/rte_os.h       | 99 ++-----------------
 lib/librte_ethdev/rte_class_eth.c             |  2 +-
 lib/librte_ethdev/rte_ethdev.c                |  2 +-
 lib/librte_kvargs/rte_kvargs.c                | 17 ++--
 40 files changed, 275 insertions(+), 208 deletions(-)
  

Comments

Khoa To March 4, 2021, 6:46 a.m. UTC | #1
> On Windows, rte_os.h contains a small POSIX compatibility set of
> functions and macros. Exposing it from EAL can break consumer own POSIX
> compatibility layer and is against standards in general.
> 
> First define required wrappers, then fix POSIX dependencies in
> Windows-enabled libraries and drivers, then eliminate POSIX symbols from
> Windows EAL API. Commits are arranged so that they all compile and are
> limited in scope; patches 5, 6, 7 can be squashed if needed.
> 
> No "Fixes" tags, because it's really an enhancement,
> preventing issues rather then solving direct ones.
> 
> v3:
>     * Fix indentation in 3/7 (Tal Shnaiderman).
>     * Fix build failures in 6/7 and 7/7 (Tal Shnaiderman).
> v2:
>     * Fix compilation issues in 3/7 and 6/7 (self).
> 

Acked-by: Khoa To <khot@microsoft.com>