Page MenuHomeFreeBSD

dpaa2: Apply if_flags and MAC filters in dpaa2_ni_init()
ClosedPublic

Authored by nick_spun.io on Sat, Jul 18, 9:49 PM.
Referenced Files
F163234157: D58330.diff
Tue, Jul 21, 7:15 AM
Unknown Object (File)
Mon, Jul 20, 1:17 PM
Subscribers

Details

Summary

dpaa2_ni_init() only enabled the DPNI object; it never pushed the
promiscuous/allmulti state or the multicast filter table to the MC
firmware. The SIOCSIFFLAGS handler ignores flag changes that arrive
while the interface is down, yet still latches them into sc->if_flags,
so a promiscuous mode request made before the first up was silently
lost and could never be applied afterwards: the up path runs
dpaa2_ni_init(), which did not read the flags, and every later
SIOCSIFFLAGS compares against the already-latched value and sees no
change.

This is exactly what happens when if_bridge adds a dpni member while
the dpni is still down, e.g. rc.conf's

create_args_bridge0="... addm dpni0"

running at bridge clone time, before ifconfig_dpni0="up" is processed.
bridge_ioctl_add() puts the member into promiscuous mode at addm time;
the request never reaches the firmware, so the DPNI continues to
hardware-filter unicast destined to other MACs. ifconfig still
reports PROMISC (a stack-level flag), which makes the failure
invisible: the host stays reachable only via the DPNI's own MAC
address (e.g. with net.link.bridge.inherit_mac=1), while bridged
epair/vnet jail traffic is silently dropped on RX.

Reapply both pieces of administrative state after enabling the DPNI,
as other NIC drivers do in their init path. This also restores
multicast memberships joined while the interface was down.

PR: 292006
Reported by: jhibbits

Signed-off-by: Nick Price <nick@spun.io>

Diff Detail

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