Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp549577lqo; Fri, 10 May 2024 07:45:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWJQeAw/+cn2C8cP/SGjy/uZJbBZ/IoZKo9geELqaa7MO++rI1kcVdpBPC5KVf2JmRIiA2S+UvC9dwH6g0LTsDICCv1QT7Zferlk+ByuA== X-Google-Smtp-Source: AGHT+IEoev9k7E2f95KEjHczDfATfCHPFWxkuQepUs/QGkU87UUQDaeJEOXMqkLx+MV4hD4AUP7m X-Received: by 2002:a05:6a20:729b:b0:1ab:82fe:910b with SMTP id adf61e73a8af0-1afde1df2b3mr4177902637.58.1715352338653; Fri, 10 May 2024 07:45:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715352338; cv=pass; d=google.com; s=arc-20160816; b=hFq2uKuvX0iQt4mny4eUUVIvbj8ndDULJbhXSTMGLdgF0/eJ6vPFt3ikPZxbAzsMOx m3E1uX4scZ7Yz0cq8luLJrACC4Fk7cIYSHQZDUBmZHdfmp2d87+sm/q5+JXEt1CTeA7x 8wej5/EDUIJyCwCDuxbzmsbfCjZPtdGqqj/Xj+9TOp8aql2Zrp4vhwOiqkFR/Whu8iem ytco59nOYox4s48+uMEJExvUY36IPX68Fqz4GQ4gGbvwFCuOi6CWMzJqxwK253oWdaxF pZ7UOn6yPDTI8lD3yygKdqE6bnmNjPPIOFVAQsoZrae9L6qrZTzx0owvrQ+Q9PcDVzkK Yjcg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=/dL+EFao1GIMz2NCmP7E3nZ2w/VHD54VyITVfVpksxo=; fh=UdkG4AweFH2yMGehrLnMHjSuotyR7wxkgnI3aeQb9V4=; b=Ny4stCsQYI680GT75mQ0ATg6J0zP55v0gYI0xbgjL3VIfE4HNEjjAyXHVzlgWiL803 5zWXjbtbZob/HSAuUv98xWFrz+qlWJyhnzh/SekhsHyd984Hk7gdMnXx4rRgPl2bUIzM aYKkN7HNPFZv9j+UzlsFairhbFt8APAr4ouALUdurf8BekLo4576MicSUjd/qQFi+RQc kZnbaC2pC14pR4GWo0oyn/GsLiiroD7J7aoEo6pl7vk4eLkbMDqY+7iagF78GJM160pu jQ6Ely6LyJ+hTKIjbp00GNvvjk81ETD/cQ2c2sIHNmIdQ2HtMm+2+TbozPrb0z5aU2Px vi8A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=f2mWsqVC; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-crypto+bounces-4117-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4117-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f4d2a96d5csi3749489b3a.118.2024.05.10.07.45.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 07:45:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4117-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=f2mWsqVC; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-crypto+bounces-4117-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4117-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id DEC262831B8 for ; Fri, 10 May 2024 14:45:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D0FD7168AFC; Fri, 10 May 2024 14:45:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="f2mWsqVC" X-Original-To: linux-crypto@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9672212C539 for ; Fri, 10 May 2024 14:44:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715352301; cv=none; b=QKPlrTE5miN4vyotEN+ZEZrQxBcCT609x+IkYyZoGpr7/sszHxKJ9sHhUv0DAToQJfDYbxQJMm93Wzwu13nKUMwpNNa5R9KfC8ikymQpGUcENG/vX9LwNBgcsFwS315ynkEgp1yUYTFNzKyEDNxbe/wKMZNnPb+45ROGZskXYNE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715352301; c=relaxed/simple; bh=0uo2J02qIGGU5nGLsi3zRsVi58wep11XymEUFmga7nQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=fKjNxKsoXFmDxuKXordUFfRrZp/iQIgW3CDQovpXST1yY5Fmuc1h4yadIsFKyKk9x/qyjvwDYAFQQC9C63ohS8+vSQDbomEp36GUUbe0bqTeYf0uudxFHtp1CWssyDSg27e1dMWaJxHx+FyxDwA7ZdSlk9HRVXTCXlbtmHNNaWk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=f2mWsqVC; arc=none smtp.client-ip=198.175.65.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715352300; x=1746888300; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=0uo2J02qIGGU5nGLsi3zRsVi58wep11XymEUFmga7nQ=; b=f2mWsqVC+bM51A8MSXOOvSJrZ9IurddG3ddXHIxtL4qO3cN3cch06dcd bTHcxpSXhkLLXm4XiVIqGY12caO9YMvfpIJPcQ857qtQeQ+AsCvuGcx8l VcyiPOOb1Fsdx0WueMf0dzgOeAGu/AeEOLQBrB8yWSeRo1jW8r4V7exhg YvnNeYmjK4j3SzjdCKwOnFa4jveEbHRAMfkMHpN+NK5Lg/vEpsWW664Pw C0UofZFeVnqyAy4WMsAuc02/Qd2ZwxSU4ZPTS0o+4AAxuulzU2uuxmS18 Ye0TQFeXDSOdMJJ02omC3yCgZclYpgaxsrWVYGJJMuRY0hZlwAbC4qDqg g==; X-CSE-ConnectionGUID: FtCenkYlTgSi3w1pMQY8jw== X-CSE-MsgGUID: AmwLPNAHQdaf+K6aBP/AjA== X-IronPort-AV: E=McAfee;i="6600,9927,11068"; a="11268207" X-IronPort-AV: E=Sophos;i="6.08,151,1712646000"; d="scan'208";a="11268207" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2024 07:44:57 -0700 X-CSE-ConnectionGUID: 9q/3B8iSTXu2Vac4O5FGgg== X-CSE-MsgGUID: w238oIl7ShiXg8PrMwOKtQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,151,1712646000"; d="scan'208";a="60486871" Received: from unknown (HELO localhost.igk.intel.com) ([10.211.127.84]) by orviesa002.jf.intel.com with ESMTP; 10 May 2024 07:44:56 -0700 From: Sergey Portnoy To: herbert@gondor.apana.org.au Cc: linux-crypto@vger.kernel.org, qat-linux@intel.com Subject: [PATCH v2] crypto: tcrypt - add skcipher speed for given alg Date: Fri, 10 May 2024 16:33:15 +0100 Message-ID: <20240510154405.664598-1-sergey.portnoy@intel.com> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Allow to run skcipher speed for given algorithm. Two separate cases are added to cover ENCRYPT and DECRYPT directions. Example: modprobe tcrypt mode=611 alg="qat_aes_xts" klen=32 If succeed, the performance numbers will be printed in dmesg: testing speed of multibuffer qat_aes_xts (qat_aes_xts) encryption test 0 (256 bit key, 16 byte blocks): 1 operation in 14596 cycles (16 bytes) ... test 6 (256 bit key, 4096 byte blocks): 1 operation in 8053 cycles (4096 bytes) Signed-off-by: Sergey Portnoy --- v1 -> v2 - speed_template is moved to be on-stack and type was corrected to u8 crypto/tcrypt.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index 8aea416f6480..ffd94a0972ca 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c @@ -1454,6 +1454,8 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb) int i; int ret = 0; + u8 speed_template[2] = {klen, 0}; + switch (m) { case 0: if (alg) { @@ -2807,6 +2809,16 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb) speed_template_16_32, num_mb); break; + case 611: + if (alg) + test_mb_skcipher_speed(alg, ENCRYPT, sec, NULL, 0, + speed_template, num_mb); + break; + case 612: + if (alg) + test_mb_skcipher_speed(alg, DECRYPT, sec, NULL, 0, + speed_template, num_mb); + break; } return ret; -- 2.44.0