build: add defines for compatibility with make build

The defines used to indicate what crypto, compression and eventdev drivers
were being built were different to those used in the make build, with meson
defining them with "_PMD" at the end, while make defined them with "_PMD"
in the middle and the specific driver name at the end. This might cause
compatibility issues for applications which used the older defines, which
switching to build against new DPDK releases.

As well as changing the default to match that of make, meson also
special-cases the crypto/compression/event drivers to have both defines
provided. This ensures compatibility for these macros with both meson and
make from older versions.

For a selection of other libraries and drivers, there were other
incompatibilities between the meson and make-defined macros which were not
previously highlighted in a deprecation notice, so we add per-macro
compatibility defines for these to ease the transition from make to meson.

Fixes: 5b9656b157 ("lib: build with meson")
Fixes: 9314afb68a ("drivers: add infrastructure for meson build")
Fixes: dcadbbde8e ("crypto/null: build with meson")
Fixes: 3c32e89f68 ("compress/isal: add skeleton ISA-L compression PMD")
Fixes: eca504f318 ("drivers/event: build skeleton and SW drivers with meson")

Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
This commit is contained in:
Bruce Richardson 2020-10-15 16:05:49 +01:00 committed by Thomas Monjalon
parent 52e2991eab
commit b0b672aead
7 changed files with 150 additions and 4 deletions

View File

@ -253,7 +253,8 @@ dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
# set the install path for the drivers
dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
install_headers('rte_config.h', subdir: get_option('include_subdir_arch'))
install_headers(['rte_config.h', 'rte_compatibility_defines.h'],
subdir: get_option('include_subdir_arch'))
# enable VFIO only if it is linux OS
dpdk_conf.set('RTE_EAL_VFIO', is_linux)

View File

@ -0,0 +1,129 @@
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2017 Intel Corporation
*/
#ifndef _RTE_CONFIG_H_
#error "This file should only be included via rte_config.h"
#endif
/*
* NOTE: these defines are for compatibility only and will be removed in a
* future DPDK release.
*/
#ifdef RTE_LIBRTE_BITRATESTATS
#define RTE_LIBRTE_BITRATE
#endif
#ifdef RTE_LIBRTE_LATENCYSTATS
#define RTE_LIBRTE_LATENCY_STATS
#endif
#ifdef RTE_LIBRTE_DPAAX_COMMON
#define RTE_LIBRTE_COMMON_DPAAX
#endif
#ifdef RTE_LIBRTE_VMBUS_BUS
#define RTE_LIBRTE_VMBUS
#endif
#ifdef RTE_LIBRTE_BUCKET_MEMPOOL
#define RTE_DRIVER_MEMPOOL_BUCKET
#endif
#ifdef RTE_LIBRTE_RING_MEMPOOL
#define RTE_DRIVER_MEMPOOL_RING
#endif
#ifdef RTE_LIBRTE_STACK_MEMPOOL
#define RTE_DRIVER_MEMPOOL_STACK
#endif
#ifdef RTE_LIBRTE_AF_PACKET_PMD
#define RTE_LIBRTE_PMD_AF_PACKET
#endif
#ifdef RTE_LIBRTE_AF_XDP_PMD
#define RTE_LIBRTE_PMD_AF_XDP
#endif
#ifdef RTE_LIBRTE_BOND_PMD
#define RTE_LIBRTE_PMD_BOND
#endif
#ifdef RTE_LIBRTE_E1000_PMD
#define RTE_LIBRTE_EM_PMD
#endif
#ifdef RTE_LIBRTE_E1000_PMD
#define RTE_LIBRTE_IGB_PMD
#endif
#ifdef RTE_LIBRTE_FAILSAFE_PMD
#define RTE_LIBRTE_PMD_FAILSAFE
#endif
#ifdef RTE_LIBRTE_KNI_PMD
#define RTE_LIBRTE_PMD_KNI
#endif
#ifdef RTE_LIBRTE_LIQUIDIO_PMD
#define RTE_LIBRTE_LIO_PMD
#endif
#ifdef RTE_LIBRTE_MEMIF_PMD
#define RTE_LIBRTE_PMD_MEMIF
#endif
#ifdef RTE_LIBRTE_NULL_PMD
#define RTE_LIBRTE_PMD_NULL
#endif
#ifdef RTE_LIBRTE_PCAP_PMD
#define RTE_LIBRTE_PMD_PCAP
#endif
#ifdef RTE_LIBRTE_RING_PMD
#define RTE_LIBRTE_PMD_RING
#endif
#ifdef RTE_LIBRTE_SFC_PMD
#define RTE_LIBRTE_SFC_EFX_PMD
#endif
#ifdef RTE_LIBRTE_SOFTNIC_PMD
#define RTE_LIBRTE_PMD_SOFTNIC
#endif
#ifdef RTE_LIBRTE_SZEDATA2_PMD
#define RTE_LIBRTE_PMD_SZEDATA2
#endif
#ifdef RTE_LIBRTE_TAP_PMD
#define RTE_LIBRTE_PMD_TAP
#endif
#ifdef RTE_LIBRTE_THUNDERX_PMD
#define RTE_LIBRTE_THUNDERX_NICVF_PMD
#endif
#ifdef RTE_LIBRTE_VHOST_PMD
#define RTE_LIBRTE_PMD_VHOST
#endif
#ifdef RTE_LIBRTE_PMD_ARMV8
#define RTE_LIBRTE_PMD_ARMV8_CRYPTO
#endif
#ifdef RTE_LIBRTE_PMD_MVSAM
#define RTE_LIBRTE_PMD_MVSAM_CRYPTO
#endif
#ifdef RTE_LIBRTE_PMD_OCTEONTX_COMPRESS
#define RTE_LIBRTE_PMD_OCTEONTX_ZIPVF
#endif
#ifdef RTE_LIBRTE_PMD_OCTEONTX_EVENTDEV
#define RTE_LIBRTE_PMD_OCTEONTX_SSOVF
#endif

View File

@ -13,6 +13,7 @@
#define _RTE_CONFIG_H_
#include <rte_build_config.h>
#include <rte_compatibility_defines.h>
/* legacy defines */
#ifdef RTE_EXEC_ENV_LINUX

View File

@ -8,5 +8,5 @@ endif
drivers = ['isal', 'octeontx', 'qat', 'zlib']
std_deps = ['compressdev'] # compressdev pulls in all other needed deps
config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
config_flag_fmt = 'RTE_LIBRTE_PMD_@0@'
driver_name_fmt = 'rte_pmd_@0@'

View File

@ -27,5 +27,5 @@ drivers = ['aesni_gcm',
'zuc']
std_deps = ['cryptodev'] # cryptodev pulls in all other needed deps
config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
config_flag_fmt = 'RTE_LIBRTE_PMD_@0@'
driver_name_fmt = 'rte_pmd_@0@'

View File

@ -11,5 +11,5 @@ if not (toolchain == 'gcc' and cc.version().version_compare('<4.8.6') and
drivers += 'octeontx'
endif
std_deps = ['eventdev', 'kvargs']
config_flag_fmt = 'RTE_LIBRTE_@0@_EVENTDEV_PMD'
config_flag_fmt = 'RTE_LIBRTE_PMD_@0@_EVENTDEV'
driver_name_fmt = 'rte_pmd_@0@_event'

View File

@ -117,6 +117,21 @@ foreach subpath:subdirs
fmt_name = name
endif
dpdk_conf.set(config_flag_fmt.format(fmt_name.to_upper()),1)
# for driver compatibility, since we changed the
# default to match that of make. Remove in future release
# after following deprecation process
if config_flag_fmt.contains('_PMD_@0@') and (class == 'crypto'
or class == 'compress'
or class == 'event')
alt_flag_fmt = '_@0@_PMD'.join(
config_flag_fmt.split('_PMD_@0@'))
if config_flag_fmt.contains('EVENTDEV')
alt_flag_fmt = '_@0@_EVENTDEV_PMD'.join(
config_flag_fmt.split('_PMD_@0@_EVENTDEV'))
endif
dpdk_conf.set(alt_flag_fmt.format(
fmt_name.to_upper()), 1)
endif
lib_name = driver_name_fmt.format(fmt_name)
dpdk_extra_ldflags += pkgconfig_extra_libs