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

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")

Signed-off-by: David Coyle <david.coyle@intel.com>
---
 doc/guides/cryptodevs/qat.rst |  2 ++
 drivers/crypto/qat/qat_sym.c  | 12 +++++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/doc/guides/cryptodevs/qat.rst b/doc/guides/cryptodevs/qat.rst
index 931a18f9a..b9f8c37ea 100644
--- a/doc/guides/cryptodevs/qat.rst
+++ b/doc/guides/cryptodevs/qat.rst
@@ -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
 ~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c
index 6d568ab8f..632313a26 100644
--- a/drivers/crypto/qat/qat_sym.c
+++ b/drivers/crypto/qat/qat_sym.c
@@ -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;
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH v1] crypto/qat: check for multi-segment buffers for DOCSIS
  2020-07-16 15:33 [dpdk-dev] [PATCH v1] crypto/qat: check for multi-segment buffers for DOCSIS David Coyle
@ 2020-07-17 18:25 ` Trahe, Fiona
  2020-07-18 21:29   ` Akhil Goyal
  0 siblings, 1 reply; 3+ messages in thread
From: Trahe, Fiona @ 2020-07-17 18:25 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:34 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: 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")
> 
> 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: check for multi-segment buffers for DOCSIS
  2020-07-17 18:25 ` Trahe, Fiona
@ 2020-07-18 21:29   ` Akhil Goyal
  0 siblings, 0 replies; 3+ messages in thread
From: Akhil Goyal @ 2020-07-18 21:29 UTC (permalink / raw)
  To: Trahe, Fiona, Coyle, David, Doherty, Declan
  Cc: dev, Ryan, Brendan, O'loingsigh, Mairtin, De Lara Guarch, Pablo

> > 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")
> >
> > 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:29 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:33 [dpdk-dev] [PATCH v1] crypto/qat: check for multi-segment buffers for DOCSIS David Coyle
2020-07-17 18:25 ` Trahe, Fiona
2020-07-18 21:29   ` 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