On 5/5/23 12:21, Eli Britstein via discuss wrote: > Hello, > > With [1], dpdk-lcore-mask configuration was introduced, instead of passing > explicitly dpdk EAL options. > Commits [2]-[3] handle this code area. > > Currently, the affinity is restored to the original one only if the user did > not set any dpdk-lcore-mask, and it is "auto_determine". > In case it has been set, the affinity is not restored, so the main thread's > affinity is for a single core, dpdk's "main core". > When other threads, such as "hw-offload" threads, "ct_clean" etc., they > inherit this affinity, thus scaling doesn't work properly. > > Also, DPDK create worker threads, but they are not in use anyway by OVS. > PMD threads are created and registered to dpdk as "non-EAL" threads, and > their affinity is managed by OVS according to "pmd-cpu-mask" configuration. > They get with an rte_lcore_id after the EAL IDs. Those are in use for example > for mempool cache access, but that's OK as dpdk's cache is always up to > RTE_MAX_LCORE. > > I wonder what the use is anyway for configuring dpdk-lcore-mask. > I think the affinity should always be restored, not only in the > "auto_determine" case, but even so, there are still the worker threads > created for vain. > Is there a use-case I am missing?
There is a variety of other threads in dpdk that handle "interrupts", alarms, vhost events. And these threads are getting their affinity form the lcore-mask as well, IIRC. In general, dpdk-lcore-mask config is not particularly useful indeed, so if you don't have a use case for it, then it likely shouldn't be set. Regarding restoration logic. It seems to come from this comment: https://patchwork.ozlabs.org/project/openvswitch/patch/1450463278-7931-4-git-send-email-acon...@redhat.com/#1222040 The idea appears to be that users may want to run OVS completely on isolated cores and provide them via lcore-mask. In this case we should not restore the affinity. CC: Kevin and Aaron. Best regards, Ilya Maximets. > > Thanks, > Eli > > [1] bab694097133 ("netdev-dpdk: Convert initialization from cmdline to db") > [2] 563c98d86e77 ("netdev-dpdk: Restore thread affinity after DPDK init") > [3] 88964e6428dc ("netdev-dpdk: Autofill lcore coremask if absent") _______________________________________________ discuss mailing list disc...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-discuss