Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Apr 2012 14:01:06 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r234183 - in head/sys: amd64/conf conf i386/conf modules/mlx4 modules/mlx4ib modules/mlxen modules/mthca ofed/drivers/infiniband/core ofed/drivers/infiniband/ulp/ipoib ofed/drivers/net/...
Message-ID:  <201204121401.q3CE16ts031461@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Thu Apr 12 14:01:06 2012
New Revision: 234183
URL: http://svn.freebsd.org/changeset/base/234183

Log:
  Add OFED and the associated options and drivers to x86 LINT builds:
  - Mark 'sdp' as requiring 'inet'.
  - Always include "opt_inet.h" and "opt_inet6.h" and modify the IB
    driver Makefiles to honor WITH/WITHOUT_INET/INET6/_SUPPORT options
    to determine what should be enabled during a module build.
  - Fix the mlxen(4) driver and the core IB code to compile without
    if INET is disabled (including when both INET and INET6 are disabled).
  
  Reviewed by:	bz
  MFC after:	2 weeks

Modified:
  head/sys/amd64/conf/NOTES
  head/sys/conf/files
  head/sys/i386/conf/NOTES
  head/sys/modules/mlx4/Makefile
  head/sys/modules/mlx4ib/Makefile
  head/sys/modules/mlxen/Makefile
  head/sys/modules/mthca/Makefile
  head/sys/ofed/drivers/infiniband/core/addr.c
  head/sys/ofed/drivers/infiniband/core/cma.c
  head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c
  head/sys/ofed/drivers/net/mlx4/en_frag.c
  head/sys/ofed/drivers/net/mlx4/en_rx.c
  head/sys/ofed/include/linux/in.h
  head/sys/ofed/include/linux/in6.h
  head/sys/ofed/include/net/ip.h
  head/sys/ofed/include/net/ipv6.h

Modified: head/sys/amd64/conf/NOTES
==============================================================================
--- head/sys/amd64/conf/NOTES	Thu Apr 12 13:53:49 2012	(r234182)
+++ head/sys/amd64/conf/NOTES	Thu Apr 12 14:01:06 2012	(r234183)
@@ -90,6 +90,19 @@ options 	DEVICE_POLLING
 
 options 	BPF_JITTER
 
+# OpenFabrics Enterprise Distribution (Infiniband).
+options 	OFED
+options 	OFED_DEBUG_INIT
+
+# Sockets Direct Protocol
+options 	SDP
+options 	SDP_DEBUG
+
+# IP over Inifiband
+options 	IPOIB
+options 	IPOIB_DEBUG
+options 	IPOIB_CM
+
 
 #####################################################################
 # CLOCK OPTIONS
@@ -290,6 +303,9 @@ options 	DRM_DEBUG	# Include debug print
 #	Requires the iwi firmware module
 # iwn:	Intel Wireless WiFi Link 4965/1000/5000/6000 802.11 network adapters
 #	Requires the iwn firmware module
+# mlx4ib: Mellanox ConnectX HCA InfiniBand
+# mlxen: Mellanox ConnectX HCA Ethernet
+# mthca: Mellanox HCA InfiniBand
 # mwl:	Marvell 88W8363 IEEE 802.11 adapter
 #	Requires the mwl firmware module
 # nfe:	nVidia nForce MCP on-board Ethernet Networking (BSD open source)
@@ -305,6 +321,9 @@ options 	ED_SIC
 device		ipw		# Intel 2100 wireless NICs.
 device		iwi		# Intel 2200BG/2225BG/2915ABG wireless NICs.
 device		iwn		# Intel 4965/1000/5000/6000 wireless NICs.
+device  	mlx4ib		# Mellanox ConnectX HCA InfiniBand
+device  	mlxen		# Mellanox ConnectX HCA Ethernet
+device  	mthca		# Mellanox HCA InfiniBand
 device		mwl		# Marvell 88W8363 802.11n wireless NICs.
 device		nfe		# nVidia nForce MCP on-board Ethernet
 device		nve		# nVidia nForce MCP on-board Ethernet Networking

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Thu Apr 12 13:53:49 2012	(r234182)
+++ head/sys/conf/files	Thu Apr 12 14:01:06 2012	(r234183)
@@ -3215,19 +3215,19 @@ ofed/drivers/infiniband/ulp/ipoib/ipoib_
 #	no-depend							\
 #	compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/ipoib/"
 
