qlnxe: Avoid reinitializing the interface when it is already initialized

qlnx_init_locked() unconditionally uninitialize the interface thus is
actually reinitializing the interface. Well the init routine qlnx_init()
is to initialize the interface by net stack when assigned with the first
inet or inet6 address. The ioctl SIOCSIFADDR for the first inet6 address
is handled by ether_ioctl() thus the interface is reinitialized no matter
it was initialized or not.

Add a driver status check for that to avoid reinitializing. Further plan
is removing SIOCSIFADDR ioctl from the driver and let ether_ioctl() handle
it.

Reviewed by:	kbowling
MFC after:	5 days
Differential Revision:	https://reviews.freebsd.org/D54887
This commit is contained in:
Zhenlei Huang committed 2026-02-07 01:52:54 +08:00
1 parent 0df8a998a9
commit c10e6bc0f0
1 file changed
+2 -1
+2 -1
View File
@@ -2431,7 +2431,8 @@ qlnx_init(void *arg)
QL_DPRINT2(ha, "enter\n");
QLNX_LOCK(ha);
qlnx_init_locked(ha);
if ((if_getdrvflags(ha->ifp) & IFF_DRV_RUNNING) == 0)
qlnx_init_locked(ha);
QLNX_UNLOCK(ha);
QL_DPRINT2(ha, "exit\n");