[Intel-wired-lan] [PATCH iwl-net v1] ice: Fix XDP memory leak when NIC is brought up and down
Maciej Fijalkowski
maciej.fijalkowski at intel.com
Tue May 30 15:58:57 UTC 2023
On Thu, May 25, 2023 at 12:51:55PM +0200, Kamil Maziarz wrote:
> Fix the buffer leak that occurs while switching
> the port up and down with traffic and XDP by
> checking for an active XDP program and freeing all empty TX buffers.
How did you spot this? Was this by code walkthrough, or?
Tx buffers are not particularly empty, they are mapped/allocated.
>
> Fixes: cdedef59deb0 ("ice: Configure VSIs for Tx/Rx")
i think it deserves a fixes tag which points to XDP support being added.
The code you are referring to was just fine before XDP support.
> Signed-off-by: Kamil Maziarz <kamil.maziarz at intel.com>
> ---
> drivers/net/ethernet/intel/ice/ice_main.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
> index a1f7c8edc22f..03513d4871ab 100644
> --- a/drivers/net/ethernet/intel/ice/ice_main.c
> +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> @@ -7056,6 +7056,10 @@ int ice_down(struct ice_vsi *vsi)
> ice_for_each_txq(vsi, i)
> ice_clean_tx_ring(vsi->tx_rings[i]);
>
> + if (ice_is_xdp_ena_vsi(vsi))
> + ice_for_each_xdp_txq(vsi, i)
> + ice_clean_tx_ring(vsi->xdp_rings[i]);
> +
> ice_for_each_rxq(vsi, i)
> ice_clean_rx_ring(vsi->rx_rings[i]);
>
> --
> 2.31.1
>
> _______________________________________________
> Intel-wired-lan mailing list
> Intel-wired-lan at osuosl.org
> https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
More information about the Intel-wired-lan
mailing list