diff mbox series

[v2,8/8] crypto/dpaa2_sec: fix OP storage for physical IOVA mode

Message ID 1522654594-2757-8-git-send-email-hemant.agrawal@nxp.com
State Superseded
Headers show
Series [v2,1/8] test/crypto: add macro for dpaa sec device name | expand

Commit Message

Hemant Agrawal April 2, 2018, 7:36 a.m. UTC
op storage in fle is just for reference for post dq.
So, don't convert it to iova mode.

Fixes: 37f96eb01bce ("crypto/dpaa2_sec: support scatter gather")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

---
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h     |  2 --
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 16 ++++++++--------
 2 files changed, 8 insertions(+), 10 deletions(-)

-- 
2.7.4

Comments

De Lara Guarch, Pablo April 2, 2018, 1:35 p.m. UTC | #1
Hi Hemant,

> -----Original Message-----

> From: Hemant Agrawal [mailto:hemant.agrawal@nxp.com]

> Sent: Monday, April 2, 2018 8:37 AM

> To: dev@dpdk.org

> Cc: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>;

> akhil.goyal@nxp.com

> Subject: [PATCH v2 8/8] crypto/dpaa2_sec: fix OP storage for physical IOVA

> mode

> 

> op storage in fle is just for reference for post dq.

> So, don't convert it to iova mode.

> 

> Fixes: 37f96eb01bce ("crypto/dpaa2_sec: support scatter gather")

> Cc: stable@dpdk.org

> 

> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>


I am getting a compilation issue when building with gcc 32 bits:

drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c: In function 'build_authenc_gcm_sg_fd':
drivers/bus/fslmc/portal/dpaa2_hw_pvt.h:204:33: error:
cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
  (fle)->addr_hi = upper_32_bits((uint64_t)addr);  \
                                 ^
drivers/bus/fslmc/portal/dpaa2_hw_pvt.h:23:40:
note: in definition of macro 'upper_32_bits'
 #define upper_32_bits(x) ((uint32_t)(((x) >> 16) >> 16))
                                        ^
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c:120:2:
note: in expansion of macro 'DPAA2_SET_FLE_ADDR'
  DPAA2_SET_FLE_ADDR(fle, op);
  ^~~~~~~~~~~~~~~~~~


Pablo
diff mbox series

Patch

diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index 4a19d42..ac72049 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -305,7 +305,6 @@  static phys_addr_t dpaa2_mem_vtop(uint64_t vaddr)
  */
 
 #define DPAA2_MBUF_VADDR_TO_IOVA(mbuf) ((mbuf)->buf_iova)
-#define DPAA2_OP_VADDR_TO_IOVA(op) (op->phys_addr)
 
 /**
  * macro to convert Virtual address to IOVA
@@ -326,7 +325,6 @@  static phys_addr_t dpaa2_mem_vtop(uint64_t vaddr)
 #else	/* RTE_LIBRTE_DPAA2_USE_PHYS_IOVA */
 
 #define DPAA2_MBUF_VADDR_TO_IOVA(mbuf) ((mbuf)->buf_addr)
-#define DPAA2_OP_VADDR_TO_IOVA(op) (op)
 #define DPAA2_VADDR_TO_IOVA(_vaddr) (_vaddr)
 #define DPAA2_IOVA_TO_VADDR(_iova) (_iova)
 #define DPAA2_MODIFY_IOVA_TO_VADDR(_mem, _type)
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index 9a74845..50a301d 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -117,7 +117,7 @@  build_authenc_gcm_sg_fd(dpaa2_sec_session *sess,
 		return -1;
 	}
 	memset(fle, 0, FLE_SG_MEM_SIZE);
-	DPAA2_SET_FLE_ADDR(fle, DPAA2_OP_VADDR_TO_IOVA(op));
+	DPAA2_SET_FLE_ADDR(fle, op);
 	DPAA2_FLE_SAVE_CTXT(fle, (size_t)priv);
 
 	op_fle = fle + 1;
@@ -268,7 +268,7 @@  build_authenc_gcm_fd(dpaa2_sec_session *sess,
 		return -1;
 	}
 	memset(fle, 0, FLE_POOL_BUF_SIZE);
-	DPAA2_SET_FLE_ADDR(fle, DPAA2_OP_VADDR_TO_IOVA(op));
+	DPAA2_SET_FLE_ADDR(fle, op);
 	DPAA2_FLE_SAVE_CTXT(fle, (ptrdiff_t)priv);
 	fle = fle + 1;
 	sge = fle + 2;
@@ -413,7 +413,7 @@  build_authenc_sg_fd(dpaa2_sec_session *sess,
 		return -1;
 	}
 	memset(fle, 0, FLE_SG_MEM_SIZE);
-	DPAA2_SET_FLE_ADDR(fle, DPAA2_OP_VADDR_TO_IOVA(op));
+	DPAA2_SET_FLE_ADDR(fle, op);
 	DPAA2_FLE_SAVE_CTXT(fle, (ptrdiff_t)priv);
 
 	op_fle = fle + 1;
@@ -562,7 +562,7 @@  build_authenc_fd(dpaa2_sec_session *sess,
 		return -1;
 	}
 	memset(fle, 0, FLE_POOL_BUF_SIZE);
-	DPAA2_SET_FLE_ADDR(fle, DPAA2_OP_VADDR_TO_IOVA(op));
+	DPAA2_SET_FLE_ADDR(fle, op);
 	DPAA2_FLE_SAVE_CTXT(fle, (ptrdiff_t)priv);
 	fle = fle + 1;
 	sge = fle + 2;
@@ -691,7 +691,7 @@  static inline int build_auth_sg_fd(
 	}
 	memset(fle, 0, FLE_SG_MEM_SIZE);
 	/* first FLE entry used to store mbuf and session ctxt */
-	DPAA2_SET_FLE_ADDR(fle, DPAA2_OP_VADDR_TO_IOVA(op));
+	DPAA2_SET_FLE_ADDR(fle, op);
 	DPAA2_FLE_SAVE_CTXT(fle, (ptrdiff_t)priv);
 	op_fle = fle + 1;
 	ip_fle = fle + 2;
@@ -772,7 +772,7 @@  build_auth_fd(dpaa2_sec_session *sess, struct rte_crypto_op *op,
 	 * to get the MBUF Addr from the previous FLE.
 	 * We can have a better approach to use the inline Mbuf
 	 */
-	DPAA2_SET_FLE_ADDR(fle, DPAA2_OP_VADDR_TO_IOVA(op));
+	DPAA2_SET_FLE_ADDR(fle, op);
 	DPAA2_FLE_SAVE_CTXT(fle, (ptrdiff_t)priv);
 	fle = fle + 1;
 
@@ -864,7 +864,7 @@  build_cipher_sg_fd(dpaa2_sec_session *sess, struct rte_crypto_op *op,
 	}
 	memset(fle, 0, FLE_SG_MEM_SIZE);
 	/* first FLE entry used to store mbuf and session ctxt */
-	DPAA2_SET_FLE_ADDR(fle, DPAA2_OP_VADDR_TO_IOVA(op));
+	DPAA2_SET_FLE_ADDR(fle, op);
 	DPAA2_FLE_SAVE_CTXT(fle, (ptrdiff_t)priv);
 
 	op_fle = fle + 1;
@@ -986,7 +986,7 @@  build_cipher_fd(dpaa2_sec_session *sess, struct rte_crypto_op *op,
 	 * to get the MBUF Addr from the previous FLE.
 	 * We can have a better approach to use the inline Mbuf
 	 */
-	DPAA2_SET_FLE_ADDR(fle, DPAA2_OP_VADDR_TO_IOVA(op));
+	DPAA2_SET_FLE_ADDR(fle, op);
 	DPAA2_FLE_SAVE_CTXT(fle, (ptrdiff_t)priv);
 	fle = fle + 1;
 	sge = fle + 2;