Date: Wed, 5 May 2021 03:17:50 GMT From: Navdeep Parhar <np@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: f4ba035bca92 - main - cxgbe(4): Use ifaddr_event_ext instead of ifaddr_event for CLIP management. Message-ID: <202105050317.1453HoR9015877@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=f4ba035bca927e21f0f88ce56915523bafd573d9 commit f4ba035bca927e21f0f88ce56915523bafd573d9 Author: Navdeep Parhar <np@FreeBSD.org> AuthorDate: 2021-05-01 23:53:50 +0000 Commit: Navdeep Parhar <np@FreeBSD.org> CommitDate: 2021-05-05 03:16:25 +0000 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 --- sys/dev/cxgbe/t4_clip.c | 12 ++++++++---- 1 file 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202105050317.1453HoR9015877>