From owner-freebsd-net@FreeBSD.ORG Fri Sep 5 21:44:50 2014 Return-Path: Delivered-To: freebsd-net@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 33DE6219; Fri, 5 Sep 2014 21:44:50 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E831A1276; Fri, 5 Sep 2014 21:44:49 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 040031FE027; Fri, 5 Sep 2014 23:44:46 +0200 (CEST) Message-ID: <540A2ECB.8010502@selasky.org> Date: Fri, 05 Sep 2014 23:44:43 +0200 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Eric Joyner Subject: Re: [RFC] Patch to improve TSO limitation formula in general References: <540A0301.9040701@selasky.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: "freebsd-net@freebsd.org" , FreeBSD Current , Scott Long , Jack F Vogel X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 21:44:50 -0000 On 09/05/14 23:19, Eric Joyner wrote: > There are some concerns if we use this with devices that ixl supports: > > - The maximum fragment size is 16KB-1, which isn't a power of 2. > Hi Eric, Multiplying by powers of two are more fast, than non-powers of two. So in this case you would have to use 8KB as a maximum. > - You can't get the maximum TSO size for ixl devices by multiplying the > maximum number of fragments by the maximum size. > Instead the number of fragments is AFAIK unlimited, but a segment can only > span 8 mbufs (including the [up to 3] mbufs containing the header), and the > maximum TSO size is 256KB. > > And one question: > > - Is hdr_size_log2 supposed to be the length of the L2 header? We can fit > 254 L2 bytes in our hardware during a TSO, so if that's the value, I guess > that's fine, barring the it-not-being-a-power-of-2 issue. This is the ethernet / vlan headers. It is added with the TCP/IP-header in the end. > > With all that said, the 8 mbuf limit per segment issue is a TSO limitation > that we'd like to notify the stack about, so I wonder if that could be > incorporated along with this. Right now, our driver checks to see if a > segment in a TSO spans more than six mbufs and then m_defrag()'s the entire > chain if one exists; it's less than optimal but necessary to prevent errors. It is not impossible to move from log2 syntax to non-log2 syntax, hence the logic will be exactly the same, only that the required division and multiplication will have a bit overhead I guess. Could you make a patch on top of my patch with the changes you think are required to fully support the ixl hardware? Or propose a new patch which also serves the MLX needs? Thank you! --HPS