Open caopeirui opened 2 years ago
By the way, would you mind telling me the most significant difference between SimpleSwitchThriftAPI and SimpleSwitchP4RuntimeAPI ?
Hi @caopeirui,
the module sswitch_runtime
is included in the behavioral model. You can check out the requirements for P4-Utils here. The difference between the SimpleSwitchThriftAPI
and the SimpleSwitchP4RuntimeAPI
is that the former is the legacy control plane API of the behavioral model, the latter is a new one based on P4Runtime that aims at becoming the new standard for the control plane of all the P4 devices. Unfortunately, SimpleSwitchP4RuntimeAPI
does not support registers operations yet, so you may still want to use the legacy API.
maybe you can find it in the file "behavioral-model/targets/simple_switch/thrift/simple_switch.thrift"
hello,I have met the same problem,and I find file 'sswitch_runtime' in behavioral model ,then i copy it to p4utils/utils/ and slolve the issue,but then it told me that i miss other moudules,when i copy one ,the other apper,all those missing modules can be found in behavioral model,so the issues is caused by bm2?
This is because the directory of simple_switch is not included in the python path. you can create a path file in /path_to_python/lib/python3.10/site-packages,
vim simple_switch.pth
then you can paste the path of simple_switch in the simple_switch.pth file
/path_to_behavioral-model/targets/simple_switch
hello,I have met the same problem,and I find file 'sswitch_runtime' in behavioral model ,then i copy it to p4utils/utils/ and slolve the issue,but then it told me that i miss other moudules,when i copy one ,the other apper,all those missing modules can be found in behavioral model,so the issues is caused by bm2?
Hi @trailll,
Where you able to solve the problem?
Thanks
This is because the directory of simple_switch is not included in the python path. you can create a path file in /path_to_python/lib/python3.10/site-packages,
vim simple_switch.pth
then you can paste the path of simple_switch in the simple_switch.pth file
/path_to_behavioral-model/targets/simple_switch
Hi @ryanyux,
I tried your suggestion but did not work.
Hi @edgar-costa :
p4utils/utils/sswitch_thrift_API.py has the import code: from sswitch_runtime import SimpleSwitch from sswitch_runtime.ttypes import * However, 'sswitch_runtime' cannot be found. Where is the sswitch_runtime module?