Page MenuHomeFreeBSD

lltable: do not require prefix lookup when checking lle allocation rules.
ClosedPublic

Authored by melifaro on Sep 3 2021, 12:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 24, 5:02 PM
Unknown Object (File)
Tue, Apr 23, 2:30 AM
Unknown Object (File)
Sun, Apr 21, 9:40 PM
Unknown Object (File)
Mon, Apr 8, 3:44 AM
Unknown Object (File)
Feb 28 2024, 8:15 PM
Unknown Object (File)
Feb 5 2024, 10:37 PM
Unknown Object (File)
Dec 20 2023, 3:16 AM
Unknown Object (File)
Nov 25 2023, 1:48 PM
Subscribers

Details

Summary

With the new FIB_ALGO infrastructure, nearly all subsystems use fib[46]_lookup() function, which provide lockless lookups.
However, FIB_ALGO makes some tradeoffs, resulting in (relatively) prolonged periods of holding RIB_WLOCK. If the lock is held, and datapath competes for it, the RX ring may get blocked, ending in traffic delays and losses.
As currently arp processing is performed directly, RIB-backed lookups (rib_lookup_info()) require RIB_RLOCK, which triggers the problem described above when the amount of ARP replies is high.

To be more specific, prior to creating new ARP entry, the following check are executed:

  1. Routing lookup for the entry address in interface fib. If lookup return empty result, or the resulting prefix is non-directly-reachable, failure is returned. The only exception are host routes w/ gateway==address.
  1. If the routing lookup returns different interface and non-host route, we want to support the use case, when there are multiple interfaces with the same prefix. In fact, we just check if the current returned prefix covers our address (always true) and effectively allow allocating ARP entries for any directly-reachable prefix, regardless of its interface.

First check does not require knowledge of an actual prefix, nexthop flags
provide enough information to covert the logic as is. The second check is
more tricky. Following the intent, check per-interface addresses for the
matching prefix covering the target address.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 41353
Build 38242: arc lint + arc unit

Event Timeline

ae added inline comments.
sys/netinet/in.c
1381

This will look better if you move second condition to the next line.

1397

If you move these declarations to the top of function, the expression will not exceed the line length :)

This revision is now accepted and ready to land.Sep 6 2021, 9:31 AM