Skip to content

Commit ce71462

Browse files
committed
AF_XDP-interaction: Fix function tx_pkt
If there were more transmit slots, then we umem free the packet, but we continued sending it anyhow. The places tx_pkt() is currently used this never happened. Still fix the bug. Signed-off-by: Jesper Dangaard Brouer <[email protected]>
1 parent dd24bce commit ce71462

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

AF_XDP-interaction/af_xdp_user.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,8 +884,9 @@ static int tx_pkt(struct config *cfg, struct xsk_socket_info *xsk)
884884
if (ret != 1) {
885885
/* No more transmit slots, drop the packet */
886886
mem_free_umem_frame(&umem->mem, pkt_addr);
887-
fprintf(stderr, "ERR - %s() failed transmit\n",
887+
fprintf(stderr, "ERR: %s() failed transmit, no slots\n",
888888
__func__);
889+
return ENOSPC;
889890
}
890891

891892
xsk_ring_prod__tx_desc(&xsk->tx, tx_idx)->addr = pkt_addr;

0 commit comments

Comments
 (0)