HomeFreeBSD

Remove LLE read lock from IPv6 fast path.

Description

Remove LLE read lock from IPv6 fast path.

LLE structure is mostly unchanged during its lifecycle: there are only 2
things relevant for fast path lookup code:

  1. link-level address change. Since r286722, these updates are performed under AFDATA WLOCK.
  2. 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:

Special r_skip_req (introduced in D3688) value is used for fast path feedback.

It is read lockless by fast path, but updated under 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, callout timer is armed 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) timer is rescheduled until original V_nd6_gctimer expires

keeping lle in STALE state (remaining timer value stored in lle_remtime).

(in STALE state) timer is rescheduled 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.

Differential Revision: https://reviews.freebsd.org/D3780

Details

Provenance
melifaroAuthored on
Differential Revision
D3780: Remove LLE read lock from IPv6 fast path.
Parents
rS292154: MFstable/10 r291602:
Branches
Unknown
Tags
Unknown