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;
* lock.
*/
list_for_each_entry(ne, &net->net_rtr_pref_nids, nl_list) {
- if (ne->nl_nid == gw_nid)
+ if (nid_same(&ne->nl_nid, gw_nid))
return -EEXIST;
}
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
}
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;
- CDEBUG(D_NET, "%s: rtr pref emtpy: %d\n",
+ CDEBUG(D_NET, "%s: rtr pref empty: %d\n",
libcfs_net2str(net->net_id),
list_empty(&net->net_rtr_pref_nids));
list_for_each_entry(ne, &net->net_rtr_pref_nids, nl_list) {
CDEBUG(D_NET, "Comparing pref %s with gw %s\n",
- libcfs_nid2str(ne->nl_nid),
- libcfs_nid2str(rtr_nid));
- if (rtr_nid == ne->nl_nid)
+ libcfs_nidstr(&ne->nl_nid),
+ libcfs_nidstr(rtr_nid));
+ if (nid_same(rtr_nid, &ne->nl_nid))
return true;
}
EXPORT_SYMBOL(lnet_nid_to_ni_addref);
int
-lnet_islocalnid(lnet_nid_t nid)
+lnet_islocalnid4(lnet_nid_t nid)
{
struct lnet_ni *ni;
int cpt;
}
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. */
struct lnet_handle_md *ping_mdh,
int ni_count, bool set_eq)
{
- struct lnet_process_id id = {
- .nid = LNET_NID_ANY,
+ struct lnet_processid id = {
+ .nid = LNET_ANY_NID,
.pid = LNET_PID_ANY
};
struct lnet_me *me;
}
/* Ping target ME/MD */
- me = LNetMEAttach(LNET_RESERVED_PORTAL, id,
+ me = LNetMEAttach(LNET_RESERVED_PORTAL, &id,
LNET_PROTO_PING_MATCHBITS, 0,
LNET_UNLINK, LNET_INS_AFTER);
if (IS_ERR(me)) {
int lnet_push_target_post(struct lnet_ping_buffer *pbuf,
struct lnet_handle_md *mdhp)
{
- struct lnet_process_id id = { LNET_NID_ANY, LNET_PID_ANY };
+ struct lnet_processid id = { LNET_ANY_NID, LNET_PID_ANY };
struct lnet_md md = { NULL };
struct lnet_me *me;
int rc;
- me = LNetMEAttach(LNET_RESERVED_PORTAL, id,
+ me = LNetMEAttach(LNET_RESERVED_PORTAL, &id,
LNET_PROTO_PING_MATCHBITS, 0,
LNET_UNLINK, LNET_INS_AFTER);
if (IS_ERR(me)) {
list->lkl_maxattr);
nla_put_u16(msg, LN_SCALAR_ATTR_INDEX, count);
- if (props[count].lkp_values)
+ if (props[count].lkp_value)
nla_put_string(msg, LN_SCALAR_ATTR_VALUE,
- props[count].lkp_values);
+ props[count].lkp_value);
if (props[count].lkp_key_format)
nla_put_u16(msg, LN_SCALAR_ATTR_KEY_FORMAT,
props[count].lkp_key_format);
rc = lnet_genl_parse_list(msg, data, ++idx);
if (rc < 0)
return rc;
+ idx = rc;
}
nla_nest_end(msg, key);
}
nla_nest_end(msg, node);
- return 0;
+ return idx;
}
int lnet_genl_send_scalar_list(struct sk_buff *msg, u32 portid, u32 seq,
canceled:
if (rc < 0)
genlmsg_cancel(msg, hdr);
- return rc;
+ return rc > 0 ? 0 : rc;
}
EXPORT_SYMBOL(lnet_genl_send_scalar_list);
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) +
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,
- config->cfg_nid,
+ &nid,
config->cfg_config_u.cfg_route.
rtr_priority, sensitivity);
mutex_unlock(&the_lnet.ln_api_mutex);