From: Shaun Tancheff Date: Tue, 2 May 2023 10:29:44 +0000 (-0500) Subject: LU-16793 build: Enable compile tests to require .ko X-Git-Tag: 2.15.57~41 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=581db5e89e0d690961e49278a7b50ecce78e5a22;p=fs%2Flustre-release.git LU-16793 build: Enable compile tests to require .ko Currently the build tests only demand a kernel api test create an object (.o). Cases that have a missing symbol export, directly or indirectly, will generate an object file and fail to generate a kernel module (.ko). Enable tests to select the stricter criteria. Test-Parameters: trivial Fixes: cc5594df3e ("LU-16759 o2ib: MOFED 5.5+ ib_dma_virt_map_sg") Signed-off-by: Shaun Tancheff Change-Id: Iae481f1287023ea6c2432d147c497fa0a55fd689 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50849 Tested-by: jenkins Tested-by: Maloo Reviewed-by: xinliang Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- diff --git a/config/lustre-build-linux.m4 b/config/lustre-build-linux.m4 index 61eb9b3..014d310d 100644 --- a/config/lustre-build-linux.m4 +++ b/config/lustre-build-linux.m4 @@ -924,6 +924,7 @@ AC_DEFUN([LB2_LINUX_TEST_SRC], [ # $1 - *unique* name matching the LB2_LINUX_TEST_SRC macro # $2 - run on success (valid .ko generated) # $3 - run on failure (unable to compile) +# $4 - compile only # AC_DEFUN([LB2_LINUX_TEST_RESULT],[ TEST_DIR=${TEST_DIR:-${ac_pwd}/_lpb} @@ -964,8 +965,13 @@ AC_DEFUN([LB2_LINUX_TEST_RESULT],[ # Abort if key does not exist AS_IF([test -f ${O}.tested], [], [AC_MSG_ERROR([*** Compile test for $1 was not run.])]) + # Default is to expect only the .o be generated. + NEED_KO=0 + # Require the .ko file when "module" is passed + AS_IF([test "X'$4'" == "X'module'"], [NEED_KO=1]) # If test was compiled and if we got an object ... - AS_IF([test -f ${O}.o], [touch ${O}.ko]) + AS_IF([test ${NEED_KO} -eq 0], [AS_IF([test ! -f ${O}.ko], [AS_IF( + [test -f ${O}.o], [touch ${O}.ko])])]) # key is valid. Cache should be valid, set the variable AC_CACHE_CHECK([for $1], lb_test, AS_IF([test -f ${O}.ko], diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index a790561..84a2b0d 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -642,7 +642,7 @@ AS_IF([test $ENABLEO2IB != "no"], [ LB2_LINUX_TEST_RESULT([sane_ib_dma_map_sg], [ AC_DEFINE(HAVE_SANE_IB_DMA_MAP_SG, 1, [ib_dma_map_sg is sane]) - ]) + ],[],[module]) ]) # @@ -803,6 +803,7 @@ AS_IF([test $ENABLEO2IB != "no"], [ LN_SRC_O2IB_IB_ALLOC_PD LN_SRC_O2IB_IB_INC_RKEY LN_SRC_O2IB_IB_POST_SEND_CONST + LN_SRC_SANE_IB_DMA_MAP_SG LN_SRC_O2IB_IB_DEVICE_OPS_EXISTS LN_SRC_O2IB_IB_SG_DMA_ADDRESS_EXISTS LN_SRC_O2IB_RDMA_REJECT @@ -823,6 +824,7 @@ AS_IF([test $ENABLEO2IB != "no"], [ LN_O2IB_IB_ALLOC_PD LN_O2IB_IB_INC_RKEY LN_O2IB_IB_POST_SEND_CONST + LN_SANE_IB_DMA_MAP_SG LN_O2IB_IB_DEVICE_OPS_EXISTS LN_O2IB_IB_SG_DMA_ADDRESS_EXISTS LN_O2IB_RDMA_REJECT