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 1D9D9A0C41; Wed, 23 Jun 2021 22:32:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D248C40141; Wed, 23 Jun 2021 22:32:02 +0200 (CEST) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by mails.dpdk.org (Postfix) with ESMTP id 5B59F4003C for ; Wed, 23 Jun 2021 22:32:01 +0200 (CEST) Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15NK414Q173684; Wed, 23 Jun 2021 16:31:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=pNpS8iZHCtkA84RWedWpmcnSLQUIYjrEyQ83sZaMA3Y=; b=P5N/2G/uFiGQvfftBSX+iMUVO9thqb0Y7YnBLI83WbI5YlvJqk2gQHr3a5ZoLlQE0VVv F8Z81DApBhplAfMQKMWM4LDnfDrBjkj9MQxa1s90GfCNRyLCBtk+UWER7zMBD/VM+law RqasRFHIYWSAwIzMFJg/7Pv2Q6B+EVWZPyObzabQolU1jtZF01+UVpUfmX9o3Blp+Vxz PC+Hgx+hV0ESq9CsoawvPRG/uGUGPHbleUF/1uyjBEZQ/DGiqoY2gEbuPbm4aGQhJuYq JCuirmUDvwBLTzzmXxpdkLe2DZu5C56s9jjDYKxj0Jt6f/pHxDRUD8C1uihsxVVLFOnj Vg== Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com with ESMTP id 39c7ju0wwd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 23 Jun 2021 16:31:59 -0400 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 15NKCiVm017134; Wed, 23 Jun 2021 20:31:58 GMT Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by ppma02dal.us.ibm.com with ESMTP id 39987a41pw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 23 Jun 2021 20:31:58 +0000 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 15NKVw4A29098278 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 Jun 2021 20:31:58 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0B0F3B2064; Wed, 23 Jun 2021 20:31:58 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E77E3B2066; Wed, 23 Jun 2021 20:31:57 +0000 (GMT) Received: from localhost.localdomain (unknown [9.114.224.51]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 23 Jun 2021 20:31:57 +0000 (GMT) From: David Christensen To: dev@dpdk.org, jgrajcia@cisco.com Cc: David Christensen Date: Wed, 23 Jun 2021 13:31:54 -0700 Message-Id: <20210623203154.72409-1-drc@linux.vnet.ibm.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210623164935.59796-1-drc@linux.vnet.ibm.com> References: <20210623164935.59796-1-drc@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: VevdZAom6hlMAaM_HM8kZAG8DswCn-RA X-Proofpoint-GUID: VevdZAom6hlMAaM_HM8kZAG8DswCn-RA 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 mlxlogscore=959 bulkscore=0 phishscore=0 mlxscore=0 clxscore=1015 malwarescore=0 suspectscore=0 adultscore=0 priorityscore=1501 lowpriorityscore=0 spamscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106230117 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 --- v2: Fixed last patch which was bungled due to a bad local git squash drivers/net/memif/rte_eth_memif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c index da7195783f..d17222c612 100644 --- a/drivers/net/memif/rte_eth_memif.c +++ b/drivers/net/memif/rte_eth_memif.c @@ -383,7 +383,7 @@ eth_memif_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) if (mbuf != mbuf_head) rte_pktmbuf_pkt_len(mbuf_head) += cp_len; - memcpy(rte_pktmbuf_mtod_offset(mbuf, void *, dst_off), + rte_memcpy(rte_pktmbuf_mtod_offset(mbuf, void *, dst_off), (uint8_t *)memif_get_buffer(proc_private, d0) + src_off, cp_len); @@ -644,7 +644,7 @@ eth_memif_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) } cp_len = RTE_MIN(dst_len, src_len); - 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