Repository navigation
gatekeeper: drop seqlock.h in favor of DPDK's rte_seqlock - #739
Open
sainimal1ba-hue wants to merge 1 commit into
Open
sainimal1ba-hue wants to merge 1 commit into
sainimal1ba-hue wants to merge 1 commit into
Conversation
Gatekeeper's include/seqlock.h is an old copy of the Linux kernel's sequence lock adapted to rte_spinlock_t and legacy barriers (rte_rmb(), rte_smp_rmb(), rte_smp_wmb()). DPDK provides sequence locks with <rte_seqlock.h> since version 22.11, implemented with C11 atomics and rte_atomic_thread_fence(), and Gatekeeper already uses DPDK 23.11. This commit 1. replaces the seqlock_t field of struct ether_cache with rte_seqlock_t; 2. replaces calls to seqlock_init(), read_seqbegin(), read_seqretry(), write_seqlock(), and write_sequnlock() with rte_seqlock_init(), rte_seqlock_read_begin(), rte_seqlock_read_retry(), rte_seqlock_write_lock(), and rte_seqlock_write_unlock(); and 3. deletes include/seqlock.h. Notice that DPDK's implementation takes the writer-side spinlock with rte_spinlock_lock() instead of the HTM-aware rte_spinlock_lock_tm() used by the deleted header. This commit closes AltraMayor#738. Signed-off-by: sainimal1ba-hue <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
include/seqlock.h is an old copy of the Linux kernel seqlock, adapted to rte_spinlock_t and legacy barriers. DPDK has had its own seqlocks in <rte_seqlock.h> since 22.11 (implemented using C11 atomics) and Gatekeeper has been using DPDK 23.11.
This PR moves the only users (the Ethernet header cache in the GK and GT blocks) to the rte_seqlock_*() API and removes include/seqlock.h. The locking scheme is unchanged: writers take a spinlock around the update and readers simply retry if the sequence has changed. The one difference is that DPDK takes the writer side spinlock with plain rte_spinlock_lock() rather than the HTM aware rte_spinlock_lock_tm().
Closes #738.