Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-10391 lnet: extend prefered nids in struct lnet_peer_ni
[fs/lustre-release.git]
/
lnet
/
lnet
/
api-ni.c
diff --git
a/lnet/lnet/api-ni.c
b/lnet/lnet/api-ni.c
index
45abed8
..
f86a31f
100644
(file)
--- a/
lnet/lnet/api-ni.c
+++ b/
lnet/lnet/api-ni.c
@@
-1462,7
+1462,7
@@
lnet_net_clr_pref_rtrs(struct lnet_net *net)
int
lnet_net_add_pref_rtr(struct lnet_net *net,
int
lnet_net_add_pref_rtr(struct lnet_net *net,
-
lnet_nid_t
gw_nid)
+
struct lnet_nid *
gw_nid)
__must_hold(&the_lnet.ln_api_mutex)
{
struct lnet_nid_list *ne;
__must_hold(&the_lnet.ln_api_mutex)
{
struct lnet_nid_list *ne;
@@
-1473,7
+1473,7
@@
__must_hold(&the_lnet.ln_api_mutex)
* lock.
*/
list_for_each_entry(ne, &net->net_rtr_pref_nids, nl_list) {
* lock.
*/
list_for_each_entry(ne, &net->net_rtr_pref_nids, nl_list) {
- if (n
e->nl_nid == gw_nid
)
+ if (n
id_same(&ne->nl_nid, gw_nid)
)
return -EEXIST;
}
return -EEXIST;
}
@@
-1481,7
+1481,7
@@
__must_hold(&the_lnet.ln_api_mutex)
if (!ne)
return -ENOMEM;
if (!ne)
return -ENOMEM;
- ne->nl_nid = gw_nid;
+ ne->nl_nid =
*
gw_nid;
/* Lock the cpt to protect against addition and checks in the
* selection algorithm
/* Lock the cpt to protect against addition and checks in the
* selection algorithm
@@
-1494,11
+1494,11
@@
__must_hold(&the_lnet.ln_api_mutex)
}
bool
}
bool
-lnet_net_is_pref_rtr_locked(struct lnet_net *net,
lnet_nid_t
rtr_nid)
+lnet_net_is_pref_rtr_locked(struct lnet_net *net,
struct lnet_nid *
rtr_nid)
{
struct lnet_nid_list *ne;
{
struct lnet_nid_list *ne;
- CDEBUG(D_NET, "%s: rtr pref em
tp
y: %d\n",
+ CDEBUG(D_NET, "%s: rtr pref em
pt
y: %d\n",
libcfs_net2str(net->net_id),
list_empty(&net->net_rtr_pref_nids));
libcfs_net2str(net->net_id),
list_empty(&net->net_rtr_pref_nids));
@@
-1507,9
+1507,9
@@
lnet_net_is_pref_rtr_locked(struct lnet_net *net, lnet_nid_t rtr_nid)
list_for_each_entry(ne, &net->net_rtr_pref_nids, nl_list) {
CDEBUG(D_NET, "Comparing pref %s with gw %s\n",
list_for_each_entry(ne, &net->net_rtr_pref_nids, nl_list) {
CDEBUG(D_NET, "Comparing pref %s with gw %s\n",
- libcfs_nid
2str(
ne->nl_nid),
- libcfs_nid
2
str(rtr_nid));
- if (
rtr_nid == ne->nl_nid
)
+ libcfs_nid
str(&
ne->nl_nid),
+ libcfs_nidstr(rtr_nid));
+ if (
nid_same(rtr_nid, &ne->nl_nid)
)
return true;
}
return true;
}
@@
-1713,7
+1713,7
@@
lnet_nid_to_ni_addref(struct lnet_nid *nid)
EXPORT_SYMBOL(lnet_nid_to_ni_addref);
int
EXPORT_SYMBOL(lnet_nid_to_ni_addref);
int
-lnet_islocalnid(lnet_nid_t nid)
+lnet_islocalnid
4
(lnet_nid_t nid)
{
struct lnet_ni *ni;
int cpt;
{
struct lnet_ni *ni;
int cpt;
@@
-1726,6
+1726,19
@@
lnet_islocalnid(lnet_nid_t nid)
}
int
}
int
+lnet_islocalnid(struct lnet_nid *nid)
+{
+ struct lnet_ni *ni;
+ int cpt;
+
+ cpt = lnet_net_lock_current();
+ ni = lnet_nid_to_ni_locked(nid, cpt);
+ lnet_net_unlock(cpt);
+
+ return ni != NULL;
+}
+
+int
lnet_count_acceptor_nets(void)
{
/* Return the # of NIs that need the acceptor. */
lnet_count_acceptor_nets(void)
{
/* Return the # of NIs that need the acceptor. */
@@
-3922,6
+3935,7
@@
LNetCtl(unsigned int cmd, void *arg)
struct lnet_ioctl_config_data *config;
struct lnet_process_id id = {0};
struct lnet_ni *ni;
struct lnet_ioctl_config_data *config;
struct lnet_process_id id = {0};
struct lnet_ni *ni;
+ struct lnet_nid nid;
int rc;
BUILD_BUG_ON(sizeof(struct lnet_ioctl_net_config) +
int rc;
BUILD_BUG_ON(sizeof(struct lnet_ioctl_net_config) +
@@
-3949,10
+3963,11
@@
LNetCtl(unsigned int cmd, void *arg)
config->cfg_config_u.cfg_route.rtr_sensitivity;
}
config->cfg_config_u.cfg_route.rtr_sensitivity;
}
+ lnet_nid4_to_nid(config->cfg_nid, &nid);
mutex_lock(&the_lnet.ln_api_mutex);
rc = lnet_add_route(config->cfg_net,
config->cfg_config_u.cfg_route.rtr_hop,
mutex_lock(&the_lnet.ln_api_mutex);
rc = lnet_add_route(config->cfg_net,
config->cfg_config_u.cfg_route.rtr_hop,
-
config->cfg_
nid,
+
&
nid,
config->cfg_config_u.cfg_route.
rtr_priority, sensitivity);
mutex_unlock(&the_lnet.ln_api_mutex);
config->cfg_config_u.cfg_route.
rtr_priority, sensitivity);
mutex_unlock(&the_lnet.ln_api_mutex);