> -----Original Message----- > From: Jesper Dangaard Brouer <jbrouer@xxxxxxxxxx> > Sent: Wednesday, December 15, 2021 11:18 AM > To: Karlsson, Magnus <magnus.karlsson@xxxxxxxxx>; Jesper Dangaard > Brouer <jbrouer@xxxxxxxxxx>; Björn Töpel <bjorn@xxxxxxxxxx> > Cc: Brouer, Jesper <brouer@xxxxxxxxxx>; Xdp <xdp- > newbies@xxxxxxxxxxxxxxx>; Ong, Boon Leong <boon.leong.ong@xxxxxxxxx>; > Joao Pedro Barros Silva <jopbs@xxxxxxxxxx>; Diogo Alexandre Da Silva Lima > <dioli@xxxxxxxxxx> > Subject: Re: AF_XDP not transmitting frames immediately > > > > On 14/12/2021 09.07, Karlsson, Magnus wrote: > > > >> > >> I'm coding on an AF_XDP program[1] that need to send (a bulk of > >> packets) in a short time-window (related to Time-Triggered Ethernet). > >> > [...] > > > >> How can I get AF_XDP to "flush" TX packets when calling sendto()? > >> Should we add another flag than the current MSG_DONTWAIT? > > > > In zero-copy mode with softirq driver processing (not busy poll), a > > sendto will just trigger the xsk_wakeup ndo that schedules napi unless > > it is already executing. It is up to the driver to then get packets > > from the Tx ring and put them on the HW and make sure they are sent. > > Barring any HW quirks, sending one packets should be perfectly fine. > > This actually doesn't sound so good from my customers use-case PoV. > That we only trigger a ndo_xsk_wakeup that schedules napi. > > We want to trigger HW transmission immediately. > Can we achieve this via using busy-poll mode? Yes, but not without napi. The napi context will in this case be executed in process context right away, unless it is already running somewhere else but that should not be the case. Will this be good enough? > > >> Hint, I'm using tcpdump hardware timestamping on receiving hist via > >> cmdline: > >> > >> tcpdump -vv -s0 -ni eth1 -j adapter_unsynced > >> --time-stamp-precision=nano -w af_xdp_tx_cyclic.dump42 > >> > >> Notice[1] on specific branch: [1] > >> https://github.com/xdp-project/bpf- > examples/tree/vestas03_AF_XDP_exam > >> ple/AF_XDP-interaction
![]() |