@@ -169,6 +169,7 @@ struct lnet_ioctl_config_ni {
__u32 lic_tcp_bonding;
__u32 lic_idx;
__s32 lic_dev_cpt;
+ char pad[4];
char lic_bulk[0];
};
@@ -177,9 +178,10 @@ struct lnet_peer_ni_credit_info {
__u32 cr_refcount;
__s32 cr_ni_peer_tx_credits;
__s32 cr_peer_tx_credits;
+ __s32 cr_peer_min_tx_credits;
+ __u32 cr_peer_tx_qnob;
__s32 cr_peer_rtr_credits;
__s32 cr_peer_min_rtr_credits;
- __u32 cr_peer_tx_qnob;
__u32 cr_ncpt;
};
@@ -2283,7 +2283,7 @@ int lnet_dyn_add_ni(struct lnet_ioctl_config_ni *conf)
struct lnet_net *net;
struct lnet_ni *ni;
struct lnet_ioctl_config_lnd_tunables *tun = NULL;
- int rc;
+ int rc, i;
u32 net_id;
/* get the tunables if they are available */
@@ -2303,6 +2303,11 @@ int lnet_dyn_add_ni(struct lnet_ioctl_config_ni *conf)
if (!net)
return -ENOMEM;
+ for (i = 0; i < conf->lic_ncpts; i++) {
+ if (conf->lic_cpts[i] >= LNET_CPT_NUMBER)
+ return -EINVAL;
+ }
+
ni = lnet_ni_alloc_w_cpt_array(net, conf->lic_cpts, conf->lic_ncpts,
conf->lic_ni_intf[0]);
if (!ni)
@@ -2760,7 +2765,7 @@ LNetCtl(unsigned int cmd, void *arg)
&peer_info->pr_lnd_u.pr_peer_credits.cr_ni_peer_tx_credits,
&peer_info->pr_lnd_u.pr_peer_credits.cr_peer_tx_credits,
&peer_info->pr_lnd_u.pr_peer_credits.cr_peer_rtr_credits,
- &peer_info->pr_lnd_u.pr_peer_credits.cr_peer_min_rtr_credits,
+ &peer_info->pr_lnd_u.pr_peer_credits.cr_peer_min_tx_credits,
&peer_info->pr_lnd_u.pr_peer_credits.cr_peer_tx_qnob);
mutex_unlock(&the_lnet.ln_api_mutex);
return rc;
@@ -1127,7 +1127,8 @@ int lnet_get_peer_info(__u32 idx, lnet_nid_t *primary_nid, lnet_nid_t *nid,
lpni->lpni_net->net_tunables.lct_peer_tx_credits : 0;
peer_ni_info->cr_peer_tx_credits = lpni->lpni_txcredits;
peer_ni_info->cr_peer_rtr_credits = lpni->lpni_rtrcredits;
- peer_ni_info->cr_peer_min_rtr_credits = lpni->lpni_mintxcredits;
+ peer_ni_info->cr_peer_min_rtr_credits = lpni->lpni_minrtrcredits;
+ peer_ni_info->cr_peer_min_tx_credits = lpni->lpni_mintxcredits;
peer_ni_info->cr_peer_tx_qnob = lpni->lpni_txqnob;
peer_ni_stats->send_count = atomic_read(&lpni->lpni_stats.send_count);