summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorKamil Maziarz <kamil.maziarz@intel.com>2023-06-06 13:33:58 +0300
committerTony Nguyen <anthony.l.nguyen@intel.com>2023-06-08 21:41:40 +0300
commit78c50d6961fc05491ebbc71c35d87324b1a4f49a (patch)
tree5a2316521d2d46199bcfa772c82ac5f8c489af97 /drivers
parent05a1308a2e08e4a375bf60eb4c6c057a201d81fc (diff)
downloadlinux-78c50d6961fc05491ebbc71c35d87324b1a4f49a.tar.xz
ice: Fix XDP memory leak when NIC is brought up and down
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. Fixes: efc2214b6047 ("ice: Add support for XDP") Signed-off-by: Kamil Maziarz <kamil.maziarz@intel.com> Tested-by: Chandan Kumar Rout <chandanx.rout@intel.com> (A Contingent Worker at Intel) Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_main.c4
1 files changed, 4 insertions, 0 deletions
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]);