Define the KFILND network type. This reserves the network type number
for future implementation and allows creation of kfi peers and
adding routes to kfi peers.
Lustre-change: https://review.whamcloud.com/47830
Lustre-commit:
5fea36c952373c9a235be7bf57eb2e516fcb36b2
Test-Parameters: trivial testlist=sanity-lnet
HPE-bug-id: LUS-11060
Signed-off-by: Chris Horn <chris.horn@hpe.com>
Change-Id: I9111645f1290c8af4937d1b2689a068df81922a4
Reviewed-on: https://review.whamcloud.com/47987
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Cyril Bordage <cbordage@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
.nf_match_addr = libcfs_num_match,
.nf_min_max = cfs_num_min_max,
.nf_expand_addrrange = libcfs_num_addr_range_expand
.nf_match_addr = libcfs_num_match,
.nf_min_max = cfs_num_min_max,
.nf_expand_addrrange = libcfs_num_addr_range_expand
+ },
+ {
+ .nf_type = KFILND,
+ .nf_name = "kfi",
+ .nf_modname = "kkfilnd",
+ .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
GNILND = 13,
GNIIPLND = 14,
PTL4LND = 15,
GNILND = 13,
GNIIPLND = 14,
PTL4LND = 15,
.nf_print_addrlist = libcfs_num_addr_range_print,
.nf_match_addr = libcfs_num_match
},
.nf_print_addrlist = libcfs_num_addr_range_print,
.nf_match_addr = libcfs_num_match
},
+ {
+ .nf_type = KFILND,
+ .nf_name = "kfi",
+ .nf_modname = "kkfilnd",
+ .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);
};
static const size_t libcfs_nnetstrfns = ARRAY_SIZE(libcfs_netstrfns);
local num_re='[0-9]\+'
local ip_re="[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"
local num_re='[0-9]\+'
local ip_re="[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"
- if [[ $net =~ gni[0-9]* ]]; then
+ if [[ $net =~ gni[0-9]* ]] || [[ $net =~ kfi[0-9]* ]]; then
[[ $addr =~ ${num_re} ]] && return 0
else
[[ $addr =~ ${ip_re} ]] && return 0
[[ $addr =~ ${num_re} ]] && return 0
else
[[ $addr =~ ${ip_re} ]] && return 0
- nid: 6.6.3.6@o2ib
- nid: 6@gni
- nid: 10@gni
- nid: 6.6.3.6@o2ib
- nid: 6@gni
- nid: 10@gni
+ - nid: 6@kfi
+ - nid: 10@kfi
- compare_peer_add "6.6.6.6@tcp" \
- "6.6.[6-7].[0-4/2]@tcp,6.6.[1-4/2].[0-6/3]@o2ib,[6-12/4]@gni"
+
+ local nid_expr="6.6.[6-7].[0-4/2]@tcp"
+ nid_expr+=",6.6.[1-4/2].[0-6/3]@o2ib"
+ nid_expr+=",[6-12/4]@gni"
+ nid_expr+=",[6-12/4]@kfi"
+
+ compare_peer_add "6.6.6.6@tcp" "${nid_expr}"
}
run_test 6 "Add peer with multiple nidranges"
}
run_test 6 "Add peer with multiple nidranges"
error "Peer add failed $?"
compare_peer_del "7@gni"
error "Peer add failed $?"
compare_peer_del "7@gni"
- echo "Delete peer that has tcp, o2ib and gni nids"
+ echo "Delete peer with single nid (kfi)"
+ do_lnetctl peer add --prim_nid 7@kfi || error "Peer add failed $?"
+ compare_peer_del "7@kfi"
+
+ echo "Delete peer that has multiple nids (kfi)"
+ do_lnetctl peer add --prim_nid 7@kfi --nid [8-12]@kfi ||
+ 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 \
do_lnetctl peer add --prim_nid 7@gni \
- --nid [8-12]@gni,7.7.7.[9-12]@tcp,7.7.7.[13-15]@o2ib ||
+ --nid [8-12]@gni,7.7.7.[1-4]@tcp,7.7.7.[5-9]@o2ib,[1-5]@kfi ||
error "Peer add failed $?"
compare_peer_del "7@gni"
}
error "Peer add failed $?"
compare_peer_del "7@gni"
}
local num="$1"
local net="$2"
local num="$1"
local net="$2"
- if [[ $net =~ gni* ]]; then
+ if [[ $net =~ gni* ]] || [[ $net =~ kfi* ]]; then
echo "${num}@${net}"
else
echo "${num}.${num}.${num}.${num}@${net}"
echo "${num}@${net}"
else
echo "${num}.${num}.${num}.${num}@${net}"