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 49A22A00BE; Wed, 20 Apr 2022 08:38:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DD7874068E; Wed, 20 Apr 2022 08:38:36 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id F28D940687; Wed, 20 Apr 2022 08:38:33 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 23K2P3wU024102; Tue, 19 Apr 2022 23:38:32 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=tDEHSh5tOGs2D5ObT5ck8WT5sCd7CjvlN5NOe408eZg=; b=g3LU9jkwUABqgxKAps8jDCf7UdRGhfMdmmMw4Xw3+40hHDc9Zpjy//G8RdoE7OGsyYcQ Ia4iOYQHLlIbP50y/vseizaspFrvrGqxQbtYzdt8GJsOYojTQj+pgxobVaM3+bRHhz2W BYY3S+qOpqq0SRVMNOEAG1jnyYZmd4Tw6zW5Zwea4DSxOCVZpA2wAo42Ji0TJdjpbkHI 6fsb3EuDIl9ZMOZXrwBWBMq2HG+C2Tov8ol8e5hjPo/dZaRQMHEQlpWhGipe82aR7MCx sEGPiQ+SdMR5rJp2xsM+mCsIJDV2JAvBIRWfYk0fqvraU9d1mS1AXKODHxcshPAkUDts Fg== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3fj9cfgmuh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 19 Apr 2022 23:38:32 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 19 Apr 2022 23:38:31 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Tue, 19 Apr 2022 23:38:31 -0700 Received: from localhost.localdomain (unknown [10.28.34.33]) by maili.marvell.com (Postfix) with ESMTP id CA5423F7093; Tue, 19 Apr 2022 23:38:28 -0700 (PDT) From: To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , Satheesh Paul , Subject: [dpdk-dev] [PATCH] common/cnxk: fix unaligned access to device memory Date: Wed, 20 Apr 2022 12:08:25 +0530 Message-ID: <20220420063825.286183-1-psatheesh@marvell.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: rRNz02k2wZiFQO1KFqnwl5ORUGu5RLAA X-Proofpoint-ORIG-GUID: rRNz02k2wZiFQO1KFqnwl5ORUGu5RLAA X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-04-19_08,2022-04-15_01,2022-02-23_01 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 From: Satheesh Paul Use mbox_memcpy() instead of memcpy() to prevent unaligned access. Fixes: 1f66919817e ("common/cnxk: improve MCAM entries management") Cc: stable@dpdk.org Signed-off-by: Satheesh Paul --- drivers/common/cnxk/roc_npc_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/common/cnxk/roc_npc_utils.c b/drivers/common/cnxk/roc_npc_utils.c index f9768ea3cf..0d02872c8b 100644 --- a/drivers/common/cnxk/roc_npc_utils.c +++ b/drivers/common/cnxk/roc_npc_utils.c @@ -582,7 +582,7 @@ npc_allocate_mcam_entry(struct mbox *mbox, int prio, if (!rsp_cmd->count) return -ENOSPC; - memcpy(rsp_local, rsp_cmd, sizeof(*rsp)); + mbox_memcpy(rsp_local, rsp_cmd, sizeof(*rsp)); return 0; } -- 2.25.4