Repository navigation
[PATCH v1] validation: pktio: reuse the same pktio in sub-tests to speed things up - #2421
Open
JannePeltonen wants to merge 4 commits into
Open
JannePeltonen wants to merge 4 commits into
JannePeltonen wants to merge 4 commits into
Conversation
Broadcast statistics test uses such a high number of test packets that in some cases the packet buffer pool may get exhausted in the middle of the test. Reduce the number of test packets by replacing the hardcoded values for the number of packets and the number of RX attempts with the common macros already used in other functions. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
The pcap file from which a pcap pktio reads received packets may be appended to by another pktio that writes transmitted packets to it. This is how the pktio_run_pcap.sh script sets things up. When a pcap pktio gets an EOF when reading the input file, it cannot read more packets from the file even if another pktio appends more packets to it. This is because the EOF indicator of the stdio stream used by libpcap is sticky, causing the pcap pktio to get an EOF even after the file has grown. This in turn would break pktio tests on pcap pktio if the same pktio were to be used again after one round of packet sending and reception. Fix the problem by clearing the sticky EOF state from the stdio stream. This leaves a race between concurrent writers and readers (the reader can hit a partially written packet record and libpcap would report a truncated file error), but that is not a problem in the single-threaded pktio test and is not addressed by this commit. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
Opening and closing a pktio can be slow and doing a separate open and close for every sub-test (e.g. each packet variant) slows down make check (when run as root) and CI unnecessarily. Do not close and reopen a pktio in the same test between packet type changes. For this to work with the poll based TX completion test and to preserve existing behaviour, do not reuse completion IDs after odp_pktio_open() but grow the ID range appropriately. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
Speed up 'make check' and CI by varying packet batch size within the same opened and started pktio rather than rerunning the whole test. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
| * pktio). Clear the sticky EOF indicator of the underlying stream | ||
| * so that subsequent receive calls can see the appended packets. */ | ||
| if (ret == -2 && pcap->rx) | ||
| clearerr(pcap_file(pcap->rx)); |
Collaborator
There was a problem hiding this comment.
Matter of taste, but alternatively, this could be done inside _pcapif_reopen(), less re-checks.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closing an reopening a pktio can be slow and slows down 'make check' and CI when done in the pktio test between sub-tests, that just run the same test with a different type of packet or with a different size packet batch. This PR improves the pktio validation test to reuse the same pktio more often and speeds things up significantly in certain environments.
This PR also includes a fix for pcap pktio which could not handle reuse after the first packet bath was sent through it by the pktio test and a fix to pktio bcast statistics tests which used too big a packet batch.