From patchwork Sat Jun 30 00:01:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10497761 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5F4B7602CC for ; Sat, 30 Jun 2018 00:05:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E918295F5 for ; Sat, 30 Jun 2018 00:05:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 52C3F296A9; Sat, 30 Jun 2018 00:05:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 08CF2295F5 for ; Sat, 30 Jun 2018 00:05:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936859AbeF3AFG (ORCPT ); Fri, 29 Jun 2018 20:05:06 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:35740 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932449AbeF3AFF (ORCPT ); Fri, 29 Jun 2018 20:05:05 -0400 Received: by mail-pl0-f66.google.com with SMTP id k1-v6so5176733plt.2 for ; Fri, 29 Jun 2018 17:05:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vi+hvha4P1bNF3ubT4vNHJh8nqmKF8fgTaN16PL0rmQ=; b=W+TPFVBEQRk5q9Cz+T9+AIGtxUoPjSDVMGt0vwkhid97Gnjo5mzZ1mobIp511sD9Zr LggzrDZgNLldtfdeMAzkmM7jtRDfIdiDwAeWKqoKc5Wp2XBR1x4HghDJxeBJLgWwyTw1 5Yo8I1OKUVGaoNZJRRryjf3os6MFYTekow7OGgS1ozUv+HfFP1ZkdGhQqtYvTPLYK77H UNaz3r4b2bgqArmOgQTpjxzDM+gSmuoQcshVxqrSChBhd62hXmnOYsXsX+2G8oJeCYag l69A6Gysut2aqXIfMN1LCQ4wu+Ue02mqYle4BrzrsxLKWvr/hMcIv/o0TbeaQTKiCFIb 0L6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vi+hvha4P1bNF3ubT4vNHJh8nqmKF8fgTaN16PL0rmQ=; b=LjXg873wWCrF1K4E8n+4vKZcbHH1Q3lTRSvW/r3Rc0WtPDaUvUO4llMWopyiMYwa2H UsoqRVw2swQdKyxIPw4JI8qgeUUqbe78tMPgKwylZZRDyx6zwawRjMzAwppPCTdWgBFT CSdYbKtGpqmulvqcsykTPWrWw0eL5oN16jenj5Je0Ce1hVn+1ERag7exAZQWbPUaT5JV +ZoPeNNwoV1RCOkAQ6VRfCLE//cJBvXQOBahApMHx4UUTJYskmjY7mg0cZHzKujmlvMX kDO206SJyknEXHyLrkhhKzWf4d8SJMKYwP9sdKZEiKx53Px68pSLPmd2YNl5r6RIZpNW CDnQ== X-Gm-Message-State: APt69E13Xbq3/VTHotbWMYRTw3Vh457UUUVEwWsngS6+HDdtWiCGGd7f hTf90D/4N552RuLGfUGZKtHeOd72 X-Google-Smtp-Source: ADUXVKIIRQR0DE+X+JToWAk/1Wfaany4NgYEztPlXbMyDp77FbWCCcCE2I4+c3EoyJzDEbtakRpRow== X-Received: by 2002:a17:902:1007:: with SMTP id b7-v6mr16652549pla.277.1530317104618; Fri, 29 Jun 2018 17:05:04 -0700 (PDT) Received: from ebiggers-linuxstation.kir.corp.google.com ([2620:15c:17:3:dc28:5c82:b905:e8a8]) by smtp.gmail.com with ESMTPSA id j13-v6sm16335788pgq.73.2018.06.29.17.05.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Jun 2018 17:05:04 -0700 (PDT) From: Eric Biggers To: linux-crypto@vger.kernel.org, Herbert Xu Cc: Megha Dey , Tim Chen , Eric Biggers Subject: [PATCH 2/4] crypto: sha256_generic - add cra_priority Date: Fri, 29 Jun 2018 17:01:42 -0700 Message-Id: <20180630000144.62230-3-ebiggers3@gmail.com> X-Mailer: git-send-email 2.18.0.399.gad0ab374a1-goog In-Reply-To: <20180630000144.62230-1-ebiggers3@gmail.com> References: <20180630000144.62230-1-ebiggers3@gmail.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Biggers sha256-generic and sha224-generic had a cra_priority of 0, so it wasn't possible to have a lower priority SHA-256 or SHA-224 implementation, as is desired for sha256_mb which is only useful under certain workloads and is otherwise extremely slow. Change them to priority 100, which is the priority used for many of the other generic algorithms. Signed-off-by: Eric Biggers --- crypto/sha256_generic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crypto/sha256_generic.c b/crypto/sha256_generic.c index 8f9c47e1a96e..dfcb7beb73a7 100644 --- a/crypto/sha256_generic.c +++ b/crypto/sha256_generic.c @@ -271,6 +271,7 @@ static struct shash_alg sha256_algs[2] = { { .base = { .cra_name = "sha256", .cra_driver_name= "sha256-generic", + .cra_priority = 100, .cra_flags = CRYPTO_ALG_TYPE_SHASH, .cra_blocksize = SHA256_BLOCK_SIZE, .cra_module = THIS_MODULE, @@ -285,6 +286,7 @@ static struct shash_alg sha256_algs[2] = { { .base = { .cra_name = "sha224", .cra_driver_name= "sha224-generic", + .cra_priority = 100, .cra_flags = CRYPTO_ALG_TYPE_SHASH, .cra_blocksize = SHA224_BLOCK_SIZE, .cra_module = THIS_MODULE,