-ofed/drivers/infiniband/ulp/sdp/sdp_bcopy.c	optional sdp		\
+ofed/drivers/infiniband/ulp/sdp/sdp_bcopy.c	optional sdp inet	\
 	no-depend							\
 	compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/"
-ofed/drivers/infiniband/ulp/sdp/sdp_main.c	optional sdp		\
+ofed/drivers/infiniband/ulp/sdp/sdp_main.c	optional sdp inet 	\
 	no-depend							\
 	compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/"
-ofed/drivers/infiniband/ulp/sdp/sdp_rx.c	optional sdp		\
+ofed/drivers/infiniband/ulp/sdp/sdp_rx.c	optional sdp inet 	\
 	no-depend							\
 	compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/"
-ofed/drivers/infiniband/ulp/sdp/sdp_cma.c	optional sdp		\
+ofed/drivers/infiniband/ulp/sdp/sdp_cma.c	optional sdp inet 	\
 	no-depend							\
 	compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/"
-ofed/drivers/infiniband/ulp/sdp/sdp_tx.c	optional sdp		\
+ofed/drivers/infiniband/ulp/sdp/sdp_tx.c	optional sdp inet 	\
 	no-depend							\
 	compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/"
 

Modified: head/sys/i386/conf/NOTES
==============================================================================
--- head/sys/i386/conf/NOTES	Thu Apr 12 13:53:49 2012	(r234182)
+++ head/sys/i386/conf/NOTES	Thu Apr 12 14:01:06 2012	(r234183)
@@ -260,6 +260,19 @@ options 	DEVICE_POLLING
 
 options 	BPF_JITTER
 
+# OpenFabrics Enterprise Distribution (Infiniband).
+options 	OFED
+options 	OFED_DEBUG_INIT
+
+# Sockets Direct Protocol
+options 	SDP
+options 	SDP_DEBUG
+
+# IP over Inifiband
+options 	IPOIB
+options 	IPOIB_DEBUG
+options 	IPOIB_CM
+
 
 #####################################################################
 # CLOCK OPTIONS
@@ -561,6 +574,9 @@ hint.mse.0.irq="5"
 #	Requires the iwi firmware module
 # iwn:	Intel Wireless WiFi Link 4965AGN 802.11 network adapters
 #	Requires the iwn firmware module
+# mlx4ib: Mellanox ConnectX HCA InfiniBand
+# mlxen: Mellanox ConnectX HCA Ethernet
+# mthca: Mellanox HCA InfiniBand
 # mwl:	Marvell 88W8363 IEEE 802.11 adapter
 #	Requires the mwl firmware module
 # nfe:	nVidia nForce MCP on-board Ethernet Networking (BSD open source)
@@ -605,6 +621,9 @@ hint.le.0.at="isa"
 hint.le.0.port="0x280"
 hint.le.0.irq="10"
 hint.le.0.drq="0"
+device  	mlx4ib		# Mellanox ConnectX HCA InfiniBand
+device  	mlxen		# Mellanox ConnectX HCA Ethernet
+device  	mthca		# Mellanox HCA InfiniBand
 device		mwl		# Marvell 88W8363 802.11n wireless NICs.
 device		nfe		# nVidia nForce MCP on-board Ethernet
 device		nve		# nVidia nForce MCP on-board Ethernet Networking

Modified: head/sys/modules/mlx4/Makefile
==============================================================================
--- head/sys/modules/mlx4/Makefile	Thu Apr 12 13:53:49 2012	(r234182)
+++ head/sys/modules/mlx4/Makefile	Thu Apr 12 14:01:06 2012	(r234183)
@@ -1,13 +1,28 @@
 # $FreeBSD$
 .PATH:  ${.CURDIR}/../../ofed/drivers/net/mlx4
