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 CC0CCA0C42; Wed, 23 Jun 2021 18:49:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 56C404003F; Wed, 23 Jun 2021 18:49:43 +0200 (CEST) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by mails.dpdk.org (Postfix) with ESMTP id 3A4B64003E for ; Wed, 23 Jun 2021 18:49:41 +0200 (CEST) Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15NGYPJk161243; Wed, 23 Jun 2021 12:49:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=HEccIgciAcmNHYs3//ThgZoFdE46znyQY/ELFVsIGkE=; b=YGCmrOKVO4DS84fH4IPn2RPTLxzjpViqtXSlnrnAjtsrqwsqfJx71XvW3UL++9lXMtnE q1cqQqupFZTJPB36tsUrU6tG9YwbxoRaD+xwcLo/ATRyNxGOJDd/foILxthZxFTVjyci lbfOx61ETMDTQtxMHER+fE2BoD+HRM2OHkvYCWc5ay3Ngk8Xvhm11sBVEbL25Oi8/Qgx Rs8BrwJDWi5TjrM9MFG1zB5lhzLfyutVnVV/W1fqQY4a4+KaXT+n89vjGXXgyq07Zqi7 CCma9MgsQZIHh/UoCZv6xYpKzxdqwpRd3+A1LUhBhtkDzMvm0KZK9GNh8dYcjZ12U0ym nw== Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com with ESMTP id 39c69p625c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 23 Jun 2021 12:49:39 -0400 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 15NGgiRh003218; Wed, 23 Jun 2021 16:49:38 GMT Received: from b01cxnp22033.gho.pok.ibm.com (b01cxnp22033.gho.pok.ibm.com [9.57.198.23]) by ppma01dal.us.ibm.com with ESMTP id 39987a29wc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 23 Jun 2021 16:49:38 +0000 Received: from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com [9.57.199.106]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 15NGnb6a32571734 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 Jun 2021 16:49:37 GMT Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9C1FE28065; Wed, 23 Jun 2021 16:49:37 +0000 (GMT) Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 836772805C; Wed, 23 Jun 2021 16:49:37 +0000 (GMT) Received: from localhost.localdomain (unknown [9.114.224.51]) by b01ledav001.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 23 Jun 2021 16:49:37 +0000 (GMT) From: David Christensen To: jgrajcia@cisco.com, dev@dpdk.org Cc: David Christensen Date: Wed, 23 Jun 2021 09:49:35 -0700 Message-Id: <20210623164935.59796-1-drc@linux.vnet.ibm.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: c5LZYgLDFcfguMQLy9Lm5wD9Xsk6Sa4l X-Proofpoint-ORIG-GUID: c5LZYgLDFcfguMQLy9Lm5wD9Xsk6Sa4l X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-06-23_12:2021-06-23, 2021-06-23 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 priorityscore=1501 adultscore=0 phishscore=0 lowpriorityscore=0 mlxlogscore=999 impostorscore=0 mlxscore=0 bulkscore=0 suspectscore=0 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106230096 Subject: [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" Replacing memcpy() with rte_memcpy() improved 64 byte packet performance by 33% on a POWER9 system and by 10% on an x86_64 system. 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); 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); -- 2.27.0