All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH iwl-net v1] ice: Fix XDP memory leak when NIC is brought up and down
@ 2023-05-25 10:51 Kamil Maziarz
  2023-05-29 16:37 ` Rout, ChandanX
  2023-05-30 15:58 ` Maciej Fijalkowski
  0 siblings, 2 replies; 4+ messages in thread
From: Kamil Maziarz @ 2023-05-25 10:51 UTC (permalink / raw)
  To: intel-wired-lan; +Cc: Kamil Maziarz

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: cdedef59deb0 ("ice: Configure VSIs for Tx/Rx")
Signed-off-by: Kamil Maziarz <kamil.maziarz@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@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Intel-wired-lan] [PATCH iwl-net v1] ice: Fix XDP memory leak when NIC is brought up and down
  2023-05-25 10:51 [Intel-wired-lan] [PATCH iwl-net v1] ice: Fix XDP memory leak when NIC is brought up and down Kamil Maziarz
@ 2023-05-29 16:37 ` Rout, ChandanX
  2023-05-30 15:58 ` Maciej Fijalkowski
  1 sibling, 0 replies; 4+ messages in thread
From: Rout, ChandanX @ 2023-05-29 16:37 UTC (permalink / raw)
  To: Maziarz, Kamil, intel-wired-lan@lists.osuosl.org; +Cc: Nagraj, Shravan



>-----Original Message-----
>From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
>Maziarz, Kamil
>Sent: 25 May 2023 16:22
>To: intel-wired-lan@lists.osuosl.org
>Cc: Maziarz, Kamil <kamil.maziarz@intel.com>
>Subject: [Intel-wired-lan] [PATCH iwl-net v1] 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: cdedef59deb0 ("ice: Configure VSIs for Tx/Rx")
>Signed-off-by: Kamil Maziarz <kamil.maziarz@intel.com>
>---
> drivers/net/ethernet/intel/ice/ice_main.c | 4 ++++
> 1 file changed, 4 insertions(+)
>

Tested-by: Chandan Kumar Rout <chandanx.rout@intel.com> (A Contingent Worker at Intel)
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Intel-wired-lan] [PATCH iwl-net v1] ice: Fix XDP memory leak when NIC is brought up and down
  2023-05-25 10:51 [Intel-wired-lan] [PATCH iwl-net v1] ice: Fix XDP memory leak when NIC is brought up and down Kamil Maziarz
  2023-05-29 16:37 ` Rout, ChandanX
@ 2023-05-30 15:58 ` Maciej Fijalkowski
  2023-06-06 10:32   ` Maziarz, Kamil
  1 sibling, 1 reply; 4+ messages in thread
From: Maciej Fijalkowski @ 2023-05-30 15:58 UTC (permalink / raw)
  To: Kamil Maziarz; +Cc: intel-wired-lan

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@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@osuosl.org
> https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Intel-wired-lan] [PATCH iwl-net v1] ice: Fix XDP memory leak when NIC is brought up and down
  2023-05-30 15:58 ` Maciej Fijalkowski
@ 2023-06-06 10:32   ` Maziarz, Kamil
  0 siblings, 0 replies; 4+ messages in thread
From: Maziarz, Kamil @ 2023-06-06 10:32 UTC (permalink / raw)
  To: Fijalkowski, Maciej; +Cc: intel-wired-lan@lists.osuosl.org



>-----Original Message-----
>From: Fijalkowski, Maciej <maciej.fijalkowski@intel.com> 
>Sent: wtorek, 30 maja 2023 17:59
>To: Maziarz, Kamil <kamil.maziarz@intel.com>
>Cc: intel-wired-lan@lists.osuosl.org
>Subject: Re: [Intel-wired-lan] [PATCH iwl-net v1] ice: Fix XDP memory leak when NIC is brought up and down
>
>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?

While monitoring the XDP flow I noticed that after doing link down 
and then link up the traffic wasn't returning properly.

>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.

I agree, changed Fixes tag in the next version

>
>> Signed-off-by: Kamil Maziarz <kamil.maziarz@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@osuosl.org
>> https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-06 10:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-25 10:51 [Intel-wired-lan] [PATCH iwl-net v1] ice: Fix XDP memory leak when NIC is brought up and down Kamil Maziarz
2023-05-29 16:37 ` Rout, ChandanX
2023-05-30 15:58 ` Maciej Fijalkowski
2023-06-06 10:32   ` Maziarz, Kamil

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.