+
+.include <bsd.own.mk>
+
 KMOD    = mlx4
 SRCS    = device_if.h bus_if.h pci_if.h vnode_if.h
 SRCS+=	alloc.c catas.c cmd.c cq.c eq.c fw.c icm.c intf.c main.c mcg.c mr.c
 SRCS+=	pd.c port.c profile.c qp.c reset.c sense.c srq.c xrcd.c
+SRCS+=	opt_inet.h opt_inet6.h
 
 CFLAGS+= -I${.CURDIR}/../../ofed/drivers/net/mlx4
 CFLAGS+= -I${.CURDIR}/../../ofed/include/
-CFLAGS+= -DINET6
+
+.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>
 

Modified: head/sys/modules/mlx4ib/Makefile
==============================================================================
--- head/sys/modules/mlx4ib/Makefile	Thu Apr 12 13:53:49 2012	(r234182)
+++ head/sys/modules/mlx4ib/Makefile	Thu Apr 12 14:01:06 2012	(r234183)
@@ -1,10 +1,26 @@
 # $FreeBSD$
 .PATH:  ${.CURDIR}/../../ofed/drivers/infiniband/hw/mlx4
+
+.include <bsd.own.mk>
+
 KMOD    = mlx4ib
 SRCS    = device_if.h bus_if.h pci_if.h vnode_if.h
 SRCS+=	ah.c cq.c doorbell.c mad.c main.c mr.c qp.c srq.c wc.c
+SRCS+=	opt_inet.h opt_inet6.h
+
+CFLAGS+= -I${.CURDIR}/../../ofed/include/
+
+.if !defined(KERNBUILDDIR)
+.if ${MK_INET_SUPPORT} != "no"
+opt_inet.h:
+	@echo "#define INET 1" > ${.TARGET}
+.endif
 
-CFLAGS+= -I${.CURDIR}/../../ofed/include/ -DINET6
+.if ${MK_INET6_SUPPORT} != "no"
+opt_inet6.h:
+	@echo "#define INET6 1" > ${.TARGET}
+.endif
+.endif
 
 .include <bsd.kmod.mk>
 

Modified: head/sys/modules/mlxen/Makefile
==============================================================================
--- head/sys/modules/mlxen/Makefile	Thu Apr 12 13:53:49 2012	(r234182)
+++ head/sys/modules/mlxen/Makefile	Thu Apr 12 14:01:06 2012	(r234183)
@@ -1,12 +1,27 @@
 # $FreeBSD$
 .PATH:  ${.CURDIR}/../../ofed/drivers/net/mlx4
+
+.include <bsd.own.mk>
+
 KMOD    = mlxen
 SRCS    = device_if.h bus_if.h pci_if.h vnode_if.h
 SRCS	+= en_cq.c en_frag.c en_main.c en_netdev.c en_port.c en_resources.c
 SRCS	+= en_rx.c en_tx.c
+SRCS	+= opt_inet.h opt_inet6.h
 CFLAGS+= -I${.CURDIR}/../../ofed/drivers/net/mlx4
 CFLAGS+= -I${.CURDIR}/../../ofed/include/
-CFLAGS+= -DINET6
+
+.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>
 

Modified: head/sys/modules/mthca/Makefile
==============================================================================
--- head/sys/modules/mthca/Makefile	Thu Apr 12 13:53:49 2012	(r234182)
+++ head/sys/modules/mthca/Makefile	Thu Apr 12 14:01:06 2012	(r234183)
@@ -1,14 +1,30 @@
 # $FreeBSD$
 
 .PATH:  ${.CURDIR}/../../ofed/drivers/infiniband/hw/mthca
