Open ccascone opened 4 years ago
Here some insights from a preliminary run of p4pktgen
on bng.p4.
Some modifications to the logical pipeline are needed:
exit
statement, it seems not supported. It shouldn't require modification to P4Runtime interface.if(my_stations.apply().hit)
. The condition on hit is not supported, this can be easily overcome by using a boolean metadata to track hit on my_stations
table. It doesn't require modification to the P4Runtime interface.action_profiles
seem not supported, we should find a workaround for that, this could create a modification to the P4Runtime interface.Some other functionalities are not supported such as counters (for example we can't test the accounting functionality with p4pktgen
), more information here: https://github.com/p4pktgen/p4pktgen/blob/master/docs/p4-language-feature-support.md
To run p4pktgen
I built a Docker container from the p4lang/behavioral-model
installing few other dependencies and then running the install script provided with the project.
I still haven't managed to run p4pktgen
completely.
Regarding action_profiles
, I think we could disable that by using a preprocessor flag (around lines 481-483 ) just for the sake of running p4pktgen
. Then, we could post-process the auto-generated tests to create action profile group/member insertions equivalent to the action used in the test cases (i.e., a group with only one member).
I've done as you suggested for action_profiles
, plus I added some modifications to the bng.p4 pipeline. PTF tests correctly pass with the bng.p4
modifications.
Regarding p4pktgen
, right now it runs and starts to generate test cases. But at some point, I got an exception and I'm not able to understand the reasons why it's happening (if it's bng.p4
problem or p4pktgen
issue).
This can be reproduced running make p4pktgen
from util/p4pktgen
folder. p4pktgen
log is in util/p4pktgen/log.txt
.
https://github.com/p4pktgen/p4pktgen
Can be used to uncover bugs in translation logic