Page MenuHomeFreeBSD

Remove LLE read lock from IPv6 fast path.
ClosedPublic

Authored by melifaro on Oct 2 2015, 10:32 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jun 25, 6:12 PM
Unknown Object (File)
Sat, Jun 22, 4:10 PM
Unknown Object (File)
Sat, Jun 22, 4:08 PM
Unknown Object (File)
Thu, Jun 20, 3:09 PM
Unknown Object (File)
May 23 2024, 11:29 AM
Unknown Object (File)
May 23 2024, 4:23 AM
Unknown Object (File)
May 23 2024, 4:22 AM
Unknown Object (File)
May 23 2024, 4:09 AM
Subscribers

Details

Summary

LLE structure is mostly unchanged during its lifecycle.

To be more specific, there are 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:

  1. 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.
  2. 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.
  3. (in STALE state) Reshedule timer until original V_nd6_gctimer expires keeping lle in STALE state (remaining timer value stored in lle_remtime).
  4. (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.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

melifaro retitled this revision from to Remove LLE read lock from IPv6 fast path..
melifaro updated this object.
melifaro edited the test plan for this revision. (Show Details)
melifaro added a reviewer: network.

Sync to recent source.
Improve comments a bit.

melifaro updated this object.
ae added inline comments.
sys/netinet6/nd6.c
628 ↗(On Diff #9142)

Is it even possible?
I don't like that you use variables of three different types here.
I think you can remove time_diff variable and use

delay = (long)(time_uptime - lle_hittime);
if (delay < nd_delay) {
   *pdelay = (long)(nd_delay - delay) * hz;
   return (1);
}
630 ↗(On Diff #9142)

s/6//

Update to sync with recent changes.

melifaro marked 2 inline comments as done.
ae added a reviewer: ae.
ae added inline comments.
sys/netinet6/nd6_nbr.c
837 ↗(On Diff #10780)

This variable looks redundant.

This revision is now accepted and ready to land.Dec 6 2015, 4:59 PM
This revision was automatically updated to reflect the committed changes.