Page MenuHomeFreeBSD

LRO: fix BPF filters for lagg ports in the hpts path
ClosedPublic

Authored by gallatin on Aug 11 2022, 12:11 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 26, 9:48 PM
Unknown Object (File)
Sun, Oct 20, 3:07 PM
Unknown Object (File)
Oct 3 2024, 3:49 AM
Unknown Object (File)
Oct 1 2024, 7:30 AM
Unknown Object (File)
Sep 28 2024, 10:29 AM
Unknown Object (File)
Sep 26 2024, 7:50 PM
Unknown Object (File)
Sep 22 2024, 6:26 AM
Unknown Object (File)
Sep 21 2024, 11:05 AM

Details

Summary

When in the hpts path, we need to handle BPF filters since aggregated
packets do not pass up the stack in the normal way. This is already
done for most interfaces, but lagg needs special handling. This is
because packets received via a lagg are passed up the stack with
the leaf interface's ifp stored in m_pkthdr.rcvif.

To handle lagg packets, we must identify that the passed rcvif is
currently a lagg port by checking for IFT_IEEE8023ADLAG or
IFT_INFINIBANDLAG (since lagg changes the lagg port's type to that
when an interface becomes a lagg member). Then we need to find the
lagg's ifp, and handle any BPF listeners on the lagg.

Note: It is possible to have multiple BPF filters, one on a member
port and one on the lagg itself. That is why we have to have 2
checks and 2 ETHER_BPF_MTAPs.

Test Plan

run tcpdump and check to see if we receive any incoming packets. Something like this:
tcpdump -npi lagg0 -c 10

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable