1. P4 Control Plane對Data Plane下命令的Command Line開啟方式
a. 在run example後(執行MiniNet後)
b. 開啟另一個視窗執行
simple_switch_CLI --thrift-port 9090
c. 執行 help 可見相關文件
Debugger
utils有兩個Python檔,要把Enable debugger改成True
cd /home/p4/tutorials/bmv2/tools
sudo ./p4dbg.py --thrift-ip 127.0.0.1 --thrift-port 9090
交換器 nanomsg
cd /home/p4/tutorials/bmv2/tools
sudo ./nanomsg_client.py --thrift-port 9090
交換器 Log
/tmp/p4s.<switch-name>.log
搜尋特定檔案
sudo find / -iname 'v1model.p4'
-iname 代表不看大小寫
更改v1model.p4內的Register為 bit<64>。 原值應為 bit<32>
extern register<T>{
register(bit<64> size)
void .......
}
雖然說v1model 軟體模組裡面允許你這麼幹,不代表晶片就支援,畢竟晶片的Register大小是固定的。
P4 14 轉換 P4 16
可使用 p4c-bm2-ss 轉換。
p4c-bm2-ss --p4v 14 --pp [輸出檔案] [輸入的檔案]
在xterm h1 裡面播trace
tcpreplay -i h1-eth0 pcap名稱
讀Counter的方法
COUNTER_READ MY_INDIRECT_COUNTER 0
在~/tutorials/bmv2下,為了取得bmv2校能, 關閉logging功能
sudo ./autogen.sh && sudo ./configure --disable-logging-macros --disable-elogger 'CFLAGS=-O3' 'CXXFLAGS=-O3'
sudo make -j4