From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 1079A5A71 for ; Thu, 23 Apr 2015 11:23:18 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP; 23 Apr 2015 02:23:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,629,1422950400"; d="scan'208";a="560557766" Received: from irsmsx106.ger.corp.intel.com ([163.33.3.31]) by orsmga003.jf.intel.com with ESMTP; 23 Apr 2015 02:23:17 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.178]) by IRSMSX106.ger.corp.intel.com ([169.254.8.204]) with mapi id 14.03.0224.002; Thu, 23 Apr 2015 10:23:16 +0100 From: "Ananyev, Konstantin" To: "Richardson, Bruce" , "Wodkowski, PawelX" Thread-Topic: [dpdk-dev] [PATCH] Implement memcmp using AVX/SSE instructio Thread-Index: AQHQfRHV9WyOe4TdZ06s+QcOcW959Z1aIkYAgAANEoCAACSlQA== Date: Thu, 23 Apr 2015 09:23:16 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725821420FC7@irsmsx105.ger.corp.intel.com> References: <1429716828-19012-1-git-send-email-rkerur@gmail.com> <1429716828-19012-2-git-send-email-rkerur@gmail.com> <55389E44.8030603@intel.com> <20150423081138.GA8592@bricha3-MOBL3> In-Reply-To: <20150423081138.GA8592@bricha3-MOBL3> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH] Implement memcmp using AVX/SSE instructio 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: Thu, 23 Apr 2015 09:23:19 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson > Sent: Thursday, April 23, 2015 9:12 AM > To: Wodkowski, PawelX > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] Implement memcmp using AVX/SSE instructio >=20 > On Thu, Apr 23, 2015 at 09:24:52AM +0200, Pawel Wodkowski wrote: > > On 2015-04-22 17:33, Ravi Kerur wrote: > > >+/** > > >+ * Compare bytes between two locations. The locations must not overla= p. > > >+ * > > >+ * @note This is implemented as a macro, so it's address should not b= e taken > > >+ * and care is needed as parameter expressions may be evaluated multi= ple times. > > >+ * > > >+ * @param src_1 > > >+ * Pointer to the first source of the data. > > >+ * @param src_2 > > >+ * Pointer to the second source of the data. > > >+ * @param n > > >+ * Number of bytes to compare. > > >+ * @return > > >+ * true if equal otherwise false. > > >+ */ > > >+static inline bool > > >+rte_memcmp(const void *src_1, const void *src, > > >+ size_t n) __attribute__((always_inline)); > > You are exposing this as public API, so I think you should follow > > description bellow or not call this _memcmp_ > > > > int memcmp(const void *s1, const void *s2, size_t n); > > > > The memcmp() function returns an integer less than, equal to, or grea= ter > > than > > zero if the first n bytes of s1 is found, respectively, to= be > > less than, to > > match, or be greater than the first n bytes of s2. > > >=20 > +1 to this point. >=20 > Also, if I read your quoted performance numbers in your earlier mail corr= ectly, > we are only looking at a 1-4% performance increase. Is the additional cod= e to > maintain worth the benefit? Yep, same thought here, is it really worth it? Konstantin >=20 > /Bruce >=20 > > -- > > Pawel