From c9b168fd826719275fcb0b023578cf2bcc2e0d4c Mon Sep 17 00:00:00 2001 From: Sylvain Goudeau Date: Thu, 15 May 2025 10:51:58 +0200 Subject: [PATCH] LU-19010 lnet: Define BXI3LND network type Define the BXI3LND network type. This reserves the network type number for future implementation and allows creation of bxi3 peers and adding routes to bxi3 peers. Test-Parameters: trivial Signed-off-by: Sylvain Goudeau Change-Id: I0b15da1c3be7873fecebba926c60214663b8a091 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/59256 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Timothy Day Reviewed-by: Oleg Drokin --- libcfs/libcfs/util/nidstrings.c | 14 +++++++++++++- lnet/include/uapi/linux/lnet/nidstr.h | 1 + lnet/lnet/nidstrings.c | 10 ++++++++++ lustre/tests/sanity-lnet.sh | 26 +++++++++++++++++++++----- 4 files changed, 45 insertions(+), 6 deletions(-) diff --git a/libcfs/libcfs/util/nidstrings.c b/libcfs/libcfs/util/nidstrings.c index 196e398..326c5bd 100644 --- a/libcfs/libcfs/util/nidstrings.c +++ b/libcfs/libcfs/util/nidstrings.c @@ -720,7 +720,19 @@ static struct netstrfns libcfs_netstrfns[] = { .nf_match_addr = libcfs_num_match, .nf_min_max = cfs_num_min_max, .nf_expand_addrrange = libcfs_num_addr_range_expand - } + }, + { + .nf_type = BXI3LND, + .nf_name = "bxi3f", + .nf_modname = "kbxi3lnd", + .nf_addr2str = libcfs_decnum_addr2str, + .nf_str2addr = libcfs_num_str2addr, + .nf_parse_addrlist = libcfs_num_parse, + .nf_print_addrlist = libcfs_num_addr_range_print, + .nf_match_addr = libcfs_num_match, + .nf_min_max = cfs_num_min_max, + .nf_expand_addrrange = libcfs_num_addr_range_expand + }, }; static const size_t libcfs_nnetstrfns = diff --git a/lnet/include/uapi/linux/lnet/nidstr.h b/lnet/include/uapi/linux/lnet/nidstr.h index d67f1d1..9cb0cfd 100644 --- a/lnet/include/uapi/linux/lnet/nidstr.h +++ b/lnet/include/uapi/linux/lnet/nidstr.h @@ -47,6 +47,7 @@ enum { KFILND = 16, /* HPE Kernel Fabric Interface */ TOFULND = 17, /* Fujitsu Torus Fusion */ EFALND = 18, /* Amazon Elastic Fabric Adapter */ + BXI3LND = 19, /* Bull BXIv3 Fabric Interface */ /* Please email adilger@whamcloud.com and lustre-devel@lists.lustre.org * to reserve new LND numbers before they are used anywhere. This only * takes a few minutes, and will save everyone a lot of grief later. diff --git a/lnet/lnet/nidstrings.c b/lnet/lnet/nidstrings.c index 07ad3a2..2d9d157 100644 --- a/lnet/lnet/nidstrings.c +++ b/lnet/lnet/nidstrings.c @@ -1399,6 +1399,16 @@ static struct netstrfns libcfs_netstrfns[] = { .nf_print_addrlist = libcfs_num_addr_range_print, .nf_match_addr = libcfs_num_match }, + { + .nf_type = BXI3LND, + .nf_name = "bxi3f", + .nf_modname = "kbxi3lnd", + .nf_addr2str = libcfs_decnum_addr2str, + .nf_str2addr = libcfs_num_str2addr, + .nf_parse_addrlist = libcfs_num_parse, + .nf_print_addrlist = libcfs_num_addr_range_print, + .nf_match_addr = libcfs_num_match + }, }; static const size_t libcfs_nnetstrfns = ARRAY_SIZE(libcfs_netstrfns); diff --git a/lustre/tests/sanity-lnet.sh b/lustre/tests/sanity-lnet.sh index af1274f..e5ddfb18 100755 --- a/lustre/tests/sanity-lnet.sh +++ b/lustre/tests/sanity-lnet.sh @@ -176,7 +176,7 @@ validate_nid() { local num_re='[0-9]+' - if [[ $net =~ (gni|kfi)[0-9]* ]]; then + if [[ $net =~ (gni|kfi|bxi3f)[0-9]* ]]; then [[ $addr =~ ${num_re} ]] && rc=0 elif [[ $net =~ tcp[0-9]* ]]; then if ip_is_v4 "$addr" || ip_is_v6 "$addr"; then @@ -457,6 +457,8 @@ peer: - nid: 10@gni - nid: 6@kfi - nid: 10@kfi + - nid: 6@bxi3f + - nid: 10@bxi3f EOF append_global_yaml @@ -464,6 +466,7 @@ EOF nid_expr+=",6.6.[1-4/2].[0-6/3]@o2ib" nid_expr+=",[6-12/4]@gni" nid_expr+=",[6-12/4]@kfi" + nid_expr+=",[6-12/4]@bxi3f" compare_peer_add "6.6.6.6@tcp" "${nid_expr}" } @@ -527,9 +530,22 @@ test_7() { error "Peer add failed $?" compare_peer_del "7@kfi" - echo "Delete peer that has tcp, o2ib, gni and kfi nids" - do_lnetctl peer add --prim_nid 7@gni \ - --nid [8-12]@gni,7.7.7.[1-4]@tcp,7.7.7.[5-9]@o2ib,[1-5]@kfi || + echo "Delete peer with single nid (bxi3f)" + do_lnetctl peer add --prim_nid 7@bxi3f || error "Peer add failed $?" + compare_peer_del "7@bxi3f" + + echo "Delete peer that has multiple nids (bxi3f)" + do_lnetctl peer add --prim_nid 7@bxi3f --nid [8-12]@bxi3f || + error "Peer add failed $?" + compare_peer_del "7@bxi3f" + + echo "Delete peer that has tcp, o2ib, gni, kfi and bxi3f nids" + local nid_expr="[8-12]@gni" + nid_expr+=",7.7.7.[1-4]@tcp" + nid_expr+=",7.7.7.[5-9]@o2ib" + nid_expr+=",[1-5]@kfi" + nid_expr+=",[3-7]@bxi3f" + do_lnetctl peer add --prim_nid 7@gni --nid "${nid_expr}" || error "Peer add failed $?" compare_peer_del "7@gni" @@ -667,7 +683,7 @@ create_nid() { local num="$1" local net="$2" - if [[ $net =~ gni* ]] || [[ $net =~ kfi* ]]; then + if [[ $net =~ (gni|kfi|bxi3f) ]]; then echo "${num}@${net}" else echo "${num}.${num}.${num}.${num}@${net}" -- 1.8.3.1