@@ -284,9 +284,9 @@ static int ena_xdp_xmit_buff(struct net_device *dev,
struct ena_tx_buffer *tx_info;
struct ena_ring *xdp_ring;
u16 next_to_use, req_id;
- int rc;
void *push_hdr;
u32 push_len;
+ int rc;
xdp_ring = &adapter->tx_ring[qid];
next_to_use = xdp_ring->next_to_use;
@@ -322,14 +322,14 @@ static int ena_xdp_xmit_buff(struct net_device *dev,
xdp_ring->tx_stats.doorbells++;
u64_stats_update_end(&xdp_ring->syncp);
- return NETDEV_TX_OK;
+ return rc;
error_unmap_dma:
ena_unmap_tx_buff(xdp_ring, tx_info);
tx_info->xdpf = NULL;
error_drop_packet:
__free_page(tx_info->xdp_rx_page);
- return NETDEV_TX_OK;
+ return rc;
}
static int ena_xdp_execute(struct ena_ring *rx_ring,
The function mistakenly returns NETDEV_TX_OK regardless of the transmission success. This patch fixes this behavior by returning the error code from the function. Fixes: 548c4940b9f1 ("net: ena: Implement XDP_TX action") Signed-off-by: Shay Agroskin <shayagr@amazon.com> --- drivers/net/ethernet/amazon/ena/ena_netdev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)