Skip to contentSkip to conversation

crypto/qat: check for multi-segment buffers for DOCSIS

PATCH Applied David Coyle 3 participants 3 messages Jul 16, 2020 – Jul 18, 2020 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto/qat: check for multi-segment buffers for DOCSIS

Multi-segment mbufs are not supported for DOCSIS security protocol. This patch adds an explicit check for this and returns an op error if this case is found. This limitation is also added to the QAT cryptodev documentation.

Fixes 6f0ef237404b ("crypto/qat: support DOCSIS protocol")
---
 doc/guides/cryptodevs/qat.rst |  2 ++
 drivers/crypto/qat/qat_sym.c  | 12 +++++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)
doc/guides/cryptodevs/qat.rst +2 -0
index 931a18f9a..b9f8c37ea 100644
@@ -134,6 +134,8 @@ Limitations
   protocol.
 * ``RTE_CRYPTO_CIPHER_DES_DOCSISBPI`` is not supported for combined Crypto-CRC
   DOCSIS security protocol.
+* Multi-segment buffers are not supported for combined Crypto-CRC DOCSIS
+  security protocol.
 
 Extra notes on KASUMI F9
 ~~~~~~~~~~~~~~~~~~~~~~~~
drivers/crypto/qat/qat_sym.c +7 -5
index 6d568ab8f..632313a26 100644
@@ -284,13 +284,15 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
 			/* DOCSIS processing */
 #ifdef RTE_LIBRTE_SECURITY
 			if (is_docsis_sec) {
-				/* Check for OOP */
-				if (unlikely((op->sym->m_dst != NULL) &&
+				/* Check for OOP or multi-segment buffers */
+				if (unlikely(((op->sym->m_dst != NULL) &&
 						(op->sym->m_dst !=
-						op->sym->m_src))) {
+						op->sym->m_src)) ||
+						op->sym->m_src->nb_segs > 1)) {
 					QAT_DP_LOG(ERR,
-						"OOP not supported for DOCSIS "
-						"security");
+						"OOP and/or multi-segment "
+						"buffers are not supported for "
+						"DOCSIS security");
 					op->status =
 					RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
 					return -EINVAL;
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines

-----Original Message-----
From: Coyle, David <[email protected]>
Sent: Thursday, July 16, 2020 4:34 PM
To: [email protected]; Doherty, Declan <[email protected]>; Trahe, Fiona <[email protected]>
Cc: [email protected]; Ryan, Brendan <[email protected]>; O'loingsigh, Mairtin <[email protected]>; De Lara Guarch, Pablo <[email protected]>; Coyle, David <[email protected]>
Subject: [PATCH v1] crypto/qat: check for multi-segment buffers for DOCSIS

Quoted 8 lines

Multi-segment mbufs are not supported for DOCSIS security protocol. This patch adds an explicit check for this and returns an op error if this case is found. This limitation is also added to the QAT cryptodev documentation.

Fixes 6f0ef237404b ("crypto/qat: support DOCSIS protocol")
Applied
#2 lore raw
Quoted 9 lines
Quoted 8 lines

Multi-segment mbufs are not supported for DOCSIS security protocol. This patch adds an explicit check for this and returns an op error if this case is found. This limitation is also added to the QAT cryptodev documentation.

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

Applied to dpdk-next-crypto

Thanks.