conf = (struct lnet_ioctl_config_ni*) data;
if (i == 0 && tunables != NULL)
tun = (struct lnet_ioctl_config_lnd_tunables*)
- (data + sizeof(*conf));
+ conf->lic_bulk;
LIBCFS_IOC_INIT_V2(*conf, lic_cfg_hdr);
conf->lic_cfg_hdr.ioc_len = len;
== NULL)
goto out;
+ if (cYAML_create_number(peer_ni, "min_tx_credits",
+ lpni_cri->cr_peer_min_tx_credits)
+ == NULL)
+ goto out;
+
+ if (cYAML_create_number(peer_ni, "tx_q_num_of_buf",
+ lpni_cri->cr_peer_tx_qnob)
+ == NULL)
+ goto out;
+
if (cYAML_create_number(peer_ni, "available_rtr_credits",
lpni_cri->cr_peer_rtr_credits)
== NULL)
== NULL)
goto out;
- if (cYAML_create_number(peer_ni, "tx_q_num_of_buf",
- lpni_cri->cr_peer_tx_qnob)
- == NULL)
- goto out;
-
if (cYAML_create_number(peer_ni, "send_count",
lpni_stats->send_count)
== NULL)
static bool
yaml_extract_cmn_tunables(struct cYAML *tree,
struct lnet_ioctl_config_lnd_cmn_tunables *tunables,
- int *num_global_cpts,
struct cfs_expr_list **global_cpts)
{
struct cYAML *tun, *item, *smp;
+ int rc;
tun = cYAML_get_object_item(tree, "tunables");
if (tun != NULL) {
tunables->lct_max_tx_credits = item->cy_valueint;
smp = cYAML_get_object_item(tun, "CPT");
if (smp != NULL) {
- *num_global_cpts =
- cfs_expr_list_parse(smp->cy_valuestring,
+ rc = cfs_expr_list_parse(smp->cy_valuestring,
strlen(smp->cy_valuestring),
0, UINT_MAX, global_cpts);
+ if (rc != 0)
+ *global_cpts = NULL;
}
return true;
static bool
yaml_extract_tunables(struct cYAML *tree,
struct lnet_ioctl_config_lnd_tunables *tunables,
- int *num_global_cpts,
struct cfs_expr_list **global_cpts,
__u32 net_type)
{
bool rc;
rc = yaml_extract_cmn_tunables(tree, &tunables->lt_cmn,
- num_global_cpts, global_cpts);
+ global_cpts);
if (!rc)
return rc;
{
struct cYAML *net, *intf, *seq_no, *ip2net = NULL, *local_nis = NULL,
*item = NULL;
- int num_entries = 0, num_global_cpts = 0, rc;
+ int num_entries = 0, rc;
struct lnet_dlc_network_descr nw_descr;
struct cfs_expr_list *global_cpts = NULL;
struct lnet_ioctl_config_lnd_tunables tunables;
}
}
- found = yaml_extract_tunables(tree, &tunables, &num_global_cpts,
- &global_cpts,
+ found = yaml_extract_tunables(tree, &tunables, &global_cpts,
LNET_NETTYP(nw_descr.nw_id));
seq_no = cYAML_get_object_item(tree, "seq_no");
rc = lustre_lnet_config_ni(&nw_descr,
- (num_global_cpts > 0) ? global_cpts: NULL,
+ global_cpts,
(ip2net) ? ip2net->cy_valuestring : NULL,
(found) ? &tunables: NULL,
(seq_no) ? seq_no->cy_valueint : -1,
struct lustre_lnet_ip2nets ip2nets;
struct lustre_lnet_ip_range_descr *ip_range_descr = NULL,
*tmp = NULL;
- int rc = LUSTRE_CFG_RC_NO_ERR, num_global_cpts = 0;
+ int rc = LUSTRE_CFG_RC_NO_ERR;
struct cfs_expr_list *global_cpts = NULL;
struct cfs_expr_list *el, *el_tmp;
struct lnet_ioctl_config_lnd_tunables tunables;
}
}
- found = yaml_extract_tunables(tree, &tunables, &num_global_cpts,
- &global_cpts,
+ found = yaml_extract_tunables(tree, &tunables, &global_cpts,
LNET_NETTYP(ip2nets.ip2nets_net.nw_id));
rc = lustre_lnet_config_ip2nets(&ip2nets,
(found) ? &tunables : NULL,
- (num_global_cpts > 0) ? global_cpts : NULL,
+ global_cpts,
(seq_no) ? seq_no->cy_valueint : -1,
err_rc);