aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNavdeep Parhar <np@FreeBSD.org>2021-05-01 23:53:50 +0000
committerNavdeep Parhar <np@FreeBSD.org>2021-05-05 03:16:25 +0000
commitf4ba035bca927e21f0f88ce56915523bafd573d9 (patch)
tree576d91f9a8ad360d95dfd20078d013aa86b53218
parentfe70d7b26d7a98b17e315bc3455bee267c618b4e (diff)
downloadsrc-f4ba035bca927e21f0f88ce56915523bafd573d9.tar.gz
src-f4ba035bca927e21f0f88ce56915523bafd573d9.zip
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
-rw-r--r--sys/dev/cxgbe/t4_clip.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/dev/cxgbe/t4_clip.c b/sys/dev/cxgbe/t4_clip.c
index da7b168721ab..ad26d212315e 100644
--- a/sys/dev/cxgbe/t4_clip.c
+++ b/sys/dev/cxgbe/t4_clip.c
@@ -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