Whamcloud - gitweb
LU-9119 lnet: remove debug ioctl 88/26688/4
authorOlaf Weber <olaf@sgi.com>
Fri, 27 Jan 2017 15:15:50 +0000 (16:15 +0100)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 1 May 2017 17:49:51 +0000 (17:49 +0000)
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 <amir.shehata@intel.com>
Signed-off-by: Olaf Weber <olaf@sgi.com>
Change-Id: Ifd2bee73ef507bd07296af76dac1caf08ded9e64
Reviewed-on: https://review.whamcloud.com/26688
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
libcfs/include/libcfs/libcfs_ioctl.h
lnet/include/lnet/lib-dlc.h
lnet/lnet/api-ni.c
lnet/utils/lnetconfig/liblnetconfig.c
lnet/utils/lnetconfig/liblnetconfig.h

index 027cb5e..6b79096 100644 (file)
@@ -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);
 
index 1a67738..f8db465 100644 (file)
@@ -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;
index 1ffe5b9..38fe93a 100644 (file)
@@ -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)
index dc27874..2515a02 100644 (file)
@@ -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;
-}
-
index 3256726..5b9e36b 100644 (file)
@@ -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 */