-#include "gmnal.h"
-
-
-/*
- * -1 indicates default value.
- * This is 1 thread per cpu
- * See start_kernel_threads
- */
-int num_rx_threads = -1;
-int num_stxds = 5;
-int gm_port_id = 4;
-
-int
-gmnal_cmd(struct portals_cfg *pcfg, void *private)
-{
- gmnal_ni_t *gmnalni = NULL;
- char *name = NULL;
- int nid = -2;
- int gmid;
- gm_status_t gm_status;
-
-
- CDEBUG(D_TRACE, "gmnal_cmd [%d] private [%p]\n",
- pcfg->pcfg_command, private);
- gmnalni = (gmnal_ni_t*)private;
- switch(pcfg->pcfg_command) {
- /*
- * just reuse already defined GET_NID. Should define GMNAL version
- */
- case(GMNAL_IOC_GET_GNID):
-
- PORTAL_ALLOC(name, pcfg->pcfg_plen1);
- copy_from_user(name, PCFG_PBUF(pcfg, 1), pcfg->pcfg_plen1);
-
- spin_lock(&gmnalni->gmni_gm_lock);
- //nid = gm_host_name_to_node_id(gmnalni->gmni_port, name);
- gm_status = gm_host_name_to_node_id_ex(gmnalni->gmni_port, 0,
- name, &nid);
- spin_unlock(&gmnalni->gmni_gm_lock);
- if (gm_status != GM_SUCCESS) {
- CDEBUG(D_NET, "gm_host_name_to_node_id_ex(...host %s) "
- "failed[%d]\n", name, gm_status);
- return (-1);
- } else
- CDEBUG(D_NET, "Local node %s id is [%d]\n", name, nid);
- spin_lock(&gmnalni->gmni_gm_lock);
- gm_status = gm_node_id_to_global_id(gmnalni->gmni_port,
- nid, &gmid);
- spin_unlock(&gmnalni->gmni_gm_lock);
- if (gm_status != GM_SUCCESS) {
- CDEBUG(D_NET, "gm_node_id_to_global_id failed[%d]\n",
- gm_status);
- return(-1);
- }
- CDEBUG(D_NET, "Global node is is [%u][%x]\n", gmid, gmid);
- copy_to_user(PCFG_PBUF(pcfg, 2), &gmid, pcfg->pcfg_plen2);
- break;
- default:
- CDEBUG(D_NET, "gmnal_cmd UNKNOWN[%d]\n", pcfg->pcfg_command);
- pcfg->pcfg_nid2 = -1;
- }
-
-
- return(0);
-}
-
+#include "gmlnd.h"
+
+
+static int port = 4;
+CFS_MODULE_PARM(port, "i", int, 0444,
+ "GM port to use for communications");
+
+static int ntx = 256;
+CFS_MODULE_PARM(ntx, "i", int, 0444,
+ "# tx descriptors");
+
+static int credits = 128;
+CFS_MODULE_PARM(credits, "i", int, 0444,
+ "# concurrent sends");
+
+static int peer_credits = 8;
+CFS_MODULE_PARM(peer_credits, "i", int, 0444,
+ "# concurrent sends per peer");
+
+static int nlarge_tx_bufs = 32;
+CFS_MODULE_PARM(nlarge_tx_bufs, "i", int, 0444,
+ "# large tx message buffers");
+
+static int nrx_small = 128;
+CFS_MODULE_PARM(nrx_small, "i", int, 0444,
+ "# small rx message buffers");
+
+static int nrx_large = 64;
+CFS_MODULE_PARM(nrx_large, "i", int, 0444,
+ "# large rx message buffers");
+
+gmnal_tunables_t gmnal_tunables = {
+ .gm_port = &port,
+ .gm_ntx = &ntx,
+ .gm_credits = &credits,
+ .gm_peer_credits = &peer_credits,
+ .gm_nlarge_tx_bufs = &nlarge_tx_bufs,
+ .gm_nrx_small = &nrx_small,
+ .gm_nrx_large = &nrx_large,
+};
+
+#if CONFIG_SYSCTL && !CFS_SYSFS_MODULE_PARM
+static ctl_table gmnal_ctl_table[] = {
+ {1, "port", &port,
+ sizeof (int), 0444, NULL, &proc_dointvec},
+ {2, "ntx", &ntx,
+ sizeof (int), 0444, NULL, &proc_dointvec},
+ {3, "credits", &credits,
+ sizeof (int), 0444, NULL, &proc_dointvec},
+ {4, "peer_credits", &peer_credits,
+ sizeof (int), 0444, NULL, &proc_dointvec},
+ {5, "nlarge_tx_bufs", &nlarge_tx_bufs,
+ sizeof (int), 0444, NULL, &proc_dointvec},
+ {6, "nrx_small", &nrx_small,
+ sizeof (int), 0444, NULL, &proc_dointvec},
+ {7, "nrx_large", &nrx_large,
+ sizeof (int), 0444, NULL, &proc_dointvec},
+ {0}
+};
+
+static ctl_table gmnal_top_ctl_table[] = {
+ {207, "gmnal", NULL, 0, 0555, gmnal_ctl_table},
+ {0}
+};
+#endif