From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <bruce.richardson@intel.com>
Received: from mga11.intel.com (mga11.intel.com [192.55.52.93])
 by dpdk.org (Postfix) with ESMTP id 422775A71
 for <dev@dpdk.org>; Thu, 23 Apr 2015 10:11:44 +0200 (CEST)
Received: from orsmga003.jf.intel.com ([10.7.209.27])
 by fmsmga102.fm.intel.com with ESMTP; 23 Apr 2015 01:11:42 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.11,629,1422950400"; d="scan'208";a="560535606"
Received: from unknown ([10.237.220.106])
 by orsmga003.jf.intel.com with SMTP; 23 Apr 2015 01:11:41 -0700
Received: by  (sSMTP sendmail emulation); Thu, 23 Apr 2015 09:11:39 +0025
Date: Thu, 23 Apr 2015 09:11:39 +0100
From: Bruce Richardson <bruce.richardson@intel.com>
To: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Message-ID: <20150423081138.GA8592@bricha3-MOBL3>
References: <1429716828-19012-1-git-send-email-rkerur@gmail.com>
 <1429716828-19012-2-git-send-email-rkerur@gmail.com>
 <55389E44.8030603@intel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <55389E44.8030603@intel.com>
Organization: Intel Shannon Ltd.
User-Agent: Mutt/1.5.23 (2014-03-12)
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 <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Thu, 23 Apr 2015 08:11:44 -0000

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 overlap.
> >+ *
> >+ * @note This is implemented as a macro, so it's address should not be taken
> >+ * and care is needed as parameter expressions may be evaluated multiple 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 greater
> 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.
> 

+1 to this point.

Also, if I read your quoted performance numbers in your earlier mail correctly,
we are only looking at a 1-4% performance increase. Is the additional code to
maintain worth the benefit?

/Bruce

> -- 
> Pawel