#include <fcntl.h>
#include <ifaddrs.h>
#include "liblnetconfig.h"
-#include "cyaml.h"
#define CONFIG_CMD "configure"
#define UNCONFIG_CMD "unconfigure"
int lustre_lnet_config_lib_init(void)
{
- return register_ioc_dev(LNET_DEV_ID, LNET_DEV_PATH,
- LNET_DEV_MAJOR, LNET_DEV_MINOR);
+ return register_ioc_dev(LNET_DEV_ID, LNET_DEV_PATH);
}
void lustre_lnet_config_lib_uninit(void)
if (nw == NULL || gw == NULL) {
snprintf(err_str,
sizeof(err_str),
- "\"missing mandatory parameter(s): '%s'\"",
+ "\"missing mandatory parameter in route config:'%s'\"",
(nw == NULL && gw == NULL) ? "network, gateway" :
(nw == NULL) ? "network" : "gateway");
rc = LUSTRE_CFG_RC_MISSING_PARAM;
if (nw == NULL || gw == NULL) {
snprintf(err_str,
sizeof(err_str),
- "\"missing mandatory parameter(s): '%s'\"",
+ "\"missing mandatory parameter in route delete: '%s'\"",
(nw == NULL && gw == NULL) ? "network, gateway" :
(nw == NULL) ? "network" : "gateway");
rc = LUSTRE_CFG_RC_MISSING_PARAM;
list_empty(&nw_descr->nw_intflist))) {
snprintf(err_str,
sizeof(err_str),
- "\"missing mandatory parameters\"");
+ "\"missing mandatory parameters in NI config: '%s'\"",
+ (nw_descr == NULL) ? "network , interface" :
+ (nw_descr->nw_id == 0) ? "network" : "interface");
rc = LUSTRE_CFG_RC_MISSING_PARAM;
goto out;
}
list_empty(&nw_descr->nw_intflist)) {
snprintf(err_str,
sizeof(err_str),
- "\"missing mandatory parameter\"");
+ "\"missing mandatory parameter in deleting NI: '%s'\"",
+ (nw_descr == NULL) ? "network , interface" :
+ (nw_descr->nw_id == 0) ? "network" : "interface");
rc = LUSTRE_CFG_RC_MISSING_PARAM;
goto out;
}
show_rc, err_rc);
}
+static int handle_yaml_config_numa(struct cYAML *tree, struct cYAML **show_rc,
+ struct cYAML **err_rc)
+{
+ struct cYAML *seq_no, *range;
+
+ seq_no = cYAML_get_object_item(tree, "seq_no");
+ range = cYAML_get_object_item(tree, "range");
+
+ return lustre_lnet_config_numa_range(range ? range->cy_valueint : -1,
+ seq_no ? seq_no->cy_valueint : -1,
+ err_rc);
+}
+
+static int handle_yaml_del_numa(struct cYAML *tree, struct cYAML **show_rc,
+ struct cYAML **err_rc)
+{
+ struct cYAML *seq_no;
+
+ seq_no = cYAML_get_object_item(tree, "seq_no");
+
+ return lustre_lnet_config_numa_range(0, seq_no ? seq_no->cy_valueint : -1,
+ err_rc);
+}
+
+static int handle_yaml_show_numa(struct cYAML *tree, struct cYAML **show_rc,
+ struct cYAML **err_rc)
+{
+ struct cYAML *seq_no;
+
+ seq_no = cYAML_get_object_item(tree, "seq_no");
+
+ return lustre_lnet_show_numa_range(seq_no ? seq_no->cy_valueint : -1,
+ show_rc, err_rc);
+}
+
static int handle_yaml_config_global_settings(struct cYAML *tree,
struct cYAML **show_rc,
struct cYAML **err_rc)
{ .name = "buffers", .cb = handle_yaml_config_buffers },
{ .name = "statistics", .cb = handle_yaml_no_op },
{ .name = "global", .cb = handle_yaml_config_global_settings},
+ { .name = "numa", .cb = handle_yaml_config_numa },
{ .name = "ping", .cb = handle_yaml_no_op },
{ .name = "discover", .cb = handle_yaml_no_op },
{ .name = NULL } };
{ .name = "buffers", .cb = handle_yaml_no_op },
{ .name = "statistics", .cb = handle_yaml_no_op },
{ .name = "global", .cb = handle_yaml_del_global_settings},
+ { .name = "numa", .cb = handle_yaml_del_numa },
{ .name = "ping", .cb = handle_yaml_no_op },
{ .name = "discover", .cb = handle_yaml_no_op },
{ .name = NULL } };
{ .name = "buffers", .cb = handle_yaml_show_routing },
{ .name = "statistics", .cb = handle_yaml_show_stats },
{ .name = "global", .cb = handle_yaml_show_global_settings},
+ { .name = "numa", .cb = handle_yaml_show_numa },
{ .name = "ping", .cb = handle_yaml_no_op },
{ .name = "discover", .cb = handle_yaml_no_op },
{ .name = NULL } };
{ .name = "buffers", .cb = handle_yaml_no_op },
{ .name = "statistics", .cb = handle_yaml_no_op },
{ .name = "global", .cb = handle_yaml_no_op },
+ { .name = "numa", .cb = handle_yaml_no_op },
{ .name = "ping", .cb = handle_yaml_ping },
{ .name = "discover", .cb = handle_yaml_discover },
{ .name = NULL } };