From owner-svn-src-head@freebsd.org Wed May 18 14:18:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98E7BB3F854; Wed, 18 May 2016 14:18:04 +0000 (UTC) (envelope-from bz@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 mx1.freebsd.org (Postfix) with ESMTPS id 59EC91F89; Wed, 18 May 2016 14:18:04 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4IEI3i3003599; Wed, 18 May 2016 14:18:03 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IEI3rk003598; Wed, 18 May 2016 14:18:03 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605181418.u4IEI3rk003598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 18 May 2016 14:18:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300147 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 14:18:04 -0000 Author: bz Date: Wed May 18 14:18:03 2016 New Revision: 300147 URL: https://svnweb.freebsd.org/changeset/base/300147 Log: Make compile without INET or without IP support in the kernel by hiding variables and lro function calls behind approriate #ifdefs. Also move the #includes for "opt_*" to the place where they should be. Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed May 18 14:09:56 2016 (r300146) +++ head/sys/net/iflib.c Wed May 18 14:18:03 2016 (r300147) @@ -28,6 +28,10 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_inet.h" +#include "opt_inet6.h" +#include "opt_acpi.h" + #include #include #include @@ -77,11 +81,6 @@ __FBSDID("$FreeBSD$"); #include - -#include "opt_inet.h" -#include "opt_inet6.h" -#include "opt_acpi.h" - #include "ifdi_if.h" #if defined(__i386__) || defined(__amd64__) @@ -2158,8 +2157,10 @@ iflib_rxeof(iflib_rxq_t rxq, int budget) m->m_nextpkt = NULL; rx_bytes += m->m_pkthdr.len; rx_pkts++; +#if defined(INET6) || defined(INET) if (lro_enabled && tcp_lro_rx(&rxq->ifr_lc, m, 0) == 0) continue; +#endif DBG_COUNTER_INC(rx_if_input); ifp->if_input(ifp, m); } @@ -2171,7 +2172,9 @@ iflib_rxeof(iflib_rxq_t rxq, int budget) */ while ((queued = LIST_FIRST(&rxq->ifr_lc.lro_active)) != NULL) { LIST_REMOVE(queued, next); +#if defined(INET6) || defined(INET) tcp_lro_flush(&rxq->ifr_lc, queued); +#endif } return (iflib_rxd_avail(ctx, rxq, *cidxp)); } @@ -2232,7 +2235,7 @@ static int iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, struct mbuf **mp) { struct ether_vlan_header *eh; - struct mbuf *m, *n; + struct mbuf *m; m = *mp; /* @@ -2260,6 +2263,7 @@ iflib_parse_header(iflib_txq_t txq, if_p { struct ip *ip = NULL; struct tcphdr *th = NULL; + struct mbuf *n; int minthlen; minthlen = min(m->m_pkthdr.len, pi->ipi_ehdrlen + sizeof(*ip) + sizeof(*th)); @@ -4085,9 +4089,13 @@ static int iflib_rx_structures_setup(if_ctx_t ctx) { iflib_rxq_t rxq = ctx->ifc_rxqs; - int i, q, err; + int q; +#if defined(INET6) || defined(INET) + int i, err; +#endif for (q = 0; q < ctx->ifc_softc_ctx.isc_nrxqsets; q++, rxq++) { +#if defined(INET6) || defined(INET) tcp_lro_free(&rxq->ifr_lc); if ((err = tcp_lro_init(&rxq->ifr_lc)) != 0) { device_printf(ctx->ifc_dev, "LRO Initialization failed!\n"); @@ -4095,9 +4103,11 @@ iflib_rx_structures_setup(if_ctx_t ctx) } rxq->ifr_lro_enabled = TRUE; rxq->ifr_lc.ifp = ctx->ifc_ifp; +#endif IFDI_RXQ_SETUP(ctx, rxq->ifr_id); } return (0); +#if defined(INET6) || defined(INET) fail: /* * Free RX software descriptors allocated so far, we will only handle @@ -4110,6 +4120,7 @@ fail: rxq->ifr_cq_gen = rxq->ifr_cq_cidx = rxq->ifr_cq_pidx = 0; } return (err); +#endif } /*********************************************************************