@@ -1,6 +1,6 @@
include ../Config
-RDMA_OBJ = rdma.o utils.o dev.o link.o ipoib.o
+RDMA_OBJ = rdma.o utils.o dev.o link.o ipoib.o memory.o
TARGETS=rdma
all: $(TARGETS) $(LIBS)
new file mode 100644
@@ -0,0 +1,30 @@
+/*
+ * memory.c RDMA tool
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ * Authors: Leon Romanovsky <leonro@mellanox.com>
+ */
+
+#include "rdma.h"
+
+static void memory_help(char *filename)
+{
+ pr_out("Usage: %s memory show [ DEV ]\n", filename);
+ pr_out(" %s memory set DEV { odp { off | on } |\n", filename);
+ pr_out(" %s memic SIZE }\n", filename);
+}
+
+int obj_memory(struct rdma *rd)
+{
+ if (dev_map_init(rd)) {
+ pr_err("There are no RDMA devices\n");
+ return -ENOENT;
+ }
+
+ memory_help(rd->filename);
+ return 0;
+}
@@ -17,7 +17,7 @@
static void help(char *name)
{
pr_out("Usage: %s [ OPTIONS ] OBJECT { COMMAND | help }\n"
- "where OBJECT := { dev | link | ipoib }\n"
+ "where OBJECT := { dev | link | ipoib | memory }\n"
" OPTIONS := { -V[ersion] }\n", name);
}
@@ -34,6 +34,7 @@ static int rd_cmd(struct rdma *rd)
{ "dev", obj_dev },
{ "link", obj_link },
{ "ipoib", obj_ipoib },
+ { "memory", obj_memory },
{ "help", obj_help },
{ 0 }
};
@@ -65,6 +65,7 @@ struct rdma_obj {
int obj_dev(struct rdma *rd);
int obj_link(struct rdma *rd);
int obj_ipoib(struct rdma *rd);
+int obj_memory(struct rdma *rd);
/*
* Parser interface