Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Sep 2024 04:01:58 GMT
From:      Kevin Bowling <kbowling@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 03f291611464 - stable/13 - qlnxe: Allow MAC address override
Message-ID:  <202409290401.48T41whm080529@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kbowling:

URL: https://cgit.FreeBSD.org/src/commit/?id=03f2916114647def8b68f1a7f4aee65aec5632c7

commit 03f2916114647def8b68f1a7f4aee65aec5632c7
Author:     Keith Reynolds <keith.reynolds@hpe.com>
AuthorDate: 2024-08-05 19:10:18 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2024-09-29 04:01:28 +0000

    qlnxe: Allow MAC address override
    
    The qlnxe driver always sets the NIC's rx mac address to the card's
    default MAC, ignoring any MAC address set via ifconfig.
    
    PR:             278085
    
    (cherry picked from commit 792226e53023cb09566cb78b2135b052e9b62e0e)
---
 sys/dev/qlnx/qlnxe/qlnx_os.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/sys/dev/qlnx/qlnxe/qlnx_os.c b/sys/dev/qlnx/qlnxe/qlnx_os.c
index 8e97321e15dd..6887d84a0ce9 100644
--- a/sys/dev/qlnx/qlnxe/qlnx_os.c
+++ b/sys/dev/qlnx/qlnxe/qlnx_os.c
@@ -7179,8 +7179,17 @@ qlnx_set_rx_mode(qlnx_host_t *ha)
 {
 	int	rc = 0;
 	uint8_t	filter;
+	const struct ifnet *ifp = ha->ifp;
+	struct sockaddr_dl *sdl;
 
-	rc = qlnx_set_ucast_rx_mac(ha, ECORE_FILTER_REPLACE, ha->primary_mac);
+	if (ifp->if_type == IFT_ETHER && ifp->if_addr != NULL &&
+			ifp->if_addr->ifa_addr != NULL) {
+		sdl = (struct sockaddr_dl *) ifp->if_addr->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;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202409290401.48T41whm080529>