svn commit: r235963 - in head/sys: dev/cxgb modules/cxgb/cxgb

Bjoern A. Zeeb bz at FreeBSD.org
Fri May 25 03:00:34 UTC 2012


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 <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include "opt_inet6.h"
 #include "opt_inet.h"
 
 #include <sys/param.h>
@@ -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 <bsd.kmod.mk>


More information about the svn-src-all mailing list