From a3200ab63ad83241bf5383c9be750c42bf104239 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. Lustre-change: https://review.whamcloud.com/48578 Lustre-commit: 1aba6b0d9b661d3699cbd4624e9db334a13fc647 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-by: Frank Sehr Reviewed-by: Shaun Tancheff Signed-off-by: Etienne AUJAMES Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51546 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin Reviewed-by: Cyril Bordage --- 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 196d1d0..026b337 100644 --- a/lnet/lnet/router.c +++ b/lnet/lnet/router.c @@ -1464,7 +1464,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, @@ -1473,17 +1473,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, @@ -1492,17 +1496,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, @@ -1511,11 +1519,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 88f2b81..40e3a24 100755 --- a/lustre/tests/sanity-lnet.sh +++ b/lustre/tests/sanity-lnet.sh @@ -2499,6 +2499,9 @@ REMOTE_NET=${NETTYPE}2 setup_router_test() { local mod_opts="$@" + (( $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 $? @@ -2511,6 +2514,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