From owner-freebsd-current@FreeBSD.ORG Thu Sep 11 20:29:20 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BE88A417; Thu, 11 Sep 2014 20:29:20 +0000 (UTC) Received: from esa-annu.net.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 4D828FE8; Thu, 11 Sep 2014 20:29:19 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ar0EABjPEVSDaFve/2dsb2JhbABfg2BXBIJ4xUIKhnlUAYEneIQDAQEBAwEBAQEgBCcgCwUWGAICDRkCKQEJJgYIBwQBHASIGQgNqTKVUQEXgSyNSQcBAQEaNAeCeYFTBZUeW4QAhGKTWoN9IS8HfwkXIoEHAQEB X-IronPort-AV: E=Sophos;i="5.04,507,1406606400"; d="scan'208";a="154629762" Received: from muskoka.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.222]) by esa-annu.net.uoguelph.ca with ESMTP; 11 Sep 2014 16:29:12 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 85EA4B4090; Thu, 11 Sep 2014 16:29:12 -0400 (EDT) Date: Thu, 11 Sep 2014 16:29:12 -0400 (EDT) From: Rick Macklem To: Hans Petter Selasky Message-ID: <1658973011.35255303.1410467352538.JavaMail.root@uoguelph.ca> In-Reply-To: <54117DCD.5090701@selasky.org> Subject: Re: [RFC] Patch to improve TSO limitation formula in general MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.203] X-Mailer: Zimbra 7.2.6_GA_2926 (ZimbraWebClient - FF3.0 (Win)/7.2.6_GA_2926) Cc: George Neville-Neil , FreeBSD Current , Scott Long , Jack F Vogel X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Sep 2014 20:29:20 -0000 Hans Petter Selasky wrote: > Hi Rick, > > Did you get a chance to look further at my patch? > Ok, I just took a quick look. (I didn't try and figure out if the code in tcp_output() looked correct.) > Is this something we can commit? > Well, I'd like to sound more positive, but here are a number of problems I see with the patch: 1 - if_hw_tsomax is already in use by at least one driver, so I think it would be a POLA violation to replace it and make it very difficult to MFC. --> I'd leave if_hw_tsomax as is and add your new stuff as separate fields so things don't get broken for drivers that don't support your new fields. 2 - As above, most drivers don't even set if_hw_tsomax, so it will take some time for drivers to be converted. --> As such, the defaults need to be such that an NFS mbuf list of 35 mbufs totalling just over 64K works. (The drivers that handle 32 mbufs in a list need to get an mbuf list with no more that 64K minus ethernet headers, so they can squeeze the TSO segment into 32 mclbyte mbuf clusters via m_defrag().) 3 - I don't think making the fields "log 2" is necessary or appropriate. Many current drivers support 35 mbufs in the fragment list. This is enough for NFS and is not a power of 2. I think each field should be just a u_int that can replace spares in "struct ifnet". --> I do not think that the size of ethernet headers needs to be specified if if_hw_tsomax still exists, since the driver can reduce the max size by that much. (It also varies depending on network type and whether or not VLAN headers are done by the hardware or driver.) In summary, I'd add two u_ints to "struct ifnet": 1 - for max size of a fragment 2 - for max # of transmit fragments then I'd set the defaults for these so that current code (ie. old drivers) don't break. This would probably mean a large default for both of these along with the current default value for if_hw_tsomax. Then the fun part..Make tcp_output() generate TSO segments that are limited by all three of the above. rick ps: Hopefully others will comment on this, since I'm not a networking guy. (I just ended up involved in this because NFS over TSO enabled net interfaces was badly broken and I got tired of telling people to disable TSO.) > --HPS > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to > "freebsd-current-unsubscribe@freebsd.org" >