From owner-freebsd-net@FreeBSD.ORG Tue Jul 8 00:52:36 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF610256; Tue, 8 Jul 2014 00:52:36 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CBA5F2424; Tue, 8 Jul 2014 00:52:36 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s680qZwT073334 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 7 Jul 2014 17:52:35 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s680qY4P073333; Mon, 7 Jul 2014 17:52:34 -0700 (PDT) (envelope-from jmg) Date: Mon, 7 Jul 2014 17:52:34 -0700 From: John-Mark Gurney To: Hans Petter Selasky Subject: Re: [RFC] Allow m_dup() to use JUMBO clusters Message-ID: <20140708005234.GJ45513@funkthat.com> Mail-Followup-To: Hans Petter Selasky , freebsd-net@freebsd.org, freebsd-current@freebsd.org References: <53BA5657.8010309@selasky.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53BA5657.8010309@selasky.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Mon, 07 Jul 2014 17:52:35 -0700 (PDT) Cc: freebsd-net@freebsd.org, freebsd-current@freebsd.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jul 2014 00:52:37 -0000 Hans Petter Selasky wrote this message on Mon, Jul 07, 2014 at 10:12 +0200: > I'm asking for some input on the attached m_dup() patch, so that > existing functionality or dependencies are not broken. The background > for the change is to allow m_dup() to defrag long mbuf chains that > doesn't fit into a specific hardware's scatter gather entries, typically > when doing TSO. > > In my case the HW limit is 16 entries of length 4K for doing a 64KByte > TSO packet. Currently m_dup() is at best producing 32 entries of each 2K > for a 64Kbytes TSO packet. > > By allowing m_dup() to get JUMBO clusters when allocating mbufs, we > avoid creating a new function, specific to the hardware, to defrag some > rare-occurring very long mbuf chains into a mbuf chain below 16 entries. Please no... Until we get a better allocator, we should not use jumbo (>page sized) mbufs otherwise we will quickly fail to allocate mbufs after a machine has been up for a long while causing other failures... Unless of course if the code fails to allocate the largest cluster it falls through to trying to allocate the next smaller size, that might be better... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."