From owner-svn-src-head@FreeBSD.ORG Fri May 25 03:00:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D5220106564A; Fri, 25 May 2012 03:00:34 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BFC6F8FC08; Fri, 25 May 2012 03:00:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P30YdO076086; Fri, 25 May 2012 03:00:34 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P30Y2G076083; Fri, 25 May 2012 03:00:34 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250300.q4P30Y2G076083@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 03:00:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235963 - in head/sys: dev/cxgb modules/cxgb/cxgb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 25 May 2012 03:00:34 -0000 Author: bz Date: Fri May 25 03:00:34 2012 New Revision: 235963 URL: http://svn.freebsd.org/changeset/base/235963 Log: MFp4 bz_ipv6_fast: Allow LRO to work on IPv6 as well. Fix the module Makefile to at least properly inlcude opt_inet6.h and allow builds without INET or INET6. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/dev/cxgb/cxgb_sge.c head/sys/modules/cxgb/cxgb/Makefile Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Fri May 25 02:58:21 2012 (r235962) +++ head/sys/dev/cxgb/cxgb_sge.c Fri May 25 03:00:34 2012 (r235963) @@ -30,6 +30,7 @@ POSSIBILITY OF SUCH DAMAGE. #include __FBSDID("$FreeBSD$"); +#include "opt_inet6.h" #include "opt_inet.h" #include @@ -2085,7 +2086,7 @@ t3_free_qset(adapter_t *sc, struct sge_q MTX_DESTROY(&q->rspq.lock); } -#ifdef INET +#if defined(INET6) || defined(INET) tcp_lro_free(&q->lro.ctrl); #endif @@ -2668,7 +2669,7 @@ t3_sge_alloc_qset(adapter_t *sc, u_int i /* Allocate and setup the lro_ctrl structure */ q->lro.enabled = !!(pi->ifp->if_capenable & IFCAP_LRO); -#ifdef INET +#if defined(INET6) || defined(INET) ret = tcp_lro_init(&q->lro.ctrl); if (ret) { printf("error %d from tcp_lro_init\n", ret); @@ -2961,9 +2962,11 @@ process_responses(adapter_t *adap, struc struct rsp_desc *r = &rspq->desc[rspq->cidx]; int budget_left = budget; unsigned int sleeping = 0; +#if defined(INET6) || defined(INET) int lro_enabled = qs->lro.enabled; int skip_lro; struct lro_ctrl *lro_ctrl = &qs->lro.ctrl; +#endif struct mbuf *offload_mbufs[RX_BUNDLE_SIZE]; int ngathered = 0; struct t3_mbuf_hdr *mh = &rspq->rspq_mh; @@ -3082,15 +3085,16 @@ process_responses(adapter_t *adap, struc * The mbuf's rcvif was derived from the cpl header and * is accurate. Skip LRO and just use that. */ +#if defined(INET6) || defined(INET) skip_lro = __predict_false(qs->port->ifp != m->m_pkthdr.rcvif); if (lro_enabled && lro_ctrl->lro_cnt && !skip_lro -#ifdef INET && (tcp_lro_rx(lro_ctrl, m, 0) == 0) -#endif ) { /* successfully queue'd for LRO */ - } else { + } else +#endif + { /* * LRO not enabled, packet unsuitable for LRO, * or unable to queue. Pass it up right now in @@ -3109,7 +3113,7 @@ process_responses(adapter_t *adap, struc deliver_partial_bundle(&adap->tdev, rspq, offload_mbufs, ngathered); -#ifdef INET +#if defined(INET6) || defined(INET) /* Flush LRO */ while (!SLIST_EMPTY(&lro_ctrl->lro_active)) { struct lro_entry *queued = SLIST_FIRST(&lro_ctrl->lro_active); Modified: head/sys/modules/cxgb/cxgb/Makefile ============================================================================== --- head/sys/modules/cxgb/cxgb/Makefile Fri May 25 02:58:21 2012 (r235962) +++ head/sys/modules/cxgb/cxgb/Makefile Fri May 25 03:00:34 2012 (r235963) @@ -8,9 +8,21 @@ SRCS= cxgb_mc5.c cxgb_vsc8211.c cxgb_ael SRCS+= cxgb_xgmac.c cxgb_vsc7323.c cxgb_t3_hw.c cxgb_main.c cxgb_aq100x.c SRCS+= cxgb_sge.c cxgb_offload.c cxgb_tn1010.c SRCS+= device_if.h bus_if.h pci_if.h -SRCS+= opt_inet.h opt_zero.h opt_sched.h +SRCS+= opt_inet.h opt_inet6.h opt_zero.h opt_sched.h SRCS+= uipc_mvec.c CFLAGS+= -g -DDEFAULT_JUMBO -I${CXGB} +.if !defined(KERNBUILDDIR) +.if ${MK_INET_SUPPORT} != "no" +opt_inet.h: + @echo "#define INET 1" > ${.TARGET} +.endif + +.if ${MK_INET6_SUPPORT} != "no" +opt_inet6.h: + @echo "#define INET6 1" > ${.TARGET} +.endif +.endif + .include