net: ena: Update XDP verdict upon failure
The verdict returned from ena_xdp_execute() is used to determine the
fate of the RX buffer's page. In case of XDP Redirect/TX error the
verdict should be set to XDP_ABORTED, otherwise the page won't be freed.
Fixes: a318c70ad1
("net: ena: introduce XDP redirect implementation")
Signed-off-by: Shay Agroskin <shayagr@amazon.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
3d0bc44d39
commit
225353c070
|
@ -404,6 +404,7 @@ static int ena_xdp_execute(struct ena_ring *rx_ring, struct xdp_buff *xdp)
|
|||
if (unlikely(!xdpf)) {
|
||||
trace_xdp_exception(rx_ring->netdev, xdp_prog, verdict);
|
||||
xdp_stat = &rx_ring->rx_stats.xdp_aborted;
|
||||
verdict = XDP_ABORTED;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -424,7 +425,10 @@ static int ena_xdp_execute(struct ena_ring *rx_ring, struct xdp_buff *xdp)
|
|||
xdp_stat = &rx_ring->rx_stats.xdp_redirect;
|
||||
break;
|
||||
}
|
||||
fallthrough;
|
||||
trace_xdp_exception(rx_ring->netdev, xdp_prog, verdict);
|
||||
xdp_stat = &rx_ring->rx_stats.xdp_aborted;
|
||||
verdict = XDP_ABORTED;
|
||||
break;
|
||||
case XDP_ABORTED:
|
||||
trace_xdp_exception(rx_ring->netdev, xdp_prog, verdict);
|
||||
xdp_stat = &rx_ring->rx_stats.xdp_aborted;
|
||||
|
|
Loading…
Reference in New Issue