Skip to contentSkip to conversation

qat pmd:Fixing build issue on 32-bit systems

PATCH Superseded John Griffin 3 participants 5 messages Feb 16, 2016 – Feb 24, 2016 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qat pmd:Fixing build issue on 32-bit systems

Fixing build issue on 32-bit systems.

Fixes 1703e94ac5ce ("qat: add driver for QuickAssist devices")
---
 drivers/crypto/qat/qat_crypto.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/crypto/qat/qat_crypto.c +2 -2
index 129e96d..828756b 100644
@@ -342,7 +342,7 @@ qat_crypto_pkt_rx_burst(void *qp, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 
 	while (*(uint32_t *)resp_msg != ADF_RING_EMPTY_SIG &&
 			msg_counter != nb_pkts) {
-		rx_mbuf = (struct rte_mbuf *)(resp_msg->opaque_data);
+		rx_mbuf = (struct rte_mbuf *)(uintptr_t)(resp_msg->opaque_data);
 		ol = rte_pktmbuf_offload_get(rx_mbuf, RTE_PKTMBUF_OL_CRYPTO);
 
 		if (ICP_QAT_FW_COMN_STATUS_FLAG_OK !=
@@ -405,7 +405,7 @@ qat_alg_write_mbuf_entry(struct rte_mbuf *mbuf, uint8_t *out_msg)
 	ctx = (struct qat_session *)ol->op.crypto.session->_private;
 	qat_req = (struct icp_qat_fw_la_bulk_req *)out_msg;
 	*qat_req = ctx->fw_req;
-	qat_req->comn_mid.opaque_data = (uint64_t)mbuf;
+	qat_req->comn_mid.opaque_data = (uint64_t)(uintptr_t)mbuf;
 
 	/*
 	 * The following code assumes:
Signature · 1 line
2.1.0
Acked-by on v1 1/1
#1 lore raw

Hi John,

Quoted 10 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of John Griffin
Sent: Tuesday, February 16, 2016 9:45 AM
To: [email protected]
Subject: [dpdk-dev] [PATCH] qat pmd:Fixing build issue on 32-bit systems

Fixing build issue on 32-bit systems.

Fixes 1703e94ac5ce ("qat: add driver for QuickAssist devices")

Could you include the error that you are fixing on this patch?

For example:

drivers/crypto/qat/qat_crypto.c:345:13:
error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]

Also, as a general rule, patch titles start with lowercase and do not include the name "issue" if we use "fix". e.g. (qat: fix build on 32-bit systems).

Apart from this, patch looks OK to me, so you can leave the acknowledgment in the v2.

Thanks!
Pablo

#2 lore raw

Hi Pablo,
Sure - will resubmit a v2 with those modifications.

Thanks,
John.

Quoted 29 lines · Pablo

Hi John,

Quoted 10 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of John Griffin
Sent: Tuesday, February 16, 2016 9:45 AM
To: [email protected]
Subject: [dpdk-dev] [PATCH] qat pmd:Fixing build issue on 32-bit systems

Fixing build issue on 32-bit systems.

Fixes 1703e94ac5ce ("qat: add driver for QuickAssist devices")

Could you include the error that you are fixing on this patch?

For example:

drivers/crypto/qat/qat_crypto.c:345:13:
error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]

Also, as a general rule, patch titles start with lowercase and do not include the name "issue" if we use "fix". e.g. (qat: fix build on 32-bit systems).

Apart from this, patch looks OK to me, so you can leave the acknowledgment in the v2.

Thanks!
Pablo

#3 lore raw

PATCH v2 1/1 qat:fix build on 32-bit systems

In reply to John Griffin

Fixing build on 32-bit systems on quick assist driver - for example:
drivers/crypto/qat/qat_crypto.c: In function ‘qat_alg_write_mbuf_entry’:
drivers/crypto/qat/qat_crypto.c:408:34: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]

Fixes 1703e94ac5ce ("qat: add driver for QuickAssist devices")

---
v1->v2:
- Corrected subject text and included build failure.

 drivers/crypto/qat/qat_crypto.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/crypto/qat/qat_crypto.c +2 -2
index 129e96d..828756b 100644
@@ -342,7 +342,7 @@ qat_crypto_pkt_rx_burst(void *qp, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 
 	while (*(uint32_t *)resp_msg != ADF_RING_EMPTY_SIG &&
 			msg_counter != nb_pkts) {
-		rx_mbuf = (struct rte_mbuf *)(resp_msg->opaque_data);
+		rx_mbuf = (struct rte_mbuf *)(uintptr_t)(resp_msg->opaque_data);
 		ol = rte_pktmbuf_offload_get(rx_mbuf, RTE_PKTMBUF_OL_CRYPTO);
 
 		if (ICP_QAT_FW_COMN_STATUS_FLAG_OK !=
@@ -405,7 +405,7 @@ qat_alg_write_mbuf_entry(struct rte_mbuf *mbuf, uint8_t *out_msg)
 	ctx = (struct qat_session *)ol->op.crypto.session->_private;
 	qat_req = (struct icp_qat_fw_la_bulk_req *)out_msg;
 	*qat_req = ctx->fw_req;
-	qat_req->comn_mid.opaque_data = (uint64_t)mbuf;
+	qat_req->comn_mid.opaque_data = (uint64_t)(uintptr_t)mbuf;
 
 	/*
 	 * The following code assumes:
Signature · 1 line
2.1.0
#4 lore raw

Re: [PATCH v2] qat:fix build on 32-bit systems

2016-02-18 10:57, John Griffin:

Quoted 8 lines

Fixing build on 32-bit systems on quick assist driver - for example:
drivers/crypto/qat/qat_crypto.c: In function ‘qat_alg_write_mbuf_entry’:
drivers/crypto/qat/qat_crypto.c:408:34: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]

Fixes 1703e94ac5ce ("qat: add driver for QuickAssist devices")

Applied, thanks