Remove depenency on internal BMv2 device ID when starting bmv2.py
Needed to support TestON-based Segment Routing tests. All instances
started with internal ID = 0 (one PI/P4Runtime server procees is
executed for each simple_switch_grpc instance, i.e, there's no need to
use different internal IDs to distinguish between switch instances).
Log/conf files and bm-* commands are now based on switch name.
Change-Id: I34d3079d6dff5933ceb4d95f04863426af24eb81
diff --git a/tools/dev/p4vm/bm-commands.sh b/tools/dev/p4vm/bm-commands.sh
index ee96f22..50e87e1 100644
--- a/tools/dev/p4vm/bm-commands.sh
+++ b/tools/dev/p4vm/bm-commands.sh
@@ -7,7 +7,7 @@
bm-cli () {
if [ -z "$1" ]; then
- echo "No argument supplied. Usage: bm-cli <BMV2 DEVICE ID>"
+ echo "No argument supplied. Usage: bm-cli <MININET SWITCH NAME>"
return
fi
tport=$(head -n 1 /tmp/bmv2-$1-thrift-port)
@@ -17,17 +17,17 @@
bm-dbg () {
if [ -z "$1" ]; then
- echo "No argument supplied. Usage: bm-dbg <BMV2 DEVICE ID>"
+ echo "No argument supplied. Usage: bm-dbg <MININET SWITCH NAME>"
return
fi
tport=$(head -n 1 /tmp/bmv2-$1-thrift-port)
echo "Starting debugger for BMv2 instance $1 (Thrift port $tport)..."
- sudo ${BMV2_PATH}/tools/p4dbg.py --thrift-port ${tport} ${@:2}
+ sudo bm_p4dbg --thrift-port ${tport} --socket ipc:///tmp/bmv2-$1-debug.ipc ${@:2}
}
bm-nmsg () {
if [ -z "$1" ]; then
- echo "No argument supplied. Usage: bm-nmsg <BMV2 DEVICE ID>"
+ echo "No argument supplied. Usage: bm-nmsg <MININET SWITCH NAME>"
return
fi
tport=$(head -n 1 /tmp/bmv2-$1-thrift-port)
@@ -37,7 +37,7 @@
bm-log () {
if [ -z "$1" ]; then
- echo "No argument supplied. Usage: bm-log <BMV2 DEVICE ID>"
+ echo "No argument supplied. Usage: bm-log <MININET SWITCH NAME>"
return
fi
echo "Showing log for BMv2 instance $1..."