crypto/octeontx2: fix unaligned access to device memory

Message ID 1630042438-3434-1-git-send-email-anoobj@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series crypto/octeontx2: fix unaligned access to device memory |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing fail Testing issues
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS

Commit Message

Anoob Joseph Aug. 27, 2021, 5:33 a.m. UTC
  From: Danny Patel <dannyp@marvell.com>

Use otx2_mbox_memcpy() instead of memcpy() to prevent unaligned access.

Fixes: a0645ed0d6ef ("crypto/octeontx2: discover capabilities")
Cc: ktejasree@marvell.com

Signed-off-by: Danny Patel <dannyp@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 drivers/crypto/octeontx2/otx2_cryptodev_mbox.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Akhil Goyal Sept. 2, 2021, 11:25 a.m. UTC | #1
> Use otx2_mbox_memcpy() instead of memcpy() to prevent unaligned access.
> 
> Fixes: a0645ed0d6ef ("crypto/octeontx2: discover capabilities")
> Cc: ktejasree@marvell.com
Cc: stable@dpdk.org

> 
> Signed-off-by: Danny Patel <dannyp@marvell.com>
> Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> ---
Applied to dpdk-next-crypto

Thanks.
  

Patch

diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_mbox.c b/drivers/crypto/octeontx2/otx2_cryptodev_mbox.c
index 999f425..a635eb4 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev_mbox.c
+++ b/drivers/crypto/octeontx2/otx2_cryptodev_mbox.c
@@ -37,7 +37,7 @@  otx2_cpt_hardware_caps_get(const struct rte_cryptodev *dev,
 	}
 
 	vf->cpt_revision = rsp->cpt_revision;
-	memcpy(hw_caps, rsp->eng_caps,
+	otx2_mbox_memcpy(hw_caps, rsp->eng_caps,
 		sizeof(union cpt_eng_caps) * CPT_MAX_ENG_TYPES);
 
 	return 0;