Skip to content

Conversation

@netoptimizer
Copy link
Member

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 ;-)

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>
@netoptimizer netoptimizer self-assigned this Jan 18, 2022
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>
@netoptimizer netoptimizer merged commit 2135ae1 into master Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants