From 1c8d673f75737fec73b41fd5f02108d292c989b5 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Tue, 19 Nov 2019 10:09:00 -0700 Subject: [PATCH] env: Force iova-mode=pa on ppc In DPDK, the ppc iommu support does not currently allow for iova-mode=va, but DPDK doesn't detect ppc and so still attempts to guess iova-mode=va in some modes. Force iova-mode=pa from SPDK to fix this. Signed-off-by: Ben Walker Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475148 (master) (cherry picked from commit 07ca02210a201f33377567055fa87d66d9ddd254) Change-Id: I6a1ee25ab74873826ac211c3e0dfdf54afc74502 Signed-off-by: Tomasz Zawadzki Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478347 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto Reviewed-by: Alexey Marchuk --- lib/env_dpdk/init.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/env_dpdk/init.c b/lib/env_dpdk/init.c index e17d8605b..58cb363ca 100644 --- a/lib/env_dpdk/init.c +++ b/lib/env_dpdk/init.c @@ -336,6 +336,16 @@ spdk_build_eal_cmdline(const struct spdk_env_opts *opts) } #ifdef __linux__ + +#ifdef __PPC64__ + /* On Linux + PowerPC, DPDK doesn't support VA mode at all. Unfortunately, it doesn't correctly + * auto-detect at the moment, so we'll just force it here. */ + args = spdk_push_arg(args, &argcount, _sprintf_alloc("--iova-mode=pa")); + if (args == NULL) { + return -1; + } +#endif + /* Set the base virtual address - it must be an address that is not in the * ASAN shadow region, otherwise ASAN-enabled builds will ignore the * mmap hint.