[PATCH 0/3] testpmd support stop specify lcore
fengchengwen
fengchengwen at huawei.com
Wed Nov 5 01:43:29 CET 2025
On 11/5/2025 8:21 AM, Stephen Hemminger wrote:
> On Tue, 4 Nov 2025 12:09:13 +0800
> Chengwen Feng <fengchengwen at huawei.com> wrote:
>
>> This patch support stop specify lcore for testpmd, and also include
>> two bugfix which found when test DCB function.
>>
>> Chengwen Feng (3):
>> app/testpmd: fix invalid txp when setup DCB forward
>> app/testpmd: fix wrong Rx queues when setup DCB forward
>> app/testpmd: support stop specify lcore
>>
>> app/test-pmd/cmdline.c | 63 +++++++++++++++++++++
>> app/test-pmd/config.c | 9 +--
>> doc/guides/testpmd_app_ug/testpmd_funcs.rst | 7 +++
>> 3 files changed, 73 insertions(+), 6 deletions(-)
>>
>
> If there is a stop lcore, why is there not a command to restart the lcore?
The restart lcore is more complex which include data prepare (init).
But I think could impl such pause / restart function by config fc->stopped a special value:
Current:
run_pkt_fwd_on_lcore(struct fwd_lcore *fc, packet_fwd_t pkt_fwd)
{
do {
forwarding logic
} while(!fc->stopped);
}
We could adjust the logic to support pause / restart function:
run_pkt_fwd_on_lcore(struct fwd_lcore *fc, packet_fwd_t pkt_fwd)
{
_restart:
do {
forwarding logic
} while(!fc->stopped);
while (fc->stopped == 2) {
nop
}
if (fc->stopped == 1)
return;
if (fc->stopped == 0)
// means restart
goto _restart;
}
So we could configure fc->stopped = 2 to pause forwarding, and config it to 0 to restart forwarding.
> Looks like this just an optimization for DCB.
Yes, mainly for test the Tx direction's DCB function.
> Could it be handled better by having testpmd not spawn lcores that
> have no queues?
The lcore spawned by testpmd always has queues. In this patchset, we just stop some queue's forwarding.
>
More information about the dev
mailing list