-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Speed up STF tests by only compiling P4 program once for all test packets #4906
base: main
Are you sure you want to change the base?
Conversation
…kets Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
One possible way to address #4571 The .p4.test script for an STF test currently does this: (1) run p4testgen to create multiple STF tests, one packet per file These changes modify step (2) to be: (2a) for the first STF test, compile the P4 program, copy the BMv2 JSON file to a place outside the tmpXXXXX directory provided on the run-bmv2-test.py command line as a new option, and run BMv2 on it Basically we avoid running p4c-bm2-ss on the 2nd and later test packets. For some of the larger P4 test programs, they typically generate the maximum of 10 test packets, and today take 4-5 minutes on a 5-year-old x86_64 laptop I use. With these changes, that same test takes about 2 minutes. I think there are about 512 STF tests in the entire test suite, but most of them are shorter than that today, but I would not be surprised if this saved 30 minutes or so across all of them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great thanks! This makes STF tests much more practical.
Personally, I would also consider implementing this by using a parameter like --stf-files [FILES]
that either contains a list of files or a glob pattern. Then restructure the logic of the script to only compile once and reuse the json for all subsequent tests.
@fruffy Is this something you think is worth merging as written? Or would you prefer that your suggested |
I have not been able to work on the other approach, so I can not say how involved it is. Although I think it requires only few changes. If the other approach is simple enough I'd prefer it because it requires fewer changes on the P4Testgen script side. Until then we can keep this open. |
Working on a rewrite of the run-bmv2-stf.py script, which has bitrotted a fair bit. After that rewrite I intend to extend the script to support running multiple files at once. |
No description provided.