From owner-dev-commits-src-branches@freebsd.org Sun May 16 03:46:51 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DDECD633A0C; Sun, 16 May 2021 03:46:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FjSqv5z4tz3hsr; Sun, 16 May 2021 03:46:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B54A111EB9; Sun, 16 May 2021 03:46:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 14G3kpP3034357; Sun, 16 May 2021 03:46:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 14G3kpvq034356; Sun, 16 May 2021 03:46:51 GMT (envelope-from git) Date: Sun, 16 May 2021 03:46:51 GMT Message-Id: <202105160346.14G3kpvq034356@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 1f9df724eb20 - stable/13 - cxgbe(4): Use ifaddr_event_ext instead of ifaddr_event for CLIP management. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1f9df724eb20203fdf14a97ab27d6a182b1e747b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 May 2021 03:46:51 -0000 The branch stable/13 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=1f9df724eb20203fdf14a97ab27d6a182b1e747b commit 1f9df724eb20203fdf14a97ab27d6a182b1e747b Author: Navdeep Parhar AuthorDate: 2021-05-01 23:53:50 +0000 Commit: Navdeep Parhar CommitDate: 2021-05-16 03:45:59 +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. Sponsored by: Chelsio Communications (cherry picked from commit f4ba035bca927e21f0f88ce56915523bafd573d9) --- 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 a93271103998..f737c17eaaae 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