Michael Santana <[email protected]> writes:
> The handler and CPU mapping in upcalls are incorrect, and this is
> specially noticeable systems with cpu isolation enabled.
>
> Say we have a 12 core system where only every even number CPU is enabled
> C0, C2, C4, C6, C8, C10
>
> This means we will create an array of size 6 that will be sent to
> kernel that is populated with sockets [S0, S1, S2, S3, S4, S5]
>
> The problem is when the kernel does an upcall it checks the socket array
> via the index of the CPU, effectively adding additional load on some
> CPUs while leaving no work on other CPUs.
>
> e.g.
>
> C0 indexes to S0
> C2 indexes to S2 (should be S1)
> C4 indexes to S4 (should be S2)
>
> Modulo of 6 (size of socket array) is applied, so we wrap back to S0
> C6 indexes to S0 (should be S3)
> C8 indexes to S2 (should be S4)
> C10 indexes to S4 (should be S5)
>
> Effectively sockets S0, S2, S4 get overloaded while sockets S1, S3, S5
> get no work assigned to them
>
> This leads to the kernel to throw the following message:
> "openvswitch: cpu_id mismatch with handler threads"
>
> To fix this we send the kernel a corrected array of sockets the size
> of all CPUs in the system. In the above example we would create a
> corrected array as follows:
> [S0, S1, S1, S2, S2, S3, S3, S4, S4, S5, S5, S0]
>
> This guarantees that regardless of which CPU a packet comes in the kernel
> will correctly map it to the correct socket
>
> Co-authored-by: Aaron Conole <[email protected]>
> signed-off-by: Aaron Conole <[email protected]>
> Signed-off-by: Michael Santana <[email protected]>
> ---
Fixes: b1e517bd2f81 ("dpif-netlink: Introduce per-cpu upcall dispatch.")
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev