From 1aba6b0d9b661d3699cbd4624e9db334a13fc647 Mon Sep 17 00:00:00 2001 From: Chris Horn Date: Tue, 13 Sep 2022 20:23:37 -0500 Subject: [PATCH] LU-15595 tests: Router test interop check and aarch fix setup_router_test() executes load_lnet() on remote nodes, but this function was only added in 2.15. Add a version check for it. Enabling routing may fail on nodes with small amount of memory (like aarch config). Define small number of router buffers to work around this issue. Modify the functions which calculate the number of buffers to allow small sizes to be specified via parameters. Test-Parameters: trivial testlist=sanity-lnet serverversion=2.12.9 Test-Parameters: testgroup=review-ldiskfs-arm testlist=sanity-lnet Signed-off-by: Chris Horn Change-Id: If0b76747fe09e883546f18da9f3322c72263e29d Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48578 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Frank Sehr Reviewed-by: Shaun Tancheff Reviewed-by: Oleg Drokin --- lnet/lnet/router.c | 30 +++++++++++++++++++++--------- lustre/tests/sanity-lnet.sh | 6 ++++++ 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/lnet/lnet/router.c b/lnet/lnet/router.c index 3960785..23c901b 100644 --- a/lnet/lnet/router.c +++ b/lnet/lnet/router.c @@ -1404,7 +1404,7 @@ lnet_rtrpools_free(int keep_pools) static int lnet_nrb_tiny_calculate(void) { - int nrbs = LNET_NRB_TINY; + int nrbs = LNET_NRB_TINY; if (tiny_router_buffers < 0) { LCONSOLE_ERROR_MSG(0x10c, @@ -1413,17 +1413,21 @@ lnet_nrb_tiny_calculate(void) return -EINVAL; } - if (tiny_router_buffers > 0) + if (tiny_router_buffers > 0) { + if (tiny_router_buffers < LNET_NRB_TINY_MIN) + CWARN("tiny_router_buffers=%d less than recommended minimum %d\n", + tiny_router_buffers, LNET_NRB_TINY_MIN); nrbs = tiny_router_buffers; + } nrbs /= LNET_CPT_NUMBER; - return max(nrbs, LNET_NRB_TINY_MIN); + return max(nrbs, 1); } static int lnet_nrb_small_calculate(void) { - int nrbs = LNET_NRB_SMALL; + int nrbs = LNET_NRB_SMALL; if (small_router_buffers < 0) { LCONSOLE_ERROR_MSG(0x10c, @@ -1432,17 +1436,21 @@ lnet_nrb_small_calculate(void) return -EINVAL; } - if (small_router_buffers > 0) + if (small_router_buffers > 0) { + if (small_router_buffers < LNET_NRB_SMALL_MIN) + CWARN("small_router_buffers=%d less than recommended minimum %d\n", + small_router_buffers, LNET_NRB_SMALL_MIN); nrbs = small_router_buffers; + } nrbs /= LNET_CPT_NUMBER; - return max(nrbs, LNET_NRB_SMALL_MIN); + return max(nrbs, 1); } static int lnet_nrb_large_calculate(void) { - int nrbs = LNET_NRB_LARGE; + int nrbs = LNET_NRB_LARGE; if (large_router_buffers < 0) { LCONSOLE_ERROR_MSG(0x10c, @@ -1451,11 +1459,15 @@ lnet_nrb_large_calculate(void) return -EINVAL; } - if (large_router_buffers > 0) + if (large_router_buffers > 0) { + if (large_router_buffers < LNET_NRB_LARGE_MIN) + CWARN("large_router_buffers=%d less than recommended minimum %d\n", + large_router_buffers, LNET_NRB_LARGE_MIN); nrbs = large_router_buffers; + } nrbs /= LNET_CPT_NUMBER; - return max(nrbs, LNET_NRB_LARGE_MIN); + return max(nrbs, 1); } int diff --git a/lustre/tests/sanity-lnet.sh b/lustre/tests/sanity-lnet.sh index 7c47dc8..0d89f20 100755 --- a/lustre/tests/sanity-lnet.sh +++ b/lustre/tests/sanity-lnet.sh @@ -2555,6 +2555,9 @@ setup_router_test() { local mod_opts="$1" local rtr_net_opts="$2" + (( $MDS1_VERSION >= $(version_code 2.15.0) )) || + skip "need at least 2.15.0 for load_lnet" + if [[ ${#RPEER_INTERFACES[@]} -eq 0 ]]; then init_router_test_vars || return $? @@ -2567,6 +2570,9 @@ setup_router_test() { mod_opts+=" alive_router_check_interval=5" mod_opts+=" router_ping_timeout=5" + mod_opts+=" large_router_buffers=4" + mod_opts+=" small_router_buffers=8" + mod_opts+=" tiny_router_buffers=16" do_rpc_nodes $all_nodes load_lnet "${mod_opts}" || error "Failed to load lnet" -- 1.8.3.1