From owner-svn-src-all@freebsd.org Thu Nov 29 23:14:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13D2911500C5; Thu, 29 Nov 2018 23:14:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AFB698809C; Thu, 29 Nov 2018 23:14:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7491020436; Thu, 29 Nov 2018 23:14:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wATNEtbm040882; Thu, 29 Nov 2018 23:14:55 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATNEsM3040880; Thu, 29 Nov 2018 23:14:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201811292314.wATNEsM3040880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 29 Nov 2018 23:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341270 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 341270 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AFB698809C X-Spamd-Result: default: False [0.69 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_SHORT(0.04)[0.041,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 23:14:56 -0000 Author: jhb Date: Thu Nov 29 23:14:54 2018 New Revision: 341270 URL: https://svnweb.freebsd.org/changeset/base/341270 Log: Make most of the CLIP code conditional on #ifdef INET6. This fixes builds of kernels without INET6 such as LINT-NOINET6. Reported by: arybchik Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D18384 Modified: head/sys/dev/cxgbe/t4_clip.c head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_clip.c ============================================================================== --- head/sys/dev/cxgbe/t4_clip.c Thu Nov 29 22:36:36 2018 (r341269) +++ head/sys/dev/cxgbe/t4_clip.c Thu Nov 29 23:14:54 2018 (r341270) @@ -30,6 +30,9 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_inet.h" +#include "opt_inet6.h" + #include #include #include @@ -47,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include "common/common.h" #include "t4_clip.h" +#if defined(INET6) static int add_lip(struct adapter *, struct in6_addr *); static int delete_lip(struct adapter *, struct in6_addr *); static struct clip_entry *search_lip(struct adapter *, struct in6_addr *); @@ -108,11 +112,13 @@ search_lip(struct adapter *sc, struct in6_addr *lip) return (NULL); } +#endif struct clip_entry * t4_hold_lip(struct adapter *sc, struct in6_addr *lip, struct clip_entry *ce) { +#ifdef INET6 mtx_lock(&sc->clip_table_lock); if (ce == NULL) ce = search_lip(sc, lip); @@ -121,12 +127,16 @@ t4_hold_lip(struct adapter *sc, struct in6_addr *lip, mtx_unlock(&sc->clip_table_lock); return (ce); +#else + return (NULL); +#endif } void t4_release_lip(struct adapter *sc, struct clip_entry *ce) { +#ifdef INET6 mtx_lock(&sc->clip_table_lock); KASSERT(search_lip(sc, &ce->lip) == ce, ("%s: CLIP entry %p p not in CLIP table.", __func__, ce)); @@ -134,8 +144,10 @@ t4_release_lip(struct adapter *sc, struct clip_entry * ("%s: CLIP entry %p has refcount 0", __func__, ce)); --ce->refcount; mtx_unlock(&sc->clip_table_lock); +#endif } +#ifdef INET6 void t4_init_clip_table(struct adapter *sc) { @@ -380,3 +392,4 @@ t4_clip_modunload(void) EVENTHANDLER_DEREGISTER(ifaddr_event, ifaddr_evhandler); taskqueue_cancel_timeout(taskqueue_thread, &clip_task, NULL); } +#endif Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Nov 29 22:36:36 2018 (r341269) +++ head/sys/dev/cxgbe/t4_main.c Thu Nov 29 23:14:54 2018 (r341270) @@ -1222,7 +1222,9 @@ t4_attach(device_t dev) #ifdef RATELIMIT t4_init_etid_table(sc); #endif +#ifdef INET6 t4_init_clip_table(sc); +#endif if (sc->vres.key.size != 0) sc->key_map = vmem_create("T4TLS key map", sc->vres.key.start, sc->vres.key.size, 32, 0, M_FIRSTFIT | M_WAITOK); @@ -1513,7 +1515,9 @@ t4_detach_common(device_t dev) #endif if (sc->key_map) vmem_destroy(sc->key_map); +#ifdef INET6 t4_destroy_clip_table(sc); +#endif #if defined(TCP_OFFLOAD) || defined(RATELIMIT) free(sc->sge.ofld_txq, M_CXGBE); @@ -5967,9 +5971,11 @@ t4_sysctls(struct adapter *sc) CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_smt, "A", "hardware source MAC table"); +#ifdef INET6 SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "clip", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_clip, "A", "active CLIP table entries"); +#endif SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "lb_stats", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, @@ -10527,7 +10533,9 @@ mod_event(module_t mod, int cmd, void *arg) sx_init(&t4_uld_list_lock, "T4/T5 ULDs"); SLIST_INIT(&t4_uld_list); #endif +#ifdef INET6 t4_clip_modload(); +#endif t4_tracer_modload(); tweak_tunables(); } @@ -10567,7 +10575,9 @@ mod_event(module_t mod, int cmd, void *arg) if (t4_sge_extfree_refs() == 0) { t4_tracer_modunload(); +#ifdef INET6 t4_clip_modunload(); +#endif #ifdef TCP_OFFLOAD sx_destroy(&t4_uld_list_lock); #endif