HomeFreeBSD

Remove lle read lock from IPv4 fast path.

Description

Remove lle read lock from IPv4 fast path.

Since r286722, IPv4 LLE address field is updated while holding AFDATA WLOCK.

However, we need a bit more to be able to actually remove read lock.
First, some sort of flags needs to be added to check if we really can
use given address data. Second, we need to provide some sort of feedback
if the entry is really used when expiration time is approaching.

First is easily solved by adding another flag field updated under AFDATA

WLOCK along with mac address.

Second one is more tricky.

Currently this is done the following way:
When packet is sent using given lle and its expiration time is within
lle->la_preempt = V_arp_maxtries = 5 seconds, we decrease la_preempt under
lle RLOCK and send arprequest towards dst. If traffic flow continues (and
int case of no reply) we will send up to V_arp_maxtries (one each second)
before expiring entry.

New behavior:
  Introduce simple state machine (incomplete->reachable<->verify->deleted)
  Schedule arptimer V_arp_maxtries seconds ealier. On first timer call in
  "reachable" state set special r_kick field to 1, set state to "verify" and
  reschedule itself V_arpt_rexmit = 1 second forward. While looking up lle
  fast path checks if given r_kick field is nonzero and sets it to zero
  under lle WLOCK (which should be very rare). On subsequent calls in arptimer
  we check if r_kick was changed (and issue arprequest if yes) and
  reschedule until expire (if valid reply was received, set state back to
  "reachable" and reschedule arptimer according to V_arpt_keep value.

Given that, introduce 2 new fields:

  • r_flags, containing flags used by fast path code. New flags are: RLLE_VALID (pre-compiled yes/no flag if we can use the entry) RLLE_IFADDR (to be able to pass given flag as hint to ether_output)
  • r_kick, used for fast path feedback.

Details

Provenance
melifaroAuthored on
Parents
rS287290: Do not send everything to default gateway.
Branches
Unknown
Tags
Unknown