Whamcloud - gitweb
LU-16793 build: Enable compile tests to require <module>.ko 49/50849/2
authorShaun Tancheff <shaun.tancheff@hpe.com>
Tue, 2 May 2023 10:29:44 +0000 (05:29 -0500)
committerOleg Drokin <green@whamcloud.com>
Wed, 19 Jul 2023 16:44:04 +0000 (16:44 +0000)
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 <shaun.tancheff@hpe.com>
Change-Id: Iae481f1287023ea6c2432d147c497fa0a55fd689
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50849
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: xinliang <xinliang.liu@linaro.org>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
config/lustre-build-linux.m4
lnet/autoconf/lustre-lnet.m4

index 61eb9b3..014d310 100644 (file)
@@ -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 <module>.o be generated.
+       NEED_KO=0
+       # Require the <module>.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],
index a790561..84a2b0d 100644 (file)
@@ -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