aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2014-08-29 12:45:14 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2014-08-29 12:45:14 +0000
commitb555c6140d4b00cee5cfd7ad11d736f8f0407e4c (patch)
tree1329079f6a313bdcddad9a84f948d2787507aae6 /sys/dev
parentf894ad8848766abf6bdc018ff7f4cc5d29ce66ec (diff)
downloadsrc-b555c6140d4b00cee5cfd7ad11d736f8f0407e4c.tar.gz
src-b555c6140d4b00cee5cfd7ad11d736f8f0407e4c.zip
Properly place #ifdef INET and #ifdef INET6 around variable declarations
and code to make the code compile. Give the function seems to be slightly mixed with csum and tso, make it non-fatal if we try to setup thing on a kernel without IP support. In practise the printf on the console will probably still make your machine unhappy. MFC after: 3 days X-MFC with: r270755
Notes
Notes: svn path=/head/; revision=270807
Diffstat (limited to 'sys/dev')
-rwxr-xr-xsys/dev/ixl/ixl_txrx.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/dev/ixl/ixl_txrx.c b/sys/dev/ixl/ixl_txrx.c
index c1cf8efdad50..12e09f776423 100755
--- a/sys/dev/ixl/ixl_txrx.c
+++ b/sys/dev/ixl/ixl_txrx.c
@@ -595,8 +595,8 @@ ixl_tx_setup_offload(struct ixl_queue *que,
}
switch (etype) {
- case ETHERTYPE_IP:
#ifdef INET
+ case ETHERTYPE_IP:
ip = (struct ip *)(mp->m_data + elen);
ip_hlen = ip->ip_hl << 2;
ipproto = ip->ip_p;
@@ -606,16 +606,16 @@ ixl_tx_setup_offload(struct ixl_queue *que,
*cmd |= I40E_TX_DESC_CMD_IIPT_IPV4_CSUM;
else
*cmd |= I40E_TX_DESC_CMD_IIPT_IPV4;
-#endif
break;
- case ETHERTYPE_IPV6:
+#endif
#ifdef INET6
+ case ETHERTYPE_IPV6:
ip6 = (struct ip6_hdr *)(mp->m_data + elen);
ip_hlen = sizeof(struct ip6_hdr);
ipproto = ip6->ip6_nxt;
th = (struct tcphdr *)((caddr_t)ip6 + ip_hlen);
*cmd |= I40E_TX_DESC_CMD_IIPT_IPV6;
- /* Falls thru */
+ break;
#endif
default:
break;
@@ -680,7 +680,9 @@ ixl_tso_setup(struct ixl_queue *que, struct mbuf *mp)
#ifdef INET6
struct ip6_hdr *ip6;
#endif
+#if defined(INET6) || defined(INET)
struct tcphdr *th;
+#endif
u64 type_cmd_tso_mss;
/*
@@ -722,9 +724,9 @@ ixl_tso_setup(struct ixl_queue *que, struct mbuf *mp)
break;
#endif
default:
- panic("%s: CSUM_TSO but no supported IP version (0x%04x)",
+ printf("%s: CSUM_TSO but no supported IP version (0x%04x)",
__func__, ntohs(etype));
- break;
+ return FALSE;
}
/* Ensure we have at least the IP+TCP header in the first mbuf. */