qlnxe: Let ether_ioctl() handle SIOCSIFADDR ioctl

Since the change [1], the init routine qlnx_init() works as intended.
Let ether_ioctl() handle SIOCSIFADDR to simplify the code.

Combined with the change [1], this shall be a better fix for PR 287445.

[1] c10e6bc0f0 qlnxe: Avoid reinitializing the interface when it is already initialized

PR:		287445
Reviewed by:	kbowling
MFC after:	5 days
Differential Revision:	https://reviews.freebsd.org/D54888
This commit is contained in:
Zhenlei Huang
2026-02-07 01:52:54 +08:00
parent c10e6bc0f0
commit 4012b63889
2 changed files with 0 additions and 26 deletions
-25
View File
@@ -30,8 +30,6 @@
* Author : David C Somayajulu, Cavium, Inc., San Jose, CA 95131.
*/
#include "opt_inet.h"
#include <sys/cdefs.h>
#include "qlnx_os.h"
#include "bcm_osal.h"
@@ -2622,34 +2620,11 @@ qlnx_ioctl(if_t ifp, u_long cmd, caddr_t data)
int ret = 0, mask;
int flags;
struct ifreq *ifr = (struct ifreq *)data;
#ifdef INET
struct ifaddr *ifa = (struct ifaddr *)data;
#endif
qlnx_host_t *ha;
ha = (qlnx_host_t *)if_getsoftc(ifp);
switch (cmd) {
case SIOCSIFADDR:
QL_DPRINT4(ha, "SIOCSIFADDR (0x%lx)\n", cmd);
#ifdef INET
if (ifa->ifa_addr->sa_family == AF_INET) {
if_setflagbits(ifp, IFF_UP, 0);
QLNX_LOCK(ha);
if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0)
qlnx_init_locked(ha);
QLNX_UNLOCK(ha);
QL_DPRINT4(ha, "SIOCSIFADDR (0x%lx) ipv4 [0x%08x]\n",
cmd, ntohl(IA_SIN(ifa)->sin_addr.s_addr));
arp_ifinit(ifp, ifa);
break;
}
#endif
ether_ioctl(ifp, cmd, data);
break;
case SIOCSIFMTU:
QL_DPRINT4(ha, "SIOCSIFMTU (0x%lx)\n", cmd);
-1
View File
@@ -58,7 +58,6 @@ SRCS+=qlnx_rdma.c
SRCS+=qlnx_ioctl.c
SRCS+=qlnx_os.c
SRCS+=opt_inet.h
SRCS+= ${LINUXKPI_GENSRCS}