From 5afed6966da072e7f569871d86421e70c2326601 Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Thu, 15 Jun 2023 15:38:54 +0100 Subject: [PATCH 1/2] build: prevent accidentally building without NUMA support When libnuma development package is missing on a system, DPDK can still be built but will be missing much-needed support for NUMA memory management. This may later cause issues at runtime if the resulting binary is run on a NUMA system. We can reduce the incidence of such runtime errors by ensuring that, for native builds*, libnuma is present - unless the user actually specifies via "max_numa_nodes" that they don't require NUMA support. Having this as an error condition is also in keeping with what is documented in the Linux GSG doc, where libnuma is listed as a requirement for building DPDK [1]. * NOTE: cross-compilation builds have a different logic set, with a separate "numa" value indicating if numa support is necessary. [1] https://doc.dpdk.org/guides-23.03/linux_gsg/sys_reqs.html Signed-off-by: Bruce Richardson Signed-off-by: David Marchand --- .github/workflows/build.yml | 5 ++++- config/meson.build | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0e2adb51065..d3bcb160cf1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -92,6 +92,9 @@ jobs: with: path: reference key: ${{ steps.get_ref_keys.outputs.abi }} + - name: Configure i386 architecture + if: env.BUILD_32BIT == 'true' + run: sudo dpkg --add-architecture i386 - name: Update APT cache run: sudo apt update || true - name: Install packages @@ -104,7 +107,7 @@ jobs: run: sudo apt install -y autoconf automake libdw-dev libtool libxml2-dev - name: Install i386 cross compiling packages if: env.BUILD_32BIT == 'true' - run: sudo apt install -y gcc-multilib g++-multilib + run: sudo apt install -y gcc-multilib g++-multilib libnuma-dev:i386 - name: Install aarch64 cross compiling packages if: env.AARCH64 == 'true' run: sudo apt install -y crossbuild-essential-arm64 diff --git a/config/meson.build b/config/meson.build index 22d7d908b7e..d8223718e44 100644 --- a/config/meson.build +++ b/config/meson.build @@ -381,6 +381,15 @@ endif if not dpdk_conf.has('RTE_MAX_NUMA_NODES') error('Number of NUMA nodes not specified.') endif +if (is_linux and + dpdk_conf.get('RTE_MAX_NUMA_NODES') > 1 and + not meson.is_cross_build() and + not has_libnuma) + error(''' +No NUMA library (development package) found, yet DPDK configured for multiple NUMA nodes. +Please install libnuma, or set 'max_numa_nodes' option to '1' to build without NUMA support. +''') +endif # set the install path for the drivers dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path) From a10529f4025eaef0c9803d845b9afc1d5fb17b59 Mon Sep 17 00:00:00 2001 From: Junfeng Guo Date: Wed, 28 Jun 2023 17:12:18 +0800 Subject: [PATCH 2/2] raw/ntb: avoid disabling interrupt twice During EAL cleanup stage, all bus devices are cleaned up properly. In the meantime, the ntb example app will also do the device cleanup process, which may call the dev ops '*dev->dev_ops->dev_close' twice. If this dev ops for ntb was called twice, the interrupt handle for EAL will be disabled twice and will lead to error for the second time. Like this: "EAL: Error disabling MSI-X interrupts for fd xx" Thus, this patch added the check process for disabling interrupt in dev_close ops, to ensure that interrupt only be disabled once. Fixes: 1cab1a40ea9b ("bus: cleanup devices on shutdown") Cc: stable@dpdk.org Signed-off-by: Junfeng Guo Tested-by: Wei Ling Acked-by: Jingjing Wu --- drivers/raw/ntb/ntb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/raw/ntb/ntb.c b/drivers/raw/ntb/ntb.c index 76e98fe5159..0ed4c145922 100644 --- a/drivers/raw/ntb/ntb.c +++ b/drivers/raw/ntb/ntb.c @@ -1045,6 +1045,11 @@ ntb_dev_close(struct rte_rawdev *dev) hw->queue_pairs = 0; intr_handle = hw->pci_dev->intr_handle; + /* Disable interrupt only once */ + if (!rte_intr_nb_efd_get(intr_handle) && + !rte_intr_max_intr_get(intr_handle)) + return 0; + /* Clean datapath event and vec mapping */ rte_intr_efd_disable(intr_handle); rte_intr_vec_list_free(intr_handle);