DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/testpmd: don't allow to dynamic change nbcore
@ 2020-10-27  6:42 Zhou Zhenghua
  2020-10-29  4:43 ` Dharmik Thakkar
  0 siblings, 1 reply; 4+ messages in thread
From: Zhou Zhenghua @ 2020-10-27  6:42 UTC (permalink / raw)
  To: Wenzhuo Lu, Beilei Xing, Bernard Iremonger; +Cc: dev, Zhou Zhenghua, stable

When changing the number of forwarding cores in runtime, two issues may be
encountered:

  - If the setting nbcore little than current nbcore, the forwarding
    thread will still running on the extra cores. Therefore, trying to
    stop forwarding will hang testpmd, since it will wait for the extra
    cores to stop.

  - If the setting nbcore greate than actual nbcore, the newly added
    cores are not allocated resources.

This will face the problem of dynamic resource allocation, so it's not
allow to changes nbcore number when forwarding is running.

Fixes: 0c0db76f42ed ("app/testpmd: separate forward config setup from display")
Cc: bernard.iremonger@intel.com
Cc: stable@dpdk.org

Signed-off-by: Zhou Zhenghua <zhenghuax.zhou@intel.com>
---
 app/test-pmd/config.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 1668ae323..e9245053d 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -3504,6 +3504,10 @@ set_fwd_lcores_mask(uint64_t lcoremask)
 void
 set_fwd_lcores_number(uint16_t nb_lc)
 {
+	if (test_done == 0) {
+		printf("Please stop forwarding first\n");
+		return;
+	}
 	if (nb_lc > nb_cfg_lcores) {
 		printf("nb fwd cores %u > %u (max. number of configured "
 		       "lcores) - ignored\n",
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH] app/testpmd: don't allow to dynamic change nbcore
  2020-10-27  6:42 [dpdk-dev] [PATCH] app/testpmd: don't allow to dynamic change nbcore Zhou Zhenghua
@ 2020-10-29  4:43 ` Dharmik Thakkar
  2020-10-30 10:46   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
  0 siblings, 1 reply; 4+ messages in thread
From: Dharmik Thakkar @ 2020-10-29  4:43 UTC (permalink / raw)
  To: Zhou Zhenghua
  Cc: Wenzhuo Lu, Beilei Xing, Bernard Iremonger, dev, dpdk stable, nd

Hi Zhou,

Although, I see that a few of the configuration options are checking for ’test_done’, I am wondering if it is truly required.
Since, as per the documentation guidelines:
'Configuration changes only become active when forwarding is started/restarted.’

> On Oct 27, 2020, at 1:42 AM, Zhou Zhenghua <zhenghuax.zhou@intel.com> wrote:
> 
> When changing the number of forwarding cores in runtime, two issues may be
> encountered:
> 
>  - If the setting nbcore little than current nbcore, the forwarding
>    thread will still running on the extra cores. Therefore, trying to
>    stop forwarding will hang testpmd, since it will wait for the extra
>    cores to stop.
> 
>  - If the setting nbcore greate than actual nbcore, the newly added
>    cores are not allocated resources.
> 
> This will face the problem of dynamic resource allocation, so it's not
> allow to changes nbcore number when forwarding is running.
> 
> Fixes: 0c0db76f42ed ("app/testpmd: separate forward config setup from display")
> Cc: bernard.iremonger@intel.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Zhou Zhenghua <zhenghuax.zhou@intel.com>


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

