Closed incapdns closed 1 year ago
It It doesn't go into infinite loop if:
I comment the following part of code:
//xsk_ring_prod__tx_desc(&xsk->tx, tx_idx)->addr = addr;
//xsk_ring_prod__tx_desc(&xsk->tx, tx_idx)->len = len;
xsk_ring_prod__submit(&xsk->tx, 1);
xsk->outstanding_tx++;
return true;
Or:
xsk_ring_prod__tx_desc(&xsk->tx, tx_idx)->addr = addr;
xsk_ring_prod__tx_desc(&xsk->tx, tx_idx)->len = len;
//xsk_ring_prod__submit(&xsk->tx, 1);
xsk->outstanding_tx++;
return true;
Sorry, I already managed to solve it.
It seems to be due to the change from c to c++, some things were missing
Kernel:
6.3.5-1.el9.elrepo.x86_64
When I replace the if(false) to if(true) the system is returning me in the poll call even without new packets.
Example:
Command line:
-p -d lo -z --filename /root/xdp-tutorial/af_xdp_kern.o -S
What is happening:
The call to syscall poll is returning true even though there are no new UDP packets received
That said, I'm in an eternal loop, that is, it's being returned immediately even without new packets.
What is expected:
As soon as I receive the UDP packet on port 80, I reply (tx) and the syscall poll call only returns when there are new packets
What has been modified:
af_xdp_kern.c: