From owner-freebsd-bugs@FreeBSD.ORG Thu Aug 16 20:30:03 2007 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67F7016A421 for ; Thu, 16 Aug 2007 20:30:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id B086A13C467 for ; Thu, 16 Aug 2007 20:30:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l7GKU2qS062984 for ; Thu, 16 Aug 2007 20:30:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l7GKU2mB062981; Thu, 16 Aug 2007 20:30:02 GMT (envelope-from gnats) Resent-Date: Thu, 16 Aug 2007 20:30:02 GMT Resent-Message-Id: <200708162030.l7GKU2mB062981@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Andrew Gallatin Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3877816A419 for ; Thu, 16 Aug 2007 20:23:03 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 2594713C4A3 for ; Thu, 16 Aug 2007 20:23:03 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.1/8.14.1) with ESMTP id l7GKN2bC088101 for ; Thu, 16 Aug 2007 20:23:02 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.1/8.14.1/Submit) id l7GKN2kM088100; Thu, 16 Aug 2007 20:23:02 GMT (envelope-from nobody) Message-Id: <200708162023.l7GKN2kM088100@www.freebsd.org> Date: Thu, 16 Aug 2007 20:23:02 GMT From: Andrew Gallatin To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/115586: options IPSEC disables TSO X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Aug 2007 20:30:03 -0000 >Number: 115586 >Category: kern >Synopsis: options IPSEC disables TSO >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Aug 16 20:30:02 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Andrew Gallatin >Release: 7.0-CURRENT >Organization: Myricom >Environment: FreeBSD venice 7.0-CURRENT FreeBSD 7.0-CURRENT #4: Thu Aug 16 15:46:45 EDT 2007 gallatin@venice:/usr/src/sys/amd64/compile/IPSEC amd64 >Description: Simply compiling IPSEC into the kernel causes TCP Segmentation Offload to be silently disabled for all connections, not just connections using IPSEC. This causes a severe performance loss, especially on 10GbE networks. >How-To-Repeat: - Compile a kernel with 'options IPSEC' and device crypto - boot the kernel - notice that TSO stops working (can be verified by watching the number of packets sent via systat -tcp 1) >Fix: A *hack*, not a fix, is attached. The hack enables normal connections to do TSO even when IPSEC is compiled in. Essentially, the TSO code needs to be a bit smarter, and check for more than just a null tp->t_inpcb->inp_sp. I know nothing about IPSEC, so I'm not able to propose a real fix. Patch attached with submission follows: Index: netinet/tcp_output.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/tcp_output.c,v retrieving revision 1.140 diff -u -r1.140 tcp_output.c --- netinet/tcp_output.c 3 Jul 2007 12:13:43 -0000 1.140 +++ netinet/tcp_output.c 16 Aug 2007 19:46:09 -0000 @@ -459,8 +459,8 @@ ((tp->t_flags & TF_SIGNATURE) == 0) && tp->rcv_numsacks == 0 && sack_rxmit == 0 && tp->t_inpcb->inp_options == NULL && - tp->t_inpcb->in6p_options == NULL && - tp->t_inpcb->inp_sp == NULL) { + tp->t_inpcb->in6p_options == NULL /* && + tp->t_inpcb->inp_sp == NULL*/) { tso = 1; } else { len = tp->t_maxseg; >Release-Note: >Audit-Trail: >Unformatted: