Subject: RE: [PATCH net 1/4] net: ena: Flush XDP packets on error.

From: "Kiyanovski, Arthur" <[email-masked]>
Date: Sun, 10 Sep 2023 07:42:14 +0000

> -----Original Message-----
> From: Sebastian Andrzej Siewior <[email-masked]>
> Sent: Friday, September 8, 2023 4:58 PM
> To: [email-masked]; [email-masked]
> Cc: David S. Miller <[email-masked]>; Alexei Starovoitov
> <[email-masked]>; Daniel Borkmann <[email-masked]>; Eric Dumazet
> <[email-masked]>; Jakub Kicinski <[email-masked]>; Jesper
> Dangaard Brouer <[email-masked]>; John Fastabend
> <[email-masked]>; Paolo Abeni <[email-masked]>; Thomas
> Gleixner <[email-masked]>; Sebastian Andrzej Siewior
> <[email-masked]>; Kiyanovski, Arthur <[email-masked]>;
> Arinzon, David <[email-masked]>; Dagan, Noam
> <[email-masked]>; Bshara, Saeed <[email-masked]>; Agroskin,
> Shay <[email-masked]>
> Subject: [EXTERNAL] [PATCH net 1/4] net: ena: Flush XDP packets on error.
> 
> CAUTION: This email originated from outside of the organization. Do not click
> links or open attachments unless you can confirm the sender and know the
> content is safe.
> 
> 
> 
> xdp_do_flush() should be invoked before leaving the NAPI poll function after
> a XDP-redirect. This is not the case if the driver leaves via the error path
> (after having a redirect in one of its previous iterations).
> 
> Invoke xdp_do_flush() also in the error path.
> 
> Cc: Arthur Kiyanovski <[email-masked]>
> Cc: David Arinzon <[email-masked]>
> Cc: Noam Dagan <[email-masked]>
> Cc: Saeed Bishara <[email-masked]>
> Cc: Shay Agroskin <[email-masked]>
> Fixes: a318c70ad152b ("net: ena: introduce XDP redirect implementation")
> Signed-off-by: Sebastian Andrzej Siewior <[email-masked]>
> ---
>  drivers/net/ethernet/amazon/ena/ena_netdev.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c
> b/drivers/net/ethernet/amazon/ena/ena_netdev.c
> index ad32ca81f7ef4..f955bde10cf90 100644
> --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
> +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
> @@ -1833,6 +1833,9 @@ static int ena_clean_rx_irq(struct ena_ring
> *rx_ring, struct napi_struct *napi,
>         return work_done;
> 
>  error:
> +       if (xdp_flags & ENA_XDP_REDIRECT)
> +               xdp_do_flush();
> +
>         adapter = netdev_priv(rx_ring->netdev);
> 
>         if (rc == -ENOSPC) {
> --
> 2.40.1
> 

Thanks for submitting this change.

Acked-by: Arthur Kiyanovski <[email-masked]>