From patchwork Thu Jul 16 15:33:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Coyle, David" X-Patchwork-Id: 74263 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 27FB7A0546; Thu, 16 Jul 2020 17:57:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 06F294F9A; Thu, 16 Jul 2020 17:57:44 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id EDCEF3B5 for ; Thu, 16 Jul 2020 17:57:41 +0200 (CEST) IronPort-SDR: nKrtVcmE0T9F+qDnbOW0TEv5X/pPKyNKN/Pa6DRIJPNa7h9mjSNa92EJLCYvBwtcHWCfwuvpBE HTTFxj1tvGFw== X-IronPort-AV: E=McAfee;i="6000,8403,9684"; a="147404472" X-IronPort-AV: E=Sophos;i="5.75,359,1589266800"; d="scan'208";a="147404472" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2020 08:57:41 -0700 IronPort-SDR: DgJN3SiL6lfIcxWDVWWiB26beejqOucUst13zTSww3RM2EgmHN7iKSoM8YglV69Z9edjrql0as zR4wreKxOVzQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,359,1589266800"; d="scan'208";a="486151336" Received: from silpixa00399912.ir.intel.com (HELO silpixa00399912.ger.corp.intel.com) ([10.237.223.64]) by fmsmga006.fm.intel.com with ESMTP; 16 Jul 2020 08:57:39 -0700 From: David Coyle To: akhil.goyal@nxp.com, declan.doherty@intel.com, fiona.trahe@intel.com Cc: dev@dpdk.org, brendan.ryan@intel.com, mairtin.oloingsigh@intel.com, pablo.de.lara.guarch@intel.com, David Coyle Date: Thu, 16 Jul 2020 16:33:31 +0100 Message-Id: <20200716153331.65689-1-david.coyle@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH v1] crypto/qat: check for multi-segment buffers for DOCSIS X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Acked-by: Fiona Trahe --- 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;