From owner-svn-src-head@freebsd.org Tue Jan 19 16:52:02 2016 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 97D30A89852; Tue, 19 Jan 2016 16:52:02 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60B3010BD; Tue, 19 Jan 2016 16:52:02 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 6BCAC1FE024; Tue, 19 Jan 2016 17:51:59 +0100 (CET) Subject: Re: svn commit: r294327 - in head/sys: dev/cxgb dev/cxgbe dev/e1000 dev/hyperv/netvsc dev/ixgbe dev/mxge netinet sys To: Ryan Stone References: <201601191533.u0JFXSxf037804@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Hans Petter Selasky Message-ID: <569E6A38.8080108@selasky.org> Date: Tue, 19 Jan 2016 17:54:16 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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: Tue, 19 Jan 2016 16:52:02 -0000 On 01/19/16 17:09, Ryan Stone wrote: > On Tue, Jan 19, 2016 at 10:33 AM, Hans Petter Selasky > wrote: > >> >> + qsort(lc->lro_mbuf_data, lc->lro_mbuf_count, sizeof(struct mbuf *), >> + &tcp_lro_mbuf_compare_header); >> > > In the worst case, qsort() can take O(n**2) time and consume O(n) stack > space. Is there a DOS concern here? > Hi Ryan, Is this the case for the qsort() we have in the FreeBSD kernel? There are other sorting algorithms which can be used instead of qsort() which consume O(n * log(n)) time and O(1) stack, but requires a power of two set of elements to sort. --HPS