Index: head/sys/dev/cxgbe/t4_clip.c =================================================================== --- head/sys/dev/cxgbe/t4_clip.c +++ head/sys/dev/cxgbe/t4_clip.c @@ -30,6 +30,9 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_inet.h" +#include "opt_inet6.h" + #include #include #include @@ -47,6 +50,7 @@ #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 @@ 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 @@ 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 @@ ("%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 @@ EVENTHANDLER_DEREGISTER(ifaddr_event, ifaddr_evhandler); taskqueue_cancel_timeout(taskqueue_thread, &clip_task, NULL); } +#endif Index: head/sys/dev/cxgbe/t4_main.c =================================================================== --- head/sys/dev/cxgbe/t4_main.c +++ head/sys/dev/cxgbe/t4_main.c @@ -1222,7 +1222,9 @@ #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 @@ #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 @@ 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 @@ 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 @@ 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