From patchwork Mon Sep 21 13:13:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Senozhatsky X-Patchwork-Id: 7230151 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 129519F30C for ; Mon, 21 Sep 2015 13:17:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4BD9820711 for ; Mon, 21 Sep 2015 13:17:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5CB2420718 for ; Mon, 21 Sep 2015 13:17:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932327AbbIUNPN (ORCPT ); Mon, 21 Sep 2015 09:15:13 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:33316 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932266AbbIUNPK (ORCPT ); Mon, 21 Sep 2015 09:15:10 -0400 Received: by pacex6 with SMTP id ex6so116762837pac.0; Mon, 21 Sep 2015 06:15:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=E73C2LK1VjiK5bU37kn8qMhrdcbgMzQjxPFhJW3ULR4=; b=xLFvO4zSIUqJise9R0FuwlHgdDldqrqNxN9jwJ+wLTAeao7qh+T8pgm7N6VXdcFdyL fmjx8SlwCwdkI5FMXze6rRq4YaiORmBG6kJt4FZ1NxrGMvI/JHPszfdoyLx6aHZsfPSN OV39m5yPVUYJJvxZ77Oi0lQitNVwRjdMLchAjvd08vf42i26H8UITTcIXn20JnH5/HNJ FUawUBcH/T41QG6XjKAfANeP8lIEWMyCcsvShfUFx173h6PjxPkxicErJGHLfbWhLEHw 5zJz2DSztgIFia4aGCsy5otlYfi18uSHUDjYHhXcxlizrMgfcI+9rc+hlnlsWhUDgpPD 2a9A== X-Received: by 10.69.12.162 with SMTP id er2mr25290031pbd.24.1442841310072; Mon, 21 Sep 2015 06:15:10 -0700 (PDT) Received: from swordfish.localdomain ([112.168.75.135]) by smtp.gmail.com with ESMTPSA id c16sm24589770pbu.37.2015.09.21.06.15.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Sep 2015 06:15:09 -0700 (PDT) From: Sergey Senozhatsky To: Joonsoo Kim Cc: Andrew Morton , Minchan Kim , Herbert Xu , "David S. Miller" , Stephan Mueller , Joonsoo Kim , Sergey Senozhatsky , Sergey Senozhatsky , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC][PATCH 1/9] crypto: introduce CRYPTO_ALG_TFM_MAY_SHARE flag Date: Mon, 21 Sep 2015 22:13:41 +0900 Message-Id: <1442841229-8122-2-git-send-email-sergey.senozhatsky@gmail.com> X-Mailer: git-send-email 2.5.3 In-Reply-To: <1442841229-8122-1-git-send-email-sergey.senozhatsky@gmail.com> References: <1442553564-3476-1-git-send-email-iamjoonsoo.kim@lge.com> <1442841229-8122-1-git-send-email-sergey.senozhatsky@gmail.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Set CRYPTO_ALG_TFM_MAY_SHARE ->cra_flags when algorithm support shared tfm. Signed-off-by: Sergey Senozhatsky --- include/linux/crypto.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/crypto.h b/include/linux/crypto.h index e71cb70..66f10f8 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h @@ -102,6 +102,11 @@ #define CRYPTO_ALG_INTERNAL 0x00002000 /* + * Mark that algorithm can use shared tfm + */ +#define CRYPTO_ALG_TFM_MAY_SHARE 0x00004000 + +/* * Transform masks and values (for crt_flags). */ #define CRYPTO_TFM_REQ_MASK 0x000fff00 @@ -648,6 +653,11 @@ static inline u32 crypto_tfm_alg_type(struct crypto_tfm *tfm) return tfm->__crt_alg->cra_flags & CRYPTO_ALG_TYPE_MASK; } +static inline u32 crypto_tfm_may_share(struct crypto_tfm *tfm) +{ + return tfm->__crt_alg->cra_flags & CRYPTO_ALG_TFM_MAY_SHARE; +} + static inline unsigned int crypto_tfm_alg_blocksize(struct crypto_tfm *tfm) { return tfm->__crt_alg->cra_blocksize;