p4lang: switch-更完善的P4例子

10/16/2016 發現CI/travis目錄下面有依賴工具的安裝腳本,供參考

switch是個參考的switch例子,很多表可以參考,並且生成了SAI等API供調用。
============================================

首先要參照前面兩篇文章安裝BMv2(p4-behavioral-model)和p4c-bmv2(p4c-bm)

安裝PTF:
git clone https://github.com/p4lang/ptf.git
cd ptf; sudo python setup.py install

安裝switch:
git clone https://github.com/p4lang/switch.git
cd switch
git submodule update --init --recursive
./autogen.sh
./configure --with-bmv2 --with-switchsai
make
#如果在configure步驟找不到bm相關頭文件,需要進入behavioral-model項目執行sudo make install

運行:
sudo tools/veth_setup.sh
sudo bmv2/run_bm.sh
新窗口:
sudo bmv2/run_drivers.sh

測試腳本:
sudo ./bmv2/run_tests.sh --test-dir tests/ptf-tests/pd-tests # for the PD tests
sudo ./bmv2/run_tests.sh --test-dir tests/ptf-tests/api-tests # for the switchapi tests
sudo ./bmv2/run_tests.sh --test-dir tests/ptf-tests/sai-tests # for the switchsai tests

BMv2的命令行調試工具:
bm_CLI
#show_ports, show_tables, switch_info...
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章