Closed danieldin95 closed 8 months ago
Some body has idea to fix it? I want to let count_cpu_cores
get really online cpus that include isolcpus. The commit at https://github.com/openvswitch/ovs/commit/be15ec48d7669902f7f7ca2f76fda190b0ccfa5a exclude isolcpus, I think that lead to datapath compute wrong n_pids for handlers.
u32 ovs_dp_get_upcall_portid(const struct datapath *dp, uint32_t cpu_id)
{
struct dp_nlsk_pids *dp_nlsk_pids;
dp_nlsk_pids = rcu_dereference(dp->upcall_portids);
if (dp_nlsk_pids) {
if (cpu_id < dp_nlsk_pids->n_pids) {
return dp_nlsk_pids->pids[cpu_id];
} else if (dp_nlsk_pids->n_pids > 0 && cpu_id >= dp_nlsk_pids->n_pids) {
/* If the number of netlink PIDs is mismatched with the number of
* CPUs as seen by the kernel, log this and send the upcall to an
* arbitrary socket (0) in order to not drop packets
*/
pr_info_ratelimited("cpu_id mismatch with handler threads");
return dp_nlsk_pids->pids[cpu_id % dp_nlsk_pids->n_pids];
} else {
return 0;
}
} else {
return 0;
}
}
There is a blog explaining this message, maybe it clears things up: https://developers.redhat.com/articles/2023/07/20/how-balance-cpu-upcall-dispatch-mode-open-vswitch
Make sure your version of OVS has the mentioned patches included.
CCing @Maickii
@chaudron thx! It's very useful for me.
the log by printk:
ovs-vswitchd:
On our ovs, we setup netdev datapath for dpdk, and also has a system datapath for kernel, and set the isocpus on dpdk device's numa.