From patchwork Wed Jun 21 07:47:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "De Lara Guarch, Pablo" X-Patchwork-Id: 25583 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 382AE7D02; Wed, 21 Jun 2017 17:47:34 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 94F127CC4; Wed, 21 Jun 2017 17:47:20 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jun 2017 08:47:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,369,1493708400"; d="scan'208";a="100153477" Received: from silpixa00399464.ir.intel.com (HELO silpixa00399464.ger.corp.intel.com) ([10.237.222.157]) by orsmga004.jf.intel.com with ESMTP; 21 Jun 2017 08:47:19 -0700 From: Pablo de Lara To: pablo.de.lara.guarch@intel.com Cc: dev@dpdk.org, stable@dpdk.org Date: Wed, 21 Jun 2017 08:47:15 +0100 Message-Id: <20170621074731.45013-6-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170621074731.45013-1-pablo.de.lara.guarch@intel.com> References: <20170621074731.45013-1-pablo.de.lara.guarch@intel.com> Subject: [dpdk-dev] [PATCH 06/22] crypto/qat: fix auth parameters for KASUMI 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" QAT PMD was assuming that cipher IV was always prepended, before the input buffer, but it is not necessary to have it there, only the auth IV and the input buffer needs to be contiguous. It was also assuming that the IV was starting at offset 0, which is not always the case. Fixes: d4f2745300e0 ("crypto/qat: add KASUMI") CC: stable@dpdk.org Signed-off-by: Pablo de Lara --- drivers/crypto/qat/qat_crypto.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/crypto/qat/qat_crypto.c b/drivers/crypto/qat/qat_crypto.c index 3bf3133..345fcb9 100644 --- a/drivers/crypto/qat/qat_crypto.c +++ b/drivers/crypto/qat/qat_crypto.c @@ -1011,14 +1011,9 @@ qat_write_hw_desc_entry(struct rte_crypto_op *op, uint8_t *out_msg, if (ctx->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_KASUMI_F9) { - if (do_cipher) { - auth_len = auth_len + auth_ofs + 1 - - ICP_QAT_HW_KASUMI_BLK_SZ; - auth_ofs = ICP_QAT_HW_KASUMI_BLK_SZ; - } else { - auth_len = auth_len + auth_ofs + 1; - auth_ofs = 0; - } + /* Auth IV and message is contiguous + direction bit */ + auth_len = auth_len + ICP_QAT_HW_KASUMI_BLK_SZ + 1; + auth_ofs -= ICP_QAT_HW_KASUMI_BLK_SZ; } } else if (ctx->qat_hash_alg ==