On Thu, 17 Oct 2024 10:11:13 +0800 "lihuisong (C)" <lihuis...@huawei.com> wrote:
> Hi Stephen, > > 在 2024/10/15 23:45, Stephen Hemminger 写道: > > On Tue, 15 Oct 2024 17:41:39 +0800 > > "lihuisong (C)" <lihuis...@huawei.com> wrote: > > > >> Hi Stephen, > >> > >> Can you take a look at this reply so as to send out the next version ASAP? > >> Thanks.😁 > >> > >> /Huisong > >> 在 2024/10/14 20:19, lihuisong (C) 写道: > > The biggest issue is that lcore is not the same as cpu as far as kernel is > > concerned. > > DPDK support mapping lcore to a cpuset, and that is not necessarily the > > same one-to-one mapping > > as values in sysfs. In documentation of eal see. > Yes, you are right. > > > > For example, "--lcores='1,2@(5-7),(3-5)@(0,2),(0,6),7-8'" which means start > > 9 EAL thread; > > lcore 0 runs on cpuset 0x41 (cpu 0,6); > > lcore 1 runs on cpuset 0x2 (cpu 1); > > lcore 2 runs on cpuset 0xe0 (cpu 5,6,7); > > lcore 3,4,5 runs on cpuset 0x5 (cpu 0,2); > > lcore 6 runs on cpuset 0x41 (cpu 0,6); > > lcore 7 runs on cpuset 0x80 (cpu 7); > > lcore 8 runs on cpuset 0x100 (cpu 8). > > > > This problem existed in power library and this new API still has it. > How about use lcore_config[lcore_id].cpuset to get the real cpu_id? > And for this case that application use '--lcores', we simply do some > operations in power lib for all mapping CPUs in lcore's cpuset. > If it is ok, I will fix it for the entire power library and this new API. > > Using the lcore_config is the right direction but the cpuset may have more than one cpu, so the code needs to iterate over those cpus. Probably safe to ignore problems the case where user misconfigures to have two lcores using an overlapping set of cpu's like the example in the doc.