* Re: [dpdk-dev] [dpdk-stable] [PATCH] app/testpmd: don't allow to dynamic change nbcore
  2020-10-29  4:43 ` Dharmik Thakkar
@ 2020-10-30 10:46   ` Ferruh Yigit
  2020-11-02 15:20     ` Ferruh Yigit
  0 siblings, 1 reply; 4+ messages in thread
From: Ferruh Yigit @ 2020-10-30 10:46 UTC (permalink / raw)
  To: Dharmik Thakkar, Zhou Zhenghua
  Cc: Wenzhuo Lu, Beilei Xing, Bernard Iremonger, dev, dpdk stable, nd

On 10/29/2020 4:43 AM, Dharmik Thakkar wrote:

<...>

>> On Oct 27, 2020, at 1:42 AM, Zhou Zhenghua <zhenghuax.zhou@intel.com> wrote:
>>
>> When changing the number of forwarding cores in runtime, two issues may be
>> encountered:
>>
>>   - If the setting nbcore little than current nbcore, the forwarding
>>     thread will still running on the extra cores. Therefore, trying to
>>     stop forwarding will hang testpmd, since it will wait for the extra
>>     cores to stop.
>>
>>   - If the setting nbcore greate than actual nbcore, the newly added
>>     cores are not allocated resources.
>>
>> This will face the problem of dynamic resource allocation, so it's not
>> allow to changes nbcore number when forwarding is running.
>>
>> Fixes: 0c0db76f42ed ("app/testpmd: separate forward config setup from display")
>> Cc: bernard.iremonger@intel.com
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Zhou Zhenghua <zhenghuax.zhou@intel.com>
> 
 > Hi Zhou,
 >
 > Although, I see that a few of the configuration options are checking for 
’test_done’, I am wondering if it is truly required.
 > Since, as per the documentation guidelines:
 > 'Configuration changes only become active when forwarding is started/restarted.’
 >
Yes documentation has it and I think that is what happens in below bullet 2 
(increase core count).

But it is easy to reproduce the hung mentioned in the first bullet, I am for 
having this fix.
And this won't contradict with the above document, the config options you can 
set will be taken account when forwarding is started/restarted, but this one 
won't be set because of added check, hence:
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

@Zhou,
do you have any objection to remove bullet 2 while merging?

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH] app/testpmd: don't allow to dynamic change nbcore
  2020-10-30 10:46   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
@ 2020-11-02 15:20     ` Ferruh Yigit
  0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2020-11-02 15:20 UTC (permalink / raw)
  To: Dharmik Thakkar, Zhou Zhenghua
  Cc: Wenzhuo Lu, Beilei Xing, Bernard Iremonger, dev, dpdk stable, nd

On 10/30/2020 10:46 AM, Ferruh Yigit wrote:
> On 10/29/2020 4:43 AM, Dharmik Thakkar wrote:
> 
> <...>
> 
>>> On Oct 27, 2020, at 1:42 AM, Zhou Zhenghua <zhenghuax.zhou@intel.com> wrote:
>>>
>>> When changing the number of forwarding cores in runtime, two issues may be
>>> encountered:
>>>
>>>   - If the setting nbcore little than current nbcore, the forwarding
>>>     thread will still running on the extra cores. Therefore, trying to
>>>     stop forwarding will hang testpmd, since it will wait for the extra
>>>     cores to stop.
>>>
>>>   - If the setting nbcore greate than actual nbcore, the newly added
>>>     cores are not allocated resources.
>>>
>>> This will face the problem of dynamic resource allocation, so it's not
>>> allow to changes nbcore number when forwarding is running.
>>>
>>> Fixes: 0c0db76f42ed ("app/testpmd: separate forward config setup from display")
>>> Cc: bernard.iremonger@intel.com
>>> Cc: stable@dpdk.org
>>>
>>> Signed-off-by: Zhou Zhenghua <zhenghuax.zhou@intel.com>
>>
>  > Hi Zhou,
>  >
>  > Although, I see that a few of the configuration options are checking for 
> ’test_done’, I am wondering if it is truly required.
>  > Since, as per the documentation guidelines:
>  > 'Configuration changes only become active when forwarding is started/restarted.’
>  >
> Yes documentation has it and I think that is what happens in below bullet 2 
> (increase core count).
> 
> But it is easy to reproduce the hung mentioned in the first bullet, I am for 
> having this fix.
> And this won't contradict with the above document, the config options you can 
> set will be taken account when forwarding is started/restarted, but this one 
> won't be set because of added check, hence:
> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
> 
> @Zhou,
> do you have any objection to remove bullet 2 while merging?

Applied to dpdk-next-net/main, thanks.

Updated the commit log as following:

     app/testpmd: do not allow dynamic change of nbcore

     When the number of forwarding cores changed in runtime, the issue may
     be encountered:
     If the nbcore set little than current nbcore, the forwarding thread
     will still running on the extra cores. Therefore, trying to stop
     forwarding will hang testpmd, since it will wait for the extra cores to
     stop.

     So do not allow to change nbcore number when forwarding is running.

     Fixes: 0c0db76f42ed ("app/testpmd: separate forward config setup from display")
     Cc: stable@dpdk.org

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

end of thread, other threads:[~2020-11-02 15:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-27  6:42 [dpdk-dev] [PATCH] app/testpmd: don't allow to dynamic change nbcore Zhou Zhenghua
2020-10-29  4:43 ` Dharmik Thakkar
2020-10-30 10:46   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2020-11-02 15:20     ` Ferruh Yigit

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git