#define IOC_LIBCFS_GET_LOCAL_NI _IOWR(IOC_LIBCFS_TYPE, 97, IOCTL_CONFIG_SIZE)
#define IOC_LIBCFS_SET_NUMA_RANGE _IOWR(IOC_LIBCFS_TYPE, 98, IOCTL_CONFIG_SIZE)
#define IOC_LIBCFS_GET_NUMA_RANGE _IOWR(IOC_LIBCFS_TYPE, 99, IOCTL_CONFIG_SIZE)
-#define IOC_LIBCFS_DBG _IOWR(IOC_LIBCFS_TYPE, 100, IOCTL_CONFIG_SIZE)
-#define IOC_LIBCFS_MAX_NR 100
+#define IOC_LIBCFS_MAX_NR 99
extern int libcfs_ioctl_data_adjust(struct libcfs_ioctl_data *data);
/* # different router buffer pools */
#define LNET_NRBPOOLS (LNET_LARGE_BUF_IDX + 1)
-enum lnet_dbg_task {
- LNET_DBG_INCR_DLC_SEQ = 0
-};
-
struct lnet_ioctl_pool_cfg {
struct {
__u32 pl_npages;
} pr_lnd_u;
};
-struct lnet_dbg_task_info {
- /*
- * TODO: a union can be added if the task requires more
- * information from user space to be carried out in kernel space.
- */
-};
-
-/*
- * This structure is intended to allow execution of debugging tasks. This
- * is not intended to be backwards compatible. Extra tasks can be added in
- * the future
- */
-struct lnet_ioctl_dbg {
- struct libcfs_ioctl_hdr dbg_hdr;
- enum lnet_dbg_task dbg_task;
- char dbg_bulk[0];
-};
-
struct lnet_ioctl_peer_cfg {
struct libcfs_ioctl_hdr prcfg_hdr;
lnet_nid_t prcfg_prim_nid;
}
EXPORT_SYMBOL(LNetNIFini);
-
-static int lnet_handle_dbg_task(struct lnet_ioctl_dbg *dbg,
- struct lnet_dbg_task_info *dbg_info)
-{
- switch (dbg->dbg_task) {
- case LNET_DBG_INCR_DLC_SEQ:
- lnet_incr_dlc_seq();
- }
-
- return 0;
-}
/**
* Grabs the ni data from the ni structure and fills the out
* parameters
return 0;
}
- case IOC_LIBCFS_DBG: {
- struct lnet_ioctl_dbg *dbg = arg;
- struct lnet_dbg_task_info *dbg_info;
- size_t total = sizeof(*dbg) + sizeof(*dbg_info);
-
- if (dbg->dbg_hdr.ioc_len < total)
- return -EINVAL;
-
- dbg_info = (struct lnet_dbg_task_info*) dbg->dbg_bulk;
-
- return lnet_handle_dbg_task(dbg, dbg_info);
- }
-
default:
ni = lnet_net2ni_addref(data->ioc_net);
if (ni == NULL)
show_rc, err_rc);
}
-int lustre_lnet_send_dbg_task(enum lnet_dbg_task dbg_task,
- struct lnet_dbg_task_info *dbg_info,
- struct cYAML **show_rc,
- struct cYAML **err_rc)
-{
- struct lnet_ioctl_dbg *dbg;
- struct lnet_dbg_task_info *info;
- int rc = LUSTRE_CFG_RC_NO_ERR;
- char err_str[LNET_MAX_STR_LEN];
-
- snprintf(err_str, sizeof(err_str), "\"success\"");
-
- dbg = calloc(1, sizeof(*dbg) + sizeof(*info));
- if (!dbg) {
- snprintf(err_str, sizeof(err_str), "\"out of memory\"");
- rc = LUSTRE_CFG_RC_OUT_OF_MEM;
- goto out;
- }
-
- info = (struct lnet_dbg_task_info *)dbg->dbg_bulk;
-
- LIBCFS_IOC_INIT_V2(*dbg, dbg_hdr);
-
- dbg->dbg_task = dbg_task;
- if (dbg_info)
- memcpy(info, dbg_info, sizeof(*info));
-
- rc = l_ioctl(LNET_DEV_ID, IOC_LIBCFS_DBG, dbg);
- if (rc != 0) {
- rc = -errno;
- snprintf(err_str,
- sizeof(err_str),
- "\"debug task failed %s\"", strerror(errno));
- goto out;
- }
-
-out:
- cYAML_build_error(rc, -1, DBG_CMD,
- "debug", err_str, err_rc);
-
- return rc;
-}
-
int lustre_lnet_parse_nids(char *nids, char **array, int size,
char ***out_array);
-/*
- * lustre_lnet_send_dbg_task
- * send a debug task to be carried out in the kernel. This API will
- * not be exposed to the user through lnetctl utility. It can only be
- * executed by being called directly.
- * dbg_task: The task to be carried out
- * dbg_info: task specific information
- */
-int lustre_lnet_send_dbg_task(enum lnet_dbg_task dbg_task,
- struct lnet_dbg_task_info *dbg_info,
- struct cYAML **show_rc,
- struct cYAML **err_rc);
-
#endif /* LIB_LNET_CONFIG_API_H */