mirror of
https://github.com/xdp-project/bpf-examples.git
synced 2024-05-06 15:54:53 +00:00
AF_XDP-interaction: Debug TX issue
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>
This commit is contained in:
@@ -857,6 +857,8 @@ static void tx_pkt(struct config *cfg, struct xsk_socket_info *xsk)
|
||||
if (ret != 1) {
|
||||
/* No more transmit slots, drop the packet */
|
||||
mem_free_umem_frame(&umem->mem, pkt_addr);
|
||||
fprintf(stderr, "ERR - %s() failed transmit\n",
|
||||
__func__);
|
||||
}
|
||||
|
||||
xsk_ring_prod__tx_desc(&xsk->tx, tx_idx)->addr = pkt_addr;
|
||||
@@ -1555,7 +1557,7 @@ int main(int argc, char **argv)
|
||||
* be initilized correctly?
|
||||
*/
|
||||
//sleep(3);
|
||||
// tx_pkt(&cfg, xsks.sockets[0]);
|
||||
tx_pkt(&cfg, xsks.sockets[0]);
|
||||
|
||||
/* Receive and count packets than drop them */
|
||||
// rx_and_process(&cfg, &xsks);
|
||||
|
Reference in New Issue
Block a user