diff --git a/CMakeLists.txt b/CMakeLists.txt index 66a9c705a6e..c64f267d57e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -742,6 +742,7 @@ if (Seastar_DPDK) set (Seastar_ARCH_FOR_wsm "westmere") set (Seastar_ARCH_FOR_snb "sandybridge") set (Seastar_ARCH_FOR_ivb "ivybridge") + set (Seastar_ARCH_FOR_armv8a "armv8-a") set (Seastar_ARCH ${Seastar_ARCH_FOR_${Seastar_DPDK_MACHINE}}) if (NOT Seastar_ARCH) diff --git a/cmake/Finddpdk.cmake b/cmake/Finddpdk.cmake index 484de1d14ff..c70b8e02690 100644 --- a/cmake/Finddpdk.cmake +++ b/cmake/Finddpdk.cmake @@ -55,37 +55,47 @@ find_library (dpdk_BUS_VDEV_LIBRARY rte_bus_vdev) include (FindPackageHandleStandardArgs) +set (dpdk_REQUIRED + dpdk_INCLUDE_DIR + dpdk_PMD_VMXNET3_UIO_LIBRARY + dpdk_PMD_I40E_LIBRARY + dpdk_PMD_IXGBE_LIBRARY + dpdk_PMD_E1000_LIBRARY + dpdk_PMD_BNXT_LIBRARY + dpdk_PMD_RING_LIBRARY + dpdk_PMD_CXGBE_LIBRARY + dpdk_PMD_ENA_LIBRARY + dpdk_PMD_ENIC_LIBRARY + dpdk_PMD_NFP_LIBRARY + dpdk_PMD_QEDE_LIBRARY + dpdk_RING_LIBRARY + dpdk_KVARGS_LIBRARY + dpdk_MEMPOOL_LIBRARY + dpdk_MEMPOOL_RING_LIBRARY + dpdk_HASH_LIBRARY + dpdk_CMDLINE_LIBRARY + dpdk_MBUF_LIBRARY + dpdk_CFGFILE_LIBRARY + dpdk_EAL_LIBRARY + dpdk_ETHDEV_LIBRARY + dpdk_NET_LIBRARY + dpdk_TIMER_LIBRARY + dpdk_PCI_LIBRARY + dpdk_BUS_PCI_LIBRARY + dpdk_BUS_VDEV_LIBRARY) + +# fm10k, sfc_efx driver can only build on x86 +if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") + set (dpdk_REQUIRED + ${dpdk_REQUIRED} + dpdk_PMD_FM10K_LIBRARY + dpdk_PMD_SFC_EFX_LIBRARY) +endif() + find_package_handle_standard_args (dpdk REQUIRED_VARS - dpdk_INCLUDE_DIR - dpdk_PMD_VMXNET3_UIO_LIBRARY - dpdk_PMD_I40E_LIBRARY - dpdk_PMD_IXGBE_LIBRARY - dpdk_PMD_E1000_LIBRARY - dpdk_PMD_BNXT_LIBRARY - dpdk_PMD_RING_LIBRARY - dpdk_PMD_CXGBE_LIBRARY - dpdk_PMD_ENA_LIBRARY - dpdk_PMD_ENIC_LIBRARY - dpdk_PMD_FM10K_LIBRARY - dpdk_PMD_NFP_LIBRARY - dpdk_PMD_QEDE_LIBRARY - dpdk_RING_LIBRARY - dpdk_KVARGS_LIBRARY - dpdk_MEMPOOL_LIBRARY - dpdk_MEMPOOL_RING_LIBRARY - dpdk_PMD_SFC_EFX_LIBRARY - dpdk_HASH_LIBRARY - dpdk_CMDLINE_LIBRARY - dpdk_MBUF_LIBRARY - dpdk_CFGFILE_LIBRARY - dpdk_EAL_LIBRARY - dpdk_ETHDEV_LIBRARY - dpdk_NET_LIBRARY - dpdk_TIMER_LIBRARY - dpdk_PCI_LIBRARY - dpdk_BUS_PCI_LIBRARY - dpdk_BUS_VDEV_LIBRARY) + ${dpdk_REQUIRED} +) if (dpdk_FOUND AND NOT (TARGET dpdk::dpdk)) set (dpdk_LIBRARIES @@ -102,14 +112,22 @@ if (dpdk_FOUND AND NOT (TARGET dpdk::dpdk)) ${dpdk_PMD_E1000_LIBRARY} ${dpdk_PMD_ENA_LIBRARY} ${dpdk_PMD_ENIC_LIBRARY} - ${dpdk_PMD_FM10K_LIBRARY} ${dpdk_PMD_QEDE_LIBRARY} ${dpdk_PMD_I40E_LIBRARY} ${dpdk_PMD_IXGBE_LIBRARY} ${dpdk_PMD_NFP_LIBRARY} ${dpdk_PMD_RING_LIBRARY} - ${dpdk_PMD_SFC_EFX_LIBRARY} - ${dpdk_PMD_VMXNET3_UIO_LIBRARY} + ${dpdk_PMD_VMXNET3_UIO_LIBRARY}) + + if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") + set (dpdk_LIBRARIES + ${dpdk_LIBRARIES} + ${dpdk_PMD_FM10K_LIBRARY} + ${dpdk_PMD_SFC_EFX_LIBRARY}) + endif() + + set (dpdk_LIBRARIES + ${dpdk_LIBRARIES} ${dpdk_RING_LIBRARY} ${dpdk_NET_LIBRARY} ${dpdk_TIMER_LIBRARY} @@ -449,13 +467,11 @@ if (dpdk_FOUND AND NOT (TARGET dpdk::dpdk)) dpdk::pmd_e1000 dpdk::pmd_ena dpdk::pmd_enic - dpdk::pmd_fm10k dpdk::pmd_qede dpdk::pmd_i40e dpdk::pmd_ixgbe dpdk::pmd_nfp dpdk::pmd_ring - dpdk::pmd_sfc_efx dpdk::pmd_vmxnet3_uio dpdk::ring dpdk::net @@ -464,6 +480,13 @@ if (dpdk_FOUND AND NOT (TARGET dpdk::dpdk)) dpdk::bus_pci dpdk::bus_vdev) + if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") + set (_dpdk_libraries + ${_dpdk_libraries} + dpdk::pmd_fm10k + dpdk::pmd_sfc_efx) + endif() + set_target_properties (dpdk::dpdk PROPERTIES INTERFACE_LINK_LIBRARIES "${_dpdk_libraries}") diff --git a/configure.py b/configure.py index 7fc29066d5a..580e4684303 100755 --- a/configure.py +++ b/configure.py @@ -137,9 +137,10 @@ def infer_dpdk_machine(user_cflags): arch = 'native' # `-march` may be repeated, and we want the last one. + # strip features, leave only the arch: armv8-a+crc+crypto -> armv8-a for flag in user_cflags.split(): if flag.startswith('-march'): - arch = flag[7:] + arch = flag[7:].split('+')[0] MAPPING = { 'native': 'native', @@ -147,6 +148,7 @@ def infer_dpdk_machine(user_cflags): 'westmere': 'wsm', 'sandybridge': 'snb', 'ivybridge': 'ivb', + 'armv8-a': 'armv8a', } return MAPPING.get(arch, 'native') diff --git a/cooking_recipe.cmake b/cooking_recipe.cmake index 874abb301ee..068619f4d0d 100644 --- a/cooking_recipe.cmake +++ b/cooking_recipe.cmake @@ -254,7 +254,11 @@ cooking_ingredient (cryptopp # Use the "native" profile that DPDK defines in `dpdk/config`, but in `dpdk_configure.cmake` we override # CONFIG_RTE_MACHINE with `Seastar_DPDK_MACHINE`. -set (dpdk_quadruple ${CMAKE_SYSTEM_PROCESSOR}-native-linuxapp-gcc) +if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") + set (dpdk_quadruple arm64-armv8a-linuxapp-gcc) +else() + set (dpdk_quadruple ${CMAKE_SYSTEM_PROCESSOR}-native-linuxapp-gcc) +endif() set (dpdk_args EXTRA_CFLAGS=-Wno-error