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)
Feb 1 2024, 3:27 AM
Unknown Object (File)
Jan 31 2024, 5:53 PM
Unknown Object (File)
Jan 12 2024, 3:04 AM
Unknown Object (File)
Dec 31 2023, 1:09 PM
Unknown Object (File)
Dec 28 2023, 10:54 AM
Unknown Object (File)
Dec 20 2023, 7:25 AM
Unknown Object (File)
Nov 5 2023, 2:25 AM
Unknown Object (File)
Aug 26 2023, 5:00 PM

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