From owner-svn-src-head@FreeBSD.ORG Fri Feb 22 16:46:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DD366D5B; Fri, 22 Feb 2013 16:46:29 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CFA8CAF8; Fri, 22 Feb 2013 16:46:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1MGkTNP034875; Fri, 22 Feb 2013 16:46:29 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1MGkTPZ034874; Fri, 22 Feb 2013 16:46:29 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201302221646.r1MGkTPZ034874@svn.freebsd.org> From: Andrew Gallatin Date: Fri, 22 Feb 2013 16:46:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247152 - head/sys/dev/mxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2013 16:46:29 -0000 Author: gallatin Date: Fri Feb 22 16:46:28 2013 New Revision: 247152 URL: http://svnweb.freebsd.org/changeset/base/247152 Log: Try harder to make mxge safe for all combinations of INET and INET6 - Re-fix build by restoring local removed in r247151, but protected by #if defined(INET) || defined(INET6) so that the compile succeeds in the !(INET||INET6) case. - Protect call to in_pseudo() with an #ifdef INET, to allow a kernel to link with mxge when INET is not compiled in. - Also remove an errant (improperly commented) obsolete debugging printf Thanks to Glebius for pointing out the !(INET||INET6) build issue. Sponsored by: Myricom MFC After: 7 days Modified: head/sys/dev/mxge/if_mxge.c Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Fri Feb 22 12:41:24 2013 (r247151) +++ head/sys/dev/mxge/if_mxge.c Fri Feb 22 16:46:28 2013 (r247152) @@ -1887,11 +1887,13 @@ mxge_encap_tso(struct mxge_slice_state * IPPROTO_TCP, 0); #endif } else { +#ifdef INET m->m_pkthdr.csum_flags |= CSUM_TCP; sum = in_pseudo(pi->ip->ip_src.s_addr, pi->ip->ip_dst.s_addr, htons(IPPROTO_TCP + (m->m_pkthdr.len - cksum_offset))); +#endif } m_copyback(m, offsetof(struct tcphdr, th_sum) + cksum_offset, sizeof(sum), (caddr_t)&sum); @@ -2538,8 +2540,6 @@ mxge_rx_csum6(void *p, struct mbuf *m, u csum = (csum >> 16) + (csum & 0xFFFF); c = in6_cksum_pseudo(ip6, m->m_pkthdr.len - cksum_offset, nxt, csum); - -// printf("%d %d %x %x %x %x %x\n", m->m_pkthdr.len, cksum_offset, c, csum, ocsum, partial, d); c ^= 0xffff; return (c); } @@ -2560,6 +2560,9 @@ mxge_rx_csum(struct mbuf *m, int csum) #ifdef INET struct ip *ip; #endif +#if defined(INET) || defined(INET6) + int cap = m->m_pkthdr.rcvif->if_capenable; +#endif uint16_t c, etype;