Date: Fri, 29 Aug 2014 12:45:14 +0000 (UTC) From: "Bjoern A. Zeeb" <bz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270807 - head/sys/dev/ixl Message-ID: <201408291245.s7TCjEXY034173@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bz Date: Fri Aug 29 12:45:14 2014 New Revision: 270807 URL: http://svnweb.freebsd.org/changeset/base/270807 Log: 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 Modified: head/sys/dev/ixl/ixl_txrx.c Modified: head/sys/dev/ixl/ixl_txrx.c ============================================================================== --- head/sys/dev/ixl/ixl_txrx.c Fri Aug 29 12:40:01 2014 (r270806) +++ head/sys/dev/ixl/ixl_txrx.c Fri Aug 29 12:45:14 2014 (r270807) @@ -595,8 +595,8 @@ ixl_tx_setup_offload(struct ixl_queue *q } 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 *q *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, str #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, str 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. */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408291245.s7TCjEXY034173>