LLE structure is mostly unchanged during its lifecycle.
To be more specific, there are 2 things relevant for fast path lookup code:
- link-level address change. Since r286722, these updates are performed under AFDATA WLOCK.
- Some sort of feedback indicating that this particular entry is used so we send NS to perform reachability verification instead of expiring entry. The only signal that is needed from fast path is something like binary yes/no.
The latter is solved by the following changes:
- Use special r_skip_req (introduced in D3688) value for fast path feedback. It is read lockless by fast path, but updated under (new) req_mutex mutex. If this field is non-zero, then fast path will acquire lock and set it back to 0.
- After transitioning to STALE state, arm callout timer to run each V_nd6_delay seconds to make sure that if packet was transmitted at the start of given interval, we would be able to switch to PROBE state in V_nd6_delay seconds as user expects.
- (in STALE state) Reshedule timer until original V_nd6_gctimer expires keeping lle in STALE state (remaining timer value stored in lle_remtime).
- (in STALE state) Reshedule timer if packet was transmitted less that V_nd6_delay seconds ago to make sure we transition to PROBE state exactly after V_n6_delay seconds.
As a result, all packets towards lle in REACHABLE/STALE/PROBE states are handled by fast path without acquiring lle read lock.