summaryrefslogtreecommitdiffstats
path: root/sys/ofed/drivers/net
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2012-04-12 14:01:06 +0000
committerjhb <jhb@FreeBSD.org>2012-04-12 14:01:06 +0000
commit7e0aa0e933d2293b0968bdc27ace3e873c7a9230 (patch)
treeac89bf8fd09d6daaaaaa0332d7d9f9daa8d1054f /sys/ofed/drivers/net
parent4f83e11b0c868e624781e02d3bce2cd65ef7c23a (diff)
downloadFreeBSD-src-7e0aa0e933d2293b0968bdc27ace3e873c7a9230.zip
FreeBSD-src-7e0aa0e933d2293b0968bdc27ace3e873c7a9230.tar.gz
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
Diffstat (limited to 'sys/ofed/drivers/net')
-rw-r--r--sys/ofed/drivers/net/mlx4/en_frag.c4
-rw-r--r--sys/ofed/drivers/net/mlx4/en_rx.c13
2 files changed, 17 insertions, 0 deletions
diff --git a/sys/ofed/drivers/net/mlx4/en_frag.c b/sys/ofed/drivers/net/mlx4/en_frag.c
index 6c6bac4..57c6368 100644
--- a/sys/ofed/drivers/net/mlx4/en_frag.c
+++ b/sys/ofed/drivers/net/mlx4/en_frag.c
@@ -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_priv *priv,
flush_session(priv, session, IP_MF);
}
}
+#endif
diff --git a/sys/ofed/drivers/net/mlx4/en_rx.c b/sys/ofed/drivers/net/mlx4/en_rx.c
index d913cb0..cf85615 100644
--- a/sys/ofed/drivers/net/mlx4/en_rx.c
+++ b/sys/ofed/drivers/net/mlx4/en_rx.c
@@ -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 mlx4_en_priv *priv)
/* 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 mlx4_en_priv *priv)
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_en_priv *priv,
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_device *dev, struct mlx4_en_cq *cq, int bud
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_device *dev, struct mlx4_en_cq *cq, int bud
* - 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 */
OpenPOWER on IntegriCloud