net: ena: use xdp_return_frame() to free xdp frames
[sfrench/cifs-2.6.git] / drivers / net / ethernet / amazon / ena / ena_netdev.c
index d47814b16834eec58b45ab9571d6d996fcd2391c..a4dc794e73896b7fd267cb55024c0b3fe29cd408 100644 (file)
@@ -299,7 +299,6 @@ static int ena_xdp_xmit_frame(struct net_device *dev,
        req_id = xdp_ring->free_ids[next_to_use];
        tx_info = &xdp_ring->tx_buffer_info[req_id];
        tx_info->num_of_bufs = 0;
-       tx_info->xdp_rx_page = virt_to_page(xdpf->data);
 
        rc = ena_xdp_tx_map_frame(xdp_ring, tx_info, xdpf, &push_hdr, &push_len);
        if (unlikely(rc))
@@ -1836,7 +1835,7 @@ static int ena_clean_xdp_irq(struct ena_ring *xdp_ring, u32 budget)
                tx_pkts++;
                total_done += tx_info->tx_descs;
 
-               __free_page(tx_info->xdp_rx_page);
+               xdp_return_frame(xdpf);
                xdp_ring->free_ids[next_to_clean] = req_id;
                next_to_clean = ENA_TX_RING_IDX_NEXT(next_to_clean,
                                                     xdp_ring->ring_size);