diff options
| author | Zhenlei Huang <zlei@FreeBSD.org> | 2026-02-06 17:52:53 +0000 |
|---|---|---|
| committer | Zhenlei Huang <zlei@FreeBSD.org> | 2026-02-06 17:52:53 +0000 |
| commit | f250852c9a0c1021c3be4b498e27cfc7b42a81db (patch) | |
| tree | d569ddbbb41e19bc09ff62dea404a59f573f597a | |
| parent | 3aeeedc7e0dc231c16406ff64f4a08a716964c40 (diff) | |
qlnxe: Fix setting the unicast MAC filter of RX path
When an Ethernet interface is added to lagg(4) as a child interface, its
type, aka if_type, is changed from IFT_ETHER to IFT_IEEE8023ADLAG. Well
changing the link-layer address of the lagg(4) interface will be
propagated to all child interfaces, hence the drivers of child interfaces
shall not presume the type of the interface will not be changed.
Meanwhile, on initializing, an ifnet has been fully attached and it is
guaranteed to have non-null link-layer address so stop NULL checking for
it.
Reviewed by: kbowling
Fixes: 792226e53023 qlnxe: Allow MAC address override
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D54885
| -rw-r--r-- | sys/dev/qlnx/qlnxe/qlnx_os.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/sys/dev/qlnx/qlnxe/qlnx_os.c b/sys/dev/qlnx/qlnxe/qlnx_os.c index 1c885133c3ec..ec2fd7cacfae 100644 --- a/sys/dev/qlnx/qlnxe/qlnx_os.c +++ b/sys/dev/qlnx/qlnxe/qlnx_os.c @@ -7057,20 +7057,10 @@ qlnx_set_rx_mode(qlnx_host_t *ha) int rc = 0; uint8_t filter; const if_t ifp = ha->ifp; - const struct ifaddr *ifa; - struct sockaddr_dl *sdl; - ifa = if_getifaddr(ifp); - if (if_gettype(ifp) == IFT_ETHER && ifa != NULL && - ifa->ifa_addr != NULL) { - sdl = (struct sockaddr_dl *) ifa->ifa_addr; - - rc = qlnx_set_ucast_rx_mac(ha, ECORE_FILTER_REPLACE, LLADDR(sdl)); - } else { - rc = qlnx_set_ucast_rx_mac(ha, ECORE_FILTER_REPLACE, ha->primary_mac); - } - if (rc) - return rc; + rc = qlnx_set_ucast_rx_mac(ha, ECORE_FILTER_REPLACE, if_getlladdr(ifp)); + if (rc) + return rc; rc = qlnx_remove_all_mcast_mac(ha); if (rc) |
