DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] crypto/qat: use better variable names in CRC functions
@ 2020-07-16 15:34 David Coyle
  2020-07-17 18:21 ` Trahe, Fiona
  0 siblings, 1 reply; 3+ messages in thread
From: David Coyle @ 2020-07-16 15:34 UTC (permalink / raw)
  To: akhil.goyal, declan.doherty, fiona.trahe
  Cc: dev, brendan.ryan, mairtin.oloingsigh, pablo.de.lara.guarch, David Coyle

The variable names crc_length and crc_offset have been changed to
crc_data_len and crc_data_ofs respectively, to make it clearer as to
their use i.e. the length and offset of the data over which the CRC is
calculated.

Fixes: 6f0ef237404b ("crypto/qat: support DOCSIS protocol")

Signed-off-by: David Coyle <david.coyle@intel.com>
---
 drivers/crypto/qat/qat_sym.c |  8 ++++----
 drivers/crypto/qat/qat_sym.h | 13 +++++++------
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c
index 6d568ab8f..fe5c85c34 100644
--- a/drivers/crypto/qat/qat_sym.c
+++ b/drivers/crypto/qat/qat_sym.c
@@ -108,18 +108,18 @@ qat_crc_generate(struct qat_sym_session *ctx,
 			struct rte_crypto_op *op)
 {
 	struct rte_crypto_sym_op *sym_op = op->sym;
-	uint32_t *crc, crc_length;
+	uint32_t *crc, crc_data_len;
 	uint8_t *crc_data;
 
 	if (ctx->qat_dir == ICP_QAT_HW_CIPHER_ENCRYPT &&
 			sym_op->auth.data.length != 0) {
 
-		crc_length = sym_op->auth.data.length;
+		crc_data_len = sym_op->auth.data.length;
 		crc_data = rte_pktmbuf_mtod_offset(sym_op->m_src, uint8_t *,
 				sym_op->auth.data.offset);
-		crc = (uint32_t *)(crc_data + crc_length);
+		crc = (uint32_t *)(crc_data + crc_data_len);
 
-		*crc = rte_net_crc_calc(crc_data, crc_length,
+		*crc = rte_net_crc_calc(crc_data, crc_data_len,
 				RTE_NET_CRC32_ETH);
 	}
 }
diff --git a/drivers/crypto/qat/qat_sym.h b/drivers/crypto/qat/qat_sym.h
index dbca74efb..7934dd478 100644
--- a/drivers/crypto/qat/qat_sym.h
+++ b/drivers/crypto/qat/qat_sym.h
@@ -140,20 +140,21 @@ static inline void
 qat_crc_verify(struct qat_sym_session *ctx, struct rte_crypto_op *op)
 {
 	struct rte_crypto_sym_op *sym_op = op->sym;
-	uint32_t crc_offset, crc_length, crc;
+	uint32_t crc_data_ofs, crc_data_len, crc;
 	uint8_t *crc_data;
 
 	if (ctx->qat_dir == ICP_QAT_HW_CIPHER_DECRYPT &&
 			sym_op->auth.data.length != 0) {
 
-		crc_offset = sym_op->auth.data.offset;
-		crc_length = sym_op->auth.data.length;
+		crc_data_ofs = sym_op->auth.data.offset;
+		crc_data_len = sym_op->auth.data.length;
 		crc_data = rte_pktmbuf_mtod_offset(sym_op->m_src, uint8_t *,
-				crc_offset);
+				crc_data_ofs);
 
-		crc = rte_net_crc_calc(crc_data, crc_length, RTE_NET_CRC32_ETH);
+		crc = rte_net_crc_calc(crc_data, crc_data_len,
+				RTE_NET_CRC32_ETH);
 
-		if (crc != *(uint32_t *)(crc_data + crc_length))
+		if (crc != *(uint32_t *)(crc_data + crc_data_len))
 			op->status = RTE_CRYPTO_OP_STATUS_AUTH_FAILED;
 	}
 }
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH v1] crypto/qat: use better variable names in CRC functions
  2020-07-16 15:34 [dpdk-dev] [PATCH v1] crypto/qat: use better variable names in CRC functions David Coyle
@ 2020-07-17 18:21 ` Trahe, Fiona
  2020-07-18 21:33   ` Akhil Goyal
  0 siblings, 1 reply; 3+ messages in thread
From: Trahe, Fiona @ 2020-07-17 18:21 UTC (permalink / raw)
  To: Coyle, David, akhil.goyal, Doherty, Declan
  Cc: dev, Ryan, Brendan, O'loingsigh, Mairtin, De Lara Guarch, Pablo



> -----Original Message-----
> From: Coyle, David <david.coyle@intel.com>
> Sent: Thursday, July 16, 2020 4:35 PM
> To: akhil.goyal@nxp.com; Doherty, Declan <declan.doherty@intel.com>; Trahe, Fiona
> <fiona.trahe@intel.com>
> Cc: dev@dpdk.org; Ryan, Brendan <brendan.ryan@intel.com>; O'loingsigh, Mairtin
> <mairtin.oloingsigh@intel.com>; De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>; Coyle, David
> <david.coyle@intel.com>
> Subject: [PATCH v1] crypto/qat: use better variable names in CRC functions
> 
> The variable names crc_length and crc_offset have been changed to
> crc_data_len and crc_data_ofs respectively, to make it clearer as to
> their use i.e. the length and offset of the data over which the CRC is
> calculated.
> 
> Fixes: 6f0ef237404b ("crypto/qat: support DOCSIS protocol")
> 
> Signed-off-by: David Coyle <david.coyle@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH v1] crypto/qat: use better variable names in CRC functions
  2020-07-17 18:21 ` Trahe, Fiona
@ 2020-07-18 21:33   ` Akhil Goyal
  0 siblings, 0 replies; 3+ messages in thread
From: Akhil Goyal @ 2020-07-18 21:33 UTC (permalink / raw)
  To: Trahe, Fiona, Coyle, David, Doherty, Declan
  Cc: dev, Ryan, Brendan, O'loingsigh, Mairtin, De Lara Guarch, Pablo

> > The variable names crc_length and crc_offset have been changed to
> > crc_data_len and crc_data_ofs respectively, to make it clearer as to
> > their use i.e. the length and offset of the data over which the CRC is
> > calculated.
> >
> > Fixes: 6f0ef237404b ("crypto/qat: support DOCSIS protocol")
> >
> > Signed-off-by: David Coyle <david.coyle@intel.com>
> Acked-by: Fiona Trahe <fiona.trahe@intel.com>

Applied to dpdk-next-crypto

Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-18 21:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-16 15:34 [dpdk-dev] [PATCH v1] crypto/qat: use better variable names in CRC functions David Coyle
2020-07-17 18:21 ` Trahe, Fiona
2020-07-18 21:33   ` Akhil Goyal

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git