cxgbe(4): Use ifaddr_event_ext instead of ifaddr_event for CLIP management.

The _ext event notification includes the address being added/removed and
that gives the driver an easy way to ignore non-IPv6 addresses.  Remove
'tom' from the handler's name while here, it was moved out of t4_tom a
long time ago.

MFC after:	1 week
Sponsored by:	Chelsio Communications
This commit is contained in:
Navdeep Parhar 2021-05-01 16:53:50 -07:00
parent fe70d7b26d
commit f4ba035bca

View File

@ -343,9 +343,13 @@ t4_destroy_clip_table(struct adapter *sc)
}
static void
t4_tom_ifaddr_event(void *arg __unused, struct ifnet *ifp)
t4_ifaddr_event(void *arg __unused, struct ifnet *ifp, struct ifaddr *ifa,
int event)
{
if (ifa->ifa_addr->sa_family != AF_INET6)
return;
atomic_add_rel_int(&in6_ifaddr_gen, 1);
taskqueue_enqueue_timeout(taskqueue_thread, &clip_task, -hz / 4);
}
@ -390,15 +394,15 @@ t4_clip_modload(void)
{
TIMEOUT_TASK_INIT(taskqueue_thread, &clip_task, 0, t4_clip_task, NULL);
ifaddr_evhandler = EVENTHANDLER_REGISTER(ifaddr_event,
t4_tom_ifaddr_event, NULL, EVENTHANDLER_PRI_ANY);
ifaddr_evhandler = EVENTHANDLER_REGISTER(ifaddr_event_ext,
t4_ifaddr_event, NULL, EVENTHANDLER_PRI_ANY);
}
void
t4_clip_modunload(void)
{
EVENTHANDLER_DEREGISTER(ifaddr_event, ifaddr_evhandler);
EVENTHANDLER_DEREGISTER(ifaddr_event_ext, ifaddr_evhandler);
taskqueue_cancel_timeout(taskqueue_thread, &clip_task, NULL);
}
#endif