From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AA5A1A00C4; Wed, 21 Sep 2022 14:50:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2B8F7410EE; Wed, 21 Sep 2022 14:50:45 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 517364014F for ; Wed, 21 Sep 2022 14:50:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663764643; x=1695300643; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MC25vNrzBlzB8LIj+CgQgMCKW3bcJ2nVkbRSjby+BMg=; b=KwGhMjt0w9K0fHSxSViP+49kJrGLQejNWIbGCjMwhwZfI/bc3zSJ/BY8 J3svMajIDcUhbRclWXbegA2L/pkp//IEfDNLuo8D1CvIsDAqHwSFwBcBS nRY9tiCBDr2Gl3sTNj+R3apqF4xBE/mIb4jRjvWkBcZCLfDWqSZenRZdR GuMljh9NGDgJCwAc/oyQyj6u99Nsz2f6Q3OBtnHrGU1acg0RzocjsgjlB yruniDMWlHA/JtcusmC2nh1kLM4FTQLuC97lnhnlOSILlTOuD6JIGXo4c hbPB7CdXfEAPjlkE1GYnxmH3kK1qGGLOJPdIePDbcwmRqwvpJlhyvYuFr Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10477"; a="287064397" X-IronPort-AV: E=Sophos;i="5.93,333,1654585200"; d="scan'208";a="287064397" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2022 05:50:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,333,1654585200"; d="scan'208";a="619335515" Received: from silpixa00400355.ir.intel.com (HELO silpixa00400355.ger.corp.intel.com) ([10.237.222.163]) by orsmga002.jf.intel.com with ESMTP; 21 Sep 2022 05:50:41 -0700 From: Ciara Power To: Akhil Goyal , Fan Zhang Cc: dev@dpdk.org, kai.ji@intel.com, pablo.de.lara.guarch@intel.com, Ciara Power Subject: [PATCH v3 1/5] test/crypto: fix wireless auth digest segment Date: Wed, 21 Sep 2022 12:50:32 +0000 Message-Id: <20220921125036.9104-2-ciara.power@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220921125036.9104-1-ciara.power@intel.com> References: <20220812132334.75707-1-ciara.power@intel.com> <20220921125036.9104-1-ciara.power@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The segment size for some tests was too small to hold the auth digest. This caused issues when using op->sym->auth.digest.data for comparisons in AESNI_MB PMD after a subsequent patch enables SGL. For example, if segment size is 2, and digest size is 4, then 4 bytes are read from op->sym->auth.digest.data, which overflows into the memory after the segment, rather than using the second segment that contains the remaining half of the digest. Fixes: 11c5485bb276 ("test/crypto: add scatter-gather tests for IP and OOP") Signed-off-by: Ciara Power --- app/test/test_cryptodev.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 6ee4480399..5533c135b0 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -3040,6 +3040,14 @@ create_wireless_algo_auth_cipher_operation( remaining_off -= rte_pktmbuf_data_len(sgl_buf); sgl_buf = sgl_buf->next; } + + /* The last segment should be large enough to hold full digest */ + if (sgl_buf->data_len < auth_tag_len) { + rte_pktmbuf_free(sgl_buf->next); + sgl_buf->next = NULL; + rte_pktmbuf_append(sgl_buf, auth_tag_len - sgl_buf->data_len); + } + sym_op->auth.digest.data = rte_pktmbuf_mtod_offset(sgl_buf, uint8_t *, remaining_off); sym_op->auth.digest.phys_addr = rte_pktmbuf_iova_offset(sgl_buf, -- 2.25.1