From owner-svn-src-head@freebsd.org Fri Nov 6 20:43:02 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 275F9A28AEB for ; Fri, 6 Nov 2015 20:43:02 +0000 (UTC) (envelope-from Cheng.Cui@netapp.com) Received: from mx142.netapp.com (mx142.netapp.com [216.240.21.19]) (using TLSv1.2 with cipher RC4-SHA (128/128 bits)) (Client CN "mx142.netapp.com", Issuer "Symantec Class 3 Secure Server CA - G4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD5AB153A; Fri, 6 Nov 2015 20:43:01 +0000 (UTC) (envelope-from Cheng.Cui@netapp.com) X-IronPort-AV: E=Sophos;i="5.20,253,1444719600"; d="scan'208";a="75513271" Received: from hioexcmbx04-prd.hq.netapp.com ([10.122.105.37]) by mx142-out.netapp.com with ESMTP; 06 Nov 2015 12:41:50 -0800 Received: from HIOEXCMBX03-PRD.hq.netapp.com (10.122.105.36) by hioexcmbx04-prd.hq.netapp.com (10.122.105.37) with Microsoft SMTP Server (TLS) id 15.0.1104.5; Fri, 6 Nov 2015 12:41:50 -0800 Received: from HIOEXCMBX03-PRD.hq.netapp.com ([::1]) by hioexcmbx03-prd.hq.netapp.com ([fe80::25cc:26bf:f7e1:4fa2%21]) with mapi id 15.00.1104.000; Fri, 6 Nov 2015 12:41:50 -0800 From: "Cui, Cheng" To: "hselasky@FreeBSD.org" CC: "svn-src-head@freebsd.org" Subject: Re: svn commit: r271946 - in head/sys: dev/oce dev/vmware/vmxnet3 dev/xen/netfront kern net netinet ofed/drivers/net/mlx4 sys Thread-Topic: svn commit: r271946 - in head/sys: dev/oce dev/vmware/vmxnet3 dev/xen/netfront kern net netinet ofed/drivers/net/mlx4 sys Thread-Index: AQHRGNOPgMCVBieqOEmj6yi33iX1QQ== Date: Fri, 6 Nov 2015 20:41:49 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: Apple Mail (2.1878.6) x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.122.56.79] Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 06 Nov 2015 20:43:02 -0000 Hello Hans, This is Cheng Cui. I am reading the CURRENT FreeBSD code in tcp_output.c, a= nd find this question regarding your change in revision 271946. https://svnweb.freebsd.org/base/head/sys/netinet/tcp_output.c?r1=3D271946&r= 2=3D271945&pathrev=3D271946 trim data "len" under TSO: 885 /* 886 * Prevent the last segment from being 887 * fractional unless the send sockbuf can be 888 * emptied: 889 */ 890 max_len =3D (tp->t_maxopd - optlen); 891 if ((off + len) < sbavail(&so->so_snd)) { <= =3D=3D 892 moff =3D len % max_len; 893 if (moff !=3D 0) { 894 len -=3D moff; 895 sendalot =3D 1; 896 } 897 } Is there a specific reason that it should skip trimming the data "len" unde= r the condition of "(off + len) =3D=3D sbavail(&so->so_snd)" in TSO? Becaus= e I am wondering if we can trim the data "len" directly without checking th= e "(off + len)" condition. Thanks, --Cheng Cui NetApp Scale Out Networking