From owner-svn-src-stable-9@FreeBSD.ORG Sun Jul 8 12:23:27 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D41621065673; Sun, 8 Jul 2012 12:23:27 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2EE98FC08; Sun, 8 Jul 2012 12:23:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q68CNRVI050936; Sun, 8 Jul 2012 12:23:27 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68CNROC050934; Sun, 8 Jul 2012 12:23:27 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207081223.q68CNROC050934@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 8 Jul 2012 12:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238239 - stable/9/sys/netinet X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 12:23:28 -0000 Author: bz Date: Sun Jul 8 12:23:27 2012 New Revision: 238239 URL: http://svn.freebsd.org/changeset/base/238239 Log: MFC r235981,236394 In case forwarding is turned on for a given address family, refuse to queue the packet for LRO and tell the driver to directly pass it on. This avoids re-assembly and later re-fragmentation problems when forwarding. It's not the best solution but the simplest and most effective for the moment. Make TCP LRO work properly with VIMAGE kernels rather than just panicing. There's no VIMAGE context set there yet as this is before if_ethersubr.c. Approved by: re Modified: stable/9/sys/netinet/tcp_lro.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_lro.c ============================================================================== --- stable/9/sys/netinet/tcp_lro.c Sun Jul 8 12:17:56 2012 (r238238) +++ stable/9/sys/netinet/tcp_lro.c Sun Jul 8 12:23:27 2012 (r238239) @@ -46,14 +46,18 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include +#include #include #include +#include + #include #ifndef LRO_ENTRIES @@ -369,6 +373,14 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m switch (eh_type) { #ifdef INET6 case ETHERTYPE_IPV6: + { + CURVNET_SET(lc->ifp->if_vnet); + if (V_ip6_forwarding != 0) { + /* XXX-BZ stats but changing lro_ctrl is a problem. */ + CURVNET_RESTORE(); + return (TCP_LRO_CANNOT); + } + CURVNET_RESTORE(); l3hdr = ip6 = (struct ip6_hdr *)(eh + 1); error = tcp_lro_rx_ipv6(lc, m, ip6, &th); if (error != 0) @@ -376,9 +388,18 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m tcp_data_len = ntohs(ip6->ip6_plen); ip_len = sizeof(*ip6) + tcp_data_len; break; + } #endif #ifdef INET case ETHERTYPE_IP: + { + CURVNET_SET(lc->ifp->if_vnet); + if (V_ipforwarding != 0) { + /* XXX-BZ stats but changing lro_ctrl is a problem. */ + CURVNET_RESTORE(); + return (TCP_LRO_CANNOT); + } + CURVNET_RESTORE(); l3hdr = ip4 = (struct ip *)(eh + 1); error = tcp_lro_rx_ipv4(lc, m, ip4, &th); if (error != 0) @@ -386,6 +407,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m ip_len = ntohs(ip4->ip_len); tcp_data_len = ip_len - sizeof(*ip4); break; + } #endif /* XXX-BZ what happens in case of VLAN(s)? */ default: