[4/4] net/nfp: fix stop cpp service problem

Message ID 20240124092541.2011874-5-chaoyong.he@corigine.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series enhance NFP service framework |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-compile-amd64-testing fail Testing issues
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS

Commit Message

Chaoyong He Jan. 24, 2024, 9:25 a.m. UTC
  From: Long Wu <long.wu@corigine.com>

Stop cpp service if all representors are closed and cpp service is running.

Fixes: bab0e6f48b6d ("net/nfp: fix infinite loop")
Cc: chaoyong.he@corigine.com
Cc: stable@dpdk.org

Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 drivers/net/nfp/flower/nfp_flower_representor.c | 3 +++
 1 file changed, 3 insertions(+)
  

Comments

Ferruh Yigit Jan. 30, 2024, 12:07 p.m. UTC | #1
On 1/24/2024 9:25 AM, Chaoyong He wrote:
> From: Long Wu <long.wu@corigine.com>
> 
> Stop cpp service if all representors are closed and cpp service is running.
> 
> Fixes: bab0e6f48b6d ("net/nfp: fix infinite loop")
> Cc: chaoyong.he@corigine.com
> Cc: stable@dpdk.org
> 

This fix is using a new function that is introduced in previous patches
in this set, so this fix can't be backported.

Can you please change the order of the patches in this set, make this
patch first patch in the set and update it to use old version of
functions, so it can be backported?
Later you can update old function with new one in the patch that
introduces the new functions.


Also instead of saying "cpp service problem" in the title, can you
please describe the problem, I guess the problem you are referring is
something like, "CPP service is consuming resources even there is no
device remaining that requires it" ? Or is it something else?

> Signed-off-by: Long Wu <long.wu@corigine.com>
> Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
> Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
> ---
>  drivers/net/nfp/flower/nfp_flower_representor.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c
> index bf67dc3ba2..2e8eb13e4e 100644
> --- a/drivers/net/nfp/flower/nfp_flower_representor.c
> +++ b/drivers/net/nfp/flower/nfp_flower_representor.c
> @@ -400,6 +400,9 @@ nfp_flower_repr_dev_close(struct rte_eth_dev *dev)
>  	/* Stop flower service first */
>  	nfp_flower_service_stop(app_fw_flower);
>  
> +	/* Disable cpp service if need */
> +	nfp_service_disable(&pf_dev->cpp_service_info);
> +
>  	/* Now it is safe to free all PF resources */
>  	nfp_uninit_app_fw_flower(pf_dev);
>  	nfp_pf_uninit(pf_dev);
  
Kevin Traynor Jan. 30, 2024, 12:17 p.m. UTC | #2
On 30/01/2024 12:07, Ferruh Yigit wrote:
> On 1/24/2024 9:25 AM, Chaoyong He wrote:
>> From: Long Wu <long.wu@corigine.com>
>>
>> Stop cpp service if all representors are closed and cpp service is running.
>>
>> Fixes: bab0e6f48b6d ("net/nfp: fix infinite loop")
>> Cc: chaoyong.he@corigine.com
>> Cc: stable@dpdk.org
>>
> 
> This fix is using a new function that is introduced in previous patches
> in this set, so this fix can't be backported.
> 
> Can you please change the order of the patches in this set, make this
> patch first patch in the set and update it to use old version of
> functions, so it can be backported?
> Later you can update old function with new one in the patch that
> introduces the new functions.
> 

Agree, it makes sense to put fixes at the start of the series to make
the backport easier. If it's not possible for some reason, then you can
also send a rebased revision of the fix to the stable mailing list with
the correct prefix
(http://doc.dpdk.org/guides/contributing/patches.html#backporting-patches-for-stable-releases)

> 
> Also instead of saying "cpp service problem" in the title, can you
> please describe the problem, I guess the problem you are referring is
> something like, "CPP service is consuming resources even there is no
> device remaining that requires it" ? Or is it something else?
> 

+1

>> Signed-off-by: Long Wu <long.wu@corigine.com>
>> Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
>> Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
>> ---
>>  drivers/net/nfp/flower/nfp_flower_representor.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c
>> index bf67dc3ba2..2e8eb13e4e 100644
>> --- a/drivers/net/nfp/flower/nfp_flower_representor.c
>> +++ b/drivers/net/nfp/flower/nfp_flower_representor.c
>> @@ -400,6 +400,9 @@ nfp_flower_repr_dev_close(struct rte_eth_dev *dev)
>>  	/* Stop flower service first */
>>  	nfp_flower_service_stop(app_fw_flower);
>>  
>> +	/* Disable cpp service if need */
>> +	nfp_service_disable(&pf_dev->cpp_service_info);
>> +
>>  	/* Now it is safe to free all PF resources */
>>  	nfp_uninit_app_fw_flower(pf_dev);
>>  	nfp_pf_uninit(pf_dev);
>
  

Patch

diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c
index bf67dc3ba2..2e8eb13e4e 100644
--- a/drivers/net/nfp/flower/nfp_flower_representor.c
+++ b/drivers/net/nfp/flower/nfp_flower_representor.c
@@ -400,6 +400,9 @@  nfp_flower_repr_dev_close(struct rte_eth_dev *dev)
 	/* Stop flower service first */
 	nfp_flower_service_stop(app_fw_flower);
 
+	/* Disable cpp service if need */
+	nfp_service_disable(&pf_dev->cpp_service_info);
+
 	/* Now it is safe to free all PF resources */
 	nfp_uninit_app_fw_flower(pf_dev);
 	nfp_pf_uninit(pf_dev);