* recvmsg on AF_XDP
@ 2024-07-23 23:28 Ben LaGreca
2024-08-02 16:06 ` Maciej Fijalkowski
2024-08-05 7:39 ` Magnus Karlsson
0 siblings, 2 replies; 3+ messages in thread
From: Ben LaGreca @ 2024-07-23 23:28 UTC (permalink / raw)
To: xdp-newbies
Is it possible to use recvmsg/read on an AF_XDP socket? I've been able
to set up a socket, write an XDP program, and properly receive frames
in UMEM with the RX and Fill rings, but am more interested in using
standard linux C functions. Some libxdp documentation mentions the use
of poll and sendto/recvmsg, and I have successfully polled the socket
(as one would a normal AF_INET socket), but can't find documentation
on clearing the revents status after a poll. Any help or redirection
to documentation would be appreciated.
-- Ben LaGreca
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: recvmsg on AF_XDP
2024-07-23 23:28 recvmsg on AF_XDP Ben LaGreca
@ 2024-08-02 16:06 ` Maciej Fijalkowski
2024-08-05 7:39 ` Magnus Karlsson
1 sibling, 0 replies; 3+ messages in thread
From: Maciej Fijalkowski @ 2024-08-02 16:06 UTC (permalink / raw)
To: Ben LaGreca; +Cc: xdp-newbies
On Tue, Jul 23, 2024 at 07:28:12PM -0400, Ben LaGreca wrote:
> Is it possible to use recvmsg/read on an AF_XDP socket? I've been able
> to set up a socket, write an XDP program, and properly receive frames
> in UMEM with the RX and Fill rings, but am more interested in using
> standard linux C functions. Some libxdp documentation mentions the use
> of poll and sendto/recvmsg, and I have successfully polled the socket
> (as one would a normal AF_INET socket), but can't find documentation
> on clearing the revents status after a poll. Any help or redirection
> to documentation would be appreciated.
Are you aware of
https://github.com/xdp-project/bpf-examples/tree/master/AF_XDP-example
?
>
> -- Ben LaGreca
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: recvmsg on AF_XDP
2024-07-23 23:28 recvmsg on AF_XDP Ben LaGreca
2024-08-02 16:06 ` Maciej Fijalkowski
@ 2024-08-05 7:39 ` Magnus Karlsson
1 sibling, 0 replies; 3+ messages in thread
From: Magnus Karlsson @ 2024-08-05 7:39 UTC (permalink / raw)
To: Ben LaGreca; +Cc: xdp-newbies
On Wed, 24 Jul 2024 at 01:37, Ben LaGreca <benlagreca02@gmail.com> wrote:
>
> Is it possible to use recvmsg/read on an AF_XDP socket? I've been able
> to set up a socket, write an XDP program, and properly receive frames
> in UMEM with the RX and Fill rings, but am more interested in using
> standard linux C functions. Some libxdp documentation mentions the use
> of poll and sendto/recvmsg, and I have successfully polled the socket
> (as one would a normal AF_INET socket), but can't find documentation
> on clearing the revents status after a poll. Any help or redirection
> to documentation would be appreciated.
sendto() and recvmsg() are only used to "wake up" the driver when you
are using an AF_XDP socket. poll() can be used for this too and also
to wait for an Rx or Tx event. But most of the standard Linux C
functions cannot be used with an AF_XDP socket. You have to use the
rings and the umem. Less convenient, but faster.
> -- Ben LaGreca
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-08-05 7:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-23 23:28 recvmsg on AF_XDP Ben LaGreca
2024-08-02 16:06 ` Maciej Fijalkowski
2024-08-05 7:39 ` Magnus Karlsson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.