+
+.include <bsd.own.mk>
+
 KMOD    = mthca
 SRCS    = device_if.h bus_if.h pci_if.h vnode_if.h
 SRCS+=	mthca_allocator.c mthca_av.c mthca_catas.c mthca_cmd.c mthca_cq.c
 SRCS+=	mthca_eq.c mthca_mad.c mthca_main.c mthca_mcg.c mthca_memfree.c
 SRCS+=	mthca_mr.c mthca_pd.c mthca_profile.c mthca_provider.c mthca_qp.c
 SRCS+=	mthca_reset.c mthca_srq.c mthca_uar.c
+SRCS+=	opt_inet.h opt_inet6.h
+
+CFLAGS+= -I${.CURDIR}/../../ofed/include
+
+.if !defined(KERNBUILDDIR)
+.if ${MK_INET_SUPPORT} != "no"
+opt_inet.h:
+	@echo "#define INET 1" > ${.TARGET}
+.endif
 
-CFLAGS+= -I${.CURDIR}/../../ofed/include/ -DINET6
+.if ${MK_INET6_SUPPORT} != "no"
+opt_inet6.h:
+	@echo "#define INET6 1" > ${.TARGET}
+.endif
+.endif
 
 .include <bsd.kmod.mk>
 

Modified: head/sys/ofed/drivers/infiniband/core/addr.c
==============================================================================
--- head/sys/ofed/drivers/infiniband/core/addr.c	Thu Apr 12 13:53:49 2012	(r234182)
+++ head/sys/ofed/drivers/infiniband/core/addr.c	Thu Apr 12 14:01:06 2012	(r234183)
@@ -136,6 +136,7 @@ int rdma_translate_ip(struct sockaddr *a
 	}
 
 	switch (addr->sa_family) {
+#ifdef INET
 	case AF_INET:
 		dev = ip_dev_find(NULL,
 			((struct sockaddr_in *) addr)->sin_addr.s_addr);
@@ -146,6 +147,7 @@ int rdma_translate_ip(struct sockaddr *a
 		ret = rdma_copy_addr(dev_addr, dev, NULL);
 		dev_put(dev);
 		break;
+#endif
 
 #if defined(INET6)
 	case AF_INET6:
@@ -346,7 +348,9 @@ static int addr_resolve(struct sockaddr 
 	struct sockaddr_in6 *sin6;
 	struct ifaddr *ifa;
 	struct ifnet *ifp;
+#if defined(INET) || defined(INET6)
 	struct llentry *lle;
+#endif
 	struct rtentry *rte;
 	in_port_t port;
 	u_char edst[MAX_ADDR_LEN];
@@ -365,6 +369,7 @@ static int addr_resolve(struct sockaddr 
 	ifp = NULL;
 	rte = NULL;
 	switch (dst_in->sa_family) {
+#ifdef INET
 	case AF_INET:
 		sin = (struct sockaddr_in *)dst_in;
 		if (sin->sin_addr.s_addr == INADDR_BROADCAST)
@@ -383,6 +388,7 @@ static int addr_resolve(struct sockaddr 
 		} else
 			src_in = NULL; 
 		break;
+#endif
 #ifdef INET6
 	case AF_INET6:
 		sin6 = (struct sockaddr_in6 *)dst_in;
@@ -459,12 +465,21 @@ mcast:
 	/*
 	 * Resolve the link local address.
 	 */
+	switch (dst_in->sa_family) {
+#ifdef INET
+	case AF_INET:
+		error = arpresolve(ifp, rte, NULL, dst_in, edst, &lle);
+		break;
+#endif
 #ifdef INET6
-	if (dst_in->sa_family == AF_INET6)
+	case AF_INET6:
 		error = nd6_storelladdr(ifp, NULL, dst_in, (u_char *)edst, &lle);
-	else
+		break;
 #endif
-		error = arpresolve(ifp, rte, NULL, dst_in, edst, &lle);
+	default:
+		/* XXX: Shouldn't happen. */
+		error = -EINVAL;
+	}
 	RTFREE(rte);
 	if (error == 0)
 		return rdma_copy_addr(addr, ifp, edst);

Modified: head/sys/ofed/drivers/infiniband/core/cma.c
==============================================================================
--- head/sys/ofed/drivers/infiniband/core/cma.c	Thu Apr 12 13:53:49 2012	(r234182)
+++ head/sys/ofed/drivers/infiniband/core/cma.c	Thu Apr 12 14:01:06 2012	(r234183)
@@ -96,7 +96,9 @@ static DEFINE_IDR(sdp_ps);
 static DEFINE_IDR(tcp_ps);
 static DEFINE_IDR(udp_ps);
 static DEFINE_IDR(ipoib_ps);
+#if defined(INET)
 static int next_port;
+#endif
 
 struct cma_device {
 	struct list_head	list;
@@ -2137,6 +2139,7 @@ err1:
 
 static int cma_alloc_any_port(struct idr *ps, struct rdma_id_private *id_priv)
 {
+#if defined(INET)
 	struct rdma_bind_list *bind_list;
 	int port, ret, low, high;
 
@@ -2178,6 +2181,9 @@ err2:
 err1:
 	kfree(bind_list);
 	return ret;
+#else
+	return -ENOSPC;
+#endif
 }
 
 static int cma_use_port(struct idr *ps, struct rdma_id_private *id_priv)
@@ -2919,9 +2925,13 @@ static int cma_ib_mc_handler(int status,
 static void cma_set_mgid(struct rdma_id_private *id_priv,
 			 struct sockaddr *addr, union ib_gid *mgid)
 {
+#if defined(INET) || defined(INET6)
 	unsigned char mc_map[MAX_ADDR_LEN];
 	struct rdma_dev_addr *dev_addr = &id_priv->id.route.addr.dev_addr;
+#endif
+#ifdef INET
 	struct sockaddr_in *sin = (struct sockaddr_in *) addr;
+#endif
 #ifdef INET6
 	struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) addr;
 #endif
@@ -2940,11 +2950,13 @@ static void cma_set_mgid(struct rdma_id_
 			mc_map[7] = 0x01;	/* Use RDMA CM signature */
 		*mgid = *(union ib_gid *) (mc_map + 4);
 #endif
+#ifdef INET
 	} else {
 		ip_ib_mc_map(sin->sin_addr.s_addr, dev_addr->broadcast, mc_map);
 		if (id_priv->id.ps == RDMA_PS_UDP)
 			mc_map[7] = 0x01;	/* Use RDMA CM signature */
 		*mgid = *(union ib_gid *) (mc_map + 4);
+#endif
 	}
 }
 
@@ -3347,12 +3359,15 @@ static void cma_remove_one(struct ib_dev
 
 static int cma_init(void)
 {
-	int ret, low, high, remaining;
+	int ret;
+#if defined(INET)
+	int low, high, remaining;
 
 	get_random_bytes(&next_port, sizeof next_port);
 	inet_get_local_port_range(&low, &high);
 	remaining = (high - low) + 1;
 	next_port = ((unsigned int) next_port % remaining) + low;
+#endif
 
 	cma_wq = create_singlethread_workqueue("rdma_cm");
 	if (!cma_wq)

Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c
==============================================================================
--- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c	Thu Apr 12 13:53:49 2012	(r234182)
+++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c	Thu Apr 12 14:01:06 2012	(r234183)
@@ -1247,7 +1247,9 @@ static void ipoib_cm_mb_reap(struct work
 						   cm.mb_task);
 	struct mbuf *mb;
 	unsigned long flags;
+#if defined(INET) || defined(INET6)
 	unsigned mtu = priv->mcast_mtu;
+#endif
 	uint16_t proto;
 
 	spin_lock_irqsave(&priv->lock, flags);
@@ -1260,14 +1262,20 @@ static void ipoib_cm_mb_reap(struct work
 
 		proto = htons(*mtod(mb, uint16_t *));
 		m_adj(mb, IPOIB_ENCAP_LEN);
-		if (proto == ETHERTYPE_IP)
+		switch (proto) {
+#if defined(INET)
+		case ETHERTYPE_IP:
 			icmp_error(mb, ICMP_UNREACH, ICMP_UNREACH_NEEDFRAG, 0, mtu);
+			break;
+#endif
 #if defined(INET6)
-		else if (proto == ETHERTYPE_IPV6)
+		case ETHERTYPE_IPV6:
 			icmp6_error(mb, ICMP6_PACKET_TOO_BIG, 0, mtu);
+			break;
 #endif
-		else
+		default:
 			m_freem(mb);
+		}
 
 		spin_lock_irqsave(&priv->lock, flags);
 	}

Modified: head/sys/ofed/drivers/net/mlx4/en_frag.c
==============================================================================
--- head/sys/ofed/drivers/net/mlx4/en_frag.c	Thu Apr 12 13:53:49 2012	(r234182)
+++ head/sys/ofed/drivers/net/mlx4/en_frag.c	Thu Apr 12 14:01:06 2012	(r234183)
@@ -31,8 +31,11 @@
  *
  */
 
+#include "opt_inet.h"
 #include "mlx4_en.h"
 
+#ifdef INET
+
 #include <net/ethernet.h>
 #include <netinet/ip.h>
 #include <machine/in_cksum.h>
@@ -186,3 +189,4 @@ void mlx4_en_flush_frags(struct mlx4_en_
 			flush_session(priv, session, IP_MF);
 	}
 }
+#endif

Modified: head/sys/ofed/drivers/net/mlx4/en_rx.c
==============================================================================
--- head/sys/ofed/drivers/net/mlx4/en_rx.c	Thu Apr 12 13:53:49 2012	(r234182)
+++ head/sys/ofed/drivers/net/mlx4/en_rx.c	Thu Apr 12 14:01:06 2012	(r234183)
@@ -31,6 +31,7 @@
  *
  */
 
+#include "opt_inet.h"
 #include "mlx4_en.h"
 
 #include <linux/mlx4/cq.h>
@@ -287,6 +288,7 @@ int mlx4_en_activate_rx_rings(struct mlx
 		/* Initailize all descriptors */
 		for (i = 0; i < ring->size; i++)
 			mlx4_en_init_rx_desc(priv, ring, i);
+#ifdef INET
 		/* Configure lro mngr */
 		if (priv->dev->if_capenable & IFCAP_LRO) {
 			if (tcp_lro_init(&ring->lro))
@@ -294,6 +296,7 @@ int mlx4_en_activate_rx_rings(struct mlx
 			else
 				ring->lro.ifp = priv->dev;
 		}
+#endif
 	}
 	err = mlx4_en_fill_rx_buffers(priv);
 	if (err)
@@ -330,7 +333,9 @@ void mlx4_en_destroy_rx_ring(struct mlx4
 void mlx4_en_deactivate_rx_ring(struct mlx4_en_priv *priv,
 				struct mlx4_en_rx_ring *ring)
 {
+#ifdef INET
 	tcp_lro_free(&ring->lro);
+#endif
 	mlx4_en_free_rx_buf(priv, ring);
 	if (ring->stride <= TXBB_SIZE)
 		ring->buf -= TXBB_SIZE;
@@ -446,7 +451,9 @@ int mlx4_en_process_rx_cq(struct net_dev
 	struct mbuf **mb_list;
 	struct mlx4_en_rx_desc *rx_desc;
 	struct mbuf *mb;
+#ifdef INET
 	struct lro_entry *queued;
+#endif
 	int index;
 	unsigned int length;
 	int polled = 0;
@@ -515,22 +522,26 @@ int mlx4_en_process_rx_cq(struct net_dev
 			 * - without IP options
 			 * - not an IP fragment
 			 */
+#ifdef INET
 			if (mlx4_en_can_lro(cqe->status) &&
 			    (dev->if_capenable & IFCAP_LRO)) {
 				if (ring->lro.lro_cnt != 0 &&
 				    tcp_lro_rx(&ring->lro, mb, 0) == 0)
 					goto next;
 			}
+#endif
 
 			/* LRO not possible, complete processing here */
 			INC_PERF_COUNTER(priv->pstats.lro_misses);
 		} else {
 			mb->m_pkthdr.csum_flags = 0;
 			priv->port_stats.rx_chksum_none++;
+#ifdef INET
 			if (priv->ip_reasm &&
 			    cqe->status & cpu_to_be16(MLX4_CQE_STATUS_IPV4) &&
 			    !mlx4_en_rx_frags(priv, ring, mb, cqe))
 				goto next;
+#endif
 		}
 
 		/* Push it up the stack */
@@ -545,11 +556,13 @@ next:
 	}
 	/* Flush all pending IP reassembly sessions */
 out:
+#ifdef INET
 	mlx4_en_flush_frags(priv, ring);
 	while ((queued = SLIST_FIRST(&ring->lro.lro_active)) != NULL) {
 		SLIST_REMOVE_HEAD(&ring->lro.lro_active, next);
 		tcp_lro_flush(&ring->lro, queued);
 	}
+#endif
 	AVG_PERF_COUNTER(priv->pstats.rx_coal_avg, polled);
 	mlx4_cq_set_ci(&cq->mcq);
 	wmb(); /* ensure HW sees CQ consumer before we post new buffers */

Modified: head/sys/ofed/include/linux/in.h
==============================================================================
--- head/sys/ofed/include/linux/in.h	Thu Apr 12 13:53:49 2012	(r234182)
+++ head/sys/ofed/include/linux/in.h	Thu Apr 12 14:01:06 2012	(r234183)
@@ -28,6 +28,8 @@
 #ifndef	_LINUX_IN_H_
 #define	_LINUX_IN_H_
 
+#include "opt_inet.h"
+
 #include <netinet/in.h>
 #include <asm/byteorder.h>
 

Modified: head/sys/ofed/include/linux/in6.h
==============================================================================
--- head/sys/ofed/include/linux/in6.h	Thu Apr 12 13:53:49 2012	(r234182)
+++ head/sys/ofed/include/linux/in6.h	Thu Apr 12 14:01:06 2012	(r234183)
@@ -29,8 +29,6 @@
 #ifndef	_LINUX_IN6_H_
 #define	_LINUX_IN6_H_
 
-#ifndef KLD_MODULE
 #include "opt_inet6.h"
-#endif
 
 #endif	/* _LINUX_IN6_H_ */

Modified: head/sys/ofed/include/net/ip.h
==============================================================================
--- head/sys/ofed/include/net/ip.h	Thu Apr 12 13:53:49 2012	(r234182)
+++ head/sys/ofed/include/net/ip.h	Thu Apr 12 14:01:06 2012	(r234183)
@@ -29,6 +29,8 @@
 #ifndef _LINUX_NET_IP_H_
 #define	_LINUX_NET_IP_H_
 
+#include "opt_inet.h"
+
 #include <sys/types.h>
 #include <sys/socket.h>
 
@@ -39,6 +41,7 @@
 #include <netinet/in.h>
 #include <netinet/in_pcb.h>
 
+#ifdef INET
 static inline void inet_get_local_port_range(int *low, int *high)
 {
 	*low = V_ipport_firstauto;
@@ -73,5 +76,6 @@ ip_ib_mc_map(uint32_t addr, const unsign
 	buf[18] = (addr >> 8) & 0xff;
 	buf[19] = addr & 0xff;
 }
+#endif
 
 #endif	/* _LINUX_NET_IP_H_ */

Modified: head/sys/ofed/include/net/ipv6.h
==============================================================================
--- head/sys/ofed/include/net/ipv6.h	Thu Apr 12 13:53:49 2012	(r234182)
+++ head/sys/ofed/include/net/ipv6.h	Thu Apr 12 14:01:06 2012	(r234183)
@@ -29,9 +29,7 @@
 #ifndef _LINUX_NET_IPV6_H_
 #define	_LINUX_NET_IPV6_H_
 
-#ifndef KLD_MODULE
 #include "opt_inet6.h"
-#endif
 
 #define	ipv6_addr_loopback IN6_IS_ADDR_LOOPBACK
 #define	ipv6_addr_copy(dst, src)					\



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201204121401.q3CE16ts031461>