From: Olaf Weber Date: Fri, 27 Jan 2017 15:15:50 +0000 (+0100) Subject: LU-9119 lnet: remove debug ioctl X-Git-Tag: 2.9.57~22 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;ds=sidebyside;h=refs%2Fchanges%2F88%2F26688%2F4;p=fs%2Flustre-release.git LU-9119 lnet: remove debug ioctl Remove a debug ioctl that was added to allow for debug messages from user space. However, the code is currently not being used. Test-Parameters: trivial Signed-off-by: Amir Shehata Signed-off-by: Olaf Weber Change-Id: Ifd2bee73ef507bd07296af76dac1caf08ded9e64 Reviewed-on: https://review.whamcloud.com/26688 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Doug Oucharek Reviewed-by: Oleg Drokin --- diff --git a/libcfs/include/libcfs/libcfs_ioctl.h b/libcfs/include/libcfs/libcfs_ioctl.h index 027cb5e..6b79096 100644 --- a/libcfs/include/libcfs/libcfs_ioctl.h +++ b/libcfs/include/libcfs/libcfs_ioctl.h @@ -148,8 +148,7 @@ struct libcfs_debug_ioctl_data #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); diff --git a/lnet/include/lnet/lib-dlc.h b/lnet/include/lnet/lib-dlc.h index 1a67738..f8db465 100644 --- a/lnet/include/lnet/lib-dlc.h +++ b/lnet/include/lnet/lib-dlc.h @@ -93,10 +93,6 @@ struct lnet_ioctl_net_config { /* # 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; @@ -195,24 +191,6 @@ struct lnet_ioctl_peer { } 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; diff --git a/lnet/lnet/api-ni.c b/lnet/lnet/api-ni.c index 1ffe5b9..38fe93a 100644 --- a/lnet/lnet/api-ni.c +++ b/lnet/lnet/api-ni.c @@ -1936,17 +1936,6 @@ LNetNIFini() } 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 @@ -2916,19 +2905,6 @@ LNetCtl(unsigned int cmd, void *arg) 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) diff --git a/lnet/utils/lnetconfig/liblnetconfig.c b/lnet/utils/lnetconfig/liblnetconfig.c index dc27874..2515a02 100644 --- a/lnet/utils/lnetconfig/liblnetconfig.c +++ b/lnet/utils/lnetconfig/liblnetconfig.c @@ -3158,46 +3158,3 @@ int lustre_yaml_show(char *f, struct cYAML **show_rc, struct cYAML **err_rc) 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; -} - diff --git a/lnet/utils/lnetconfig/liblnetconfig.h b/lnet/utils/lnetconfig/liblnetconfig.h index 3256726..5b9e36b 100644 --- a/lnet/utils/lnetconfig/liblnetconfig.h +++ b/lnet/utils/lnetconfig/liblnetconfig.h @@ -377,17 +377,4 @@ int lustre_lnet_parse_interfaces(char *intf_str, 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 */