From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id E41DD7F00 for ; Wed, 17 Dec 2014 12:01:03 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 17 Dec 2014 03:00:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,593,1413270000"; d="scan'208,217";a="625177983" Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66]) by orsmga001.jf.intel.com with ESMTP; 17 Dec 2014 03:00:47 -0800 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.144]) by IRSMSX152.ger.corp.intel.com ([169.254.6.56]) with mapi id 14.03.0195.001; Wed, 17 Dec 2014 11:00:46 +0000 From: "Ananyev, Konstantin" To: Jay Rolette Thread-Topic: [dpdk-dev] [PATCH] replaced O(n^2) sort in sort_by_physaddr() with qsort() from standard library Thread-Index: AQHQFVyU+firDJfMLkmDVfyF9iWdDpySk28ggAAL44CAAADHAIAA/jnQ Date: Wed, 17 Dec 2014 11:00:46 +0000 Message-ID: <2601191342CEEE43887BDE71AB977258213C16E7@IRSMSX105.ger.corp.intel.com> References: <2601191342CEEE43887BDE71AB977258213C1357@IRSMSX105.ger.corp.intel.com> In-Reply-To: Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.182] MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: Dev Subject: Re: [dpdk-dev] [PATCH] replaced O(n^2) sort in sort_by_physaddr() with qsort() from standard library X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 11:01:05 -0000 SGkg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