Skip to content

Commit 024389d

Browse files
committed
pinctrl: Convert the put_ARP/ND/FDB actions to be lockless.
The put_ARP/ND/FDB were bound to pinctrl lock to prevent data races as they have used shared hmap to store the data that were later on added into SB. This is problematic in situations when main thread holds the lock and we have to process any put_ARP/ND/FDB packet. That contention would block the pinctrl thread from processing the incoming packets. The same can happen from the opposite side, pinctrl could be holding a lock, delaying main thread from processing other updates. To prevent that use the hmap only by main thread, this will ensure that we wait properly for the multicast timeout to expire and at the same time to do the deduplication. Once the entry arrives it will be shared by thread-safe ring buffer and consumed by main thread. Reported-at: https://redhat.atlassian.net/browse/FDP-3924 Signed-off-by: Ales Musil <amusil@redhat.com> --- v3: Rebase on top of latest main. Reword the comment about entry expiration. Increase the spsc_ring size to be 4x larger than the hmap. v2: Rebase on top of latest main. Make sure the run_put_* and wait_put_* are running outside of the pinctrl mutex critical section.
1 parent 54cb335 commit 024389d

1 file changed

Lines changed: 110 additions & 78 deletions

File tree

0 commit comments

Comments
 (0)