-
Notifications
You must be signed in to change notification settings - Fork 116
AF_XDP example: Improvements to wake-up accuracy #36
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
Merged
Conversation
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
Calling tx_pkt() before the link is ready, result in no packets transmitted, but xsk_ring_prod__reserve() still succeeds. Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Measurements show that on test systems, clock_nanosleep fairly consistently wakeup later (or after) the requested sleep time. It is fairly trivial to simply adjust the sleep/wakeup time with the measure inaccuracy of clock_nanosleep, and "ask" clock_nanosleep to wakeup a bit earlier. Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
This is done to easier visually see the time difference when debug printing the timespec's (via print_timespec). Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
When interval goes below 1 sec this hack screwup first clock_nanosleep. Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Give a print WARN if code/AF_XDP somehow have MORE packets to complete from CQ than our counter for xsk->outstanding_tx packets. This should not happen, but currently hunting for a TX issue. The code (below) reset xsk->outstanding_tx, which were introduced via a discussion on xdp-tutorial: xdp-project/xdp-tutorial#180 Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
I hope there exist a better API for determining when AF_XDP is ready for transmitting packets. This workaround keeps trying to send a single packet, and check return value seen from sendto() syscall, until it doesn't return an error. Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
…t_adj happened Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
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.
Measurements show that on test systems, clock_nanosleep fairly consistently wakeup later (or after) the requested sleep time.
In this branch I've been playing with improving on wake-up accuracy for cyclic-TX.
Mainly creating this for @jopbs to notice ;-)