From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 43EBFA0A0C; Thu, 1 Jul 2021 18:22:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2AE6941325; Thu, 1 Jul 2021 18:22:52 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 7C6434067C for ; Thu, 1 Jul 2021 18:22:51 +0200 (CEST) Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 03E377F502; Thu, 1 Jul 2021 19:22:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 03E377F502 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1625156571; bh=8AmUQyKxxeI2kN+FVrbNYmqa5GJfKi3ek4wcWNiiZEE=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=mSZe0wh9C0I3SvphfrPTLfqvQ9XssjFpGGYxJaswpOOBJHZCL6vhxsmA0vZHe3BPf PKESWfo38dl3IIoNDzs4sPCmOxKX+4Y8RKt8YMiS7ZBPXFg9DPZLk4LreMFyvwDCPa I9Ep8oM1fzM+WQocCwlaWqbsshYmw/0RGmry7B18= To: Stephen Hemminger , David Christensen Cc: jgrajcia@cisco.com, dev@dpdk.org References: <20210623164935.59796-1-drc@linux.vnet.ibm.com> <20210623100347.58f9a384@hermes.local> From: Andrew Rybchenko Organization: OKTET Labs Message-ID: <1e8300e0-3c72-7d2b-5ad6-cd8d9495e87f@oktetlabs.ru> Date: Thu, 1 Jul 2021 19:22:50 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210623100347.58f9a384@hermes.local> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] net/memif: replace memcpy() with rte_memcpy() to improve perf X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 6/23/21 8:03 PM, Stephen Hemminger wrote: > On Wed, 23 Jun 2021 09:49:35 -0700 > David Christensen wrote: > >> Replacing memcpy() with rte_memcpy() improved 64 byte packet >> performance by 33% on a POWER9 system and by 10% on an x86_64 >> system. > > I see rte_memcpy was already used in the patch diff > >> Signed-off-by: David Christensen >> --- >> drivers/net/memif/rte_eth_memif.c | 7 ++++--- >> 1 file changed, 4 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c >> index d17222c612..330c9c2fd6 100644 >> --- a/drivers/net/memif/rte_eth_memif.c >> +++ b/drivers/net/memif/rte_eth_memif.c >> @@ -384,8 +384,8 @@ eth_memif_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) >> rte_pktmbuf_pkt_len(mbuf_head) += cp_len; >> >> rte_memcpy(rte_pktmbuf_mtod_offset(mbuf, void *, dst_off), >> - (uint8_t *)memif_get_buffer(proc_private, d0) + src_off, >> - cp_len); >> + (uint8_t *)memif_get_buffer(proc_private, d0) >> + + src_off, cp_len); > > This just changes line break for no good reason. >> >> src_off += cp_len; >> dst_off += cp_len; >> @@ -644,7 +644,8 @@ eth_memif_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) >> } >> cp_len = RTE_MIN(dst_len, src_len); >> >> - rte_memcpy((uint8_t *)memif_get_buffer(proc_private, d0) + dst_off, >> + rte_memcpy((uint8_t *) >> + memif_get_buffer(proc_private, d0) + dst_off, >> rte_pktmbuf_mtod_offset(mbuf, void *, src_off), >> cp_len); >> > > ditto. > > Look like this patch is confused, the description does not match the code. > I guess it was a patch on top of [1]. Marking this one as rejected since I've applied style fixes before applying it. [1] https://patches.dpdk.org/project/dpdk/patch/20210623203154.72409-1-drc@linux.vnet.ibm.com/