Skip to contentSkip to conversation

rdma: Add batch command support

PATCH In review Leon Romanovsky 2 participants 2 messages Feb 22, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rdma: Add batch command support

From: Leon Romanovsky <[email protected]>

Implement an option (-b) to execute RDMAtool commands from supplied file. This follows the same model as in use for ip and devlink tools, by expecting every new command to be on new line.

These commands are expected to be without any -* (e.g. -d, -j, e.t.c) global flags, which should be called externally.

---

Changelog v0->v1:
* Used ARRAY_SIZE instead of hardcoded value as an input to makeargs()

David,

This patch is based on iproute2.git because iproute2-next doesn't have latest restrack code. The patch itself is completely independent from that code and is supposed to go to -next, but it has conflicts (manual page and help line).

Can you please merge iproute2 master into iproute2-next prior to applying this patch?

Thanks

---
 man/man8/rdma.8 | 16 +++++++++++++
 rdma/rdma.c     | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 78 insertions(+), 8 deletions(-)
man/man8/rdma.8 +16 -0
index 798b33d3..fba77693 100644
@@ -11,6 +11,12 @@ rdma \- RDMA tool
 .BR help " }"
 .sp
 
+.ti -8
+.B rdma
+.RB "[ " -force " ] "
+.BI "-batch " filename
+.sp
+
 .ti -8
 .IR OBJECT " := { "
 .BR dev " | " link " }"
@@ -31,6 +37,16 @@ Print the version of the
 .B rdma
 tool and exit.
 
+.TP
+.BR "\-b", " \-batch " <FILENAME>
+Read commands from provided file or standard input and invoke them.
+First failure will cause termination of rdma.
+
+.TP
+.BR "\-force"
+Don't terminate rdma on errors in batch mode.
+If there were any errors during execution of the commands, the application return code will be non zero.
+
 .TP
 .BR "\-d" , " --details"
 Otuput detailed information.
rdma/rdma.c +62 -8

132 lines not on this page · raw message

--
2.16.1

#1 lore raw
Quoted 19 lines · Leon Romanovsky

From: Leon Romanovsky <[email protected]>

Implement an option (-b) to execute RDMAtool commands from supplied file. This follows the same model as in use for ip and devlink tools, by expecting every new command to be on new line.

These commands are expected to be without any -* (e.g. -d, -j, e.t.c) global flags, which should be called externally.

---

Changelog v0->v1:
* Used ARRAY_SIZE instead of hardcoded value as an input to makeargs()

David,

Quoted 8 lines

This patch is based on iproute2.git because iproute2-next doesn't have latest restrack code. The patch itself is completely independent from that code and is supposed to go to -next, but it has conflicts (manual page and help line).

Can you please merge iproute2 master into iproute2-next prior to applying this patch?

Done. And applied to iproute2-next