From nobody Mon Feb 9 05:43:40 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (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 4FC87225775; Sun, 25 Jan 2026 03:36:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.10 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769312162; cv=none; b=LUlw4nTqDAp9DIgBsCrUwhNarZpYljF2r85rquFhH1VBNaS8Vpq23iWXuhztGAqK17aWZ3B6/ukkevNAR8uNfxPH8FTa+nHJ/k11PvNm0ja/iJmJGFBCzmHKPo1Z9/htLVgFueOKT7T1Y9BWu6+bwTRgMS+8f2N5Y1wq1t/lXCY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769312162; c=relaxed/simple; bh=iZsxDdWF2NK1BJ57K8D8/hdtu1PFMhaa5X62fuQilRE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HWrLqPfGLTr2sb2dtWfk6bzOyg0tuVwkZDxuDSaKKUyQRxcWcpOC1smTJNlRHn7S1cj6XMCRhBeqtv7hFTjtUuiROpWms6tp+6AUH+vY9iaJLDuAdWHXjrp510c8JBTgHrT7GZKJIQuEd3FFmePBVDzB8NxhVfPZCQPYxSdN+0Q= 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=FGoHm3Oo; arc=none smtp.client-ip=192.198.163.10 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="FGoHm3Oo" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1769312160; x=1800848160; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=iZsxDdWF2NK1BJ57K8D8/hdtu1PFMhaa5X62fuQilRE=; b=FGoHm3Ooi0NRq8n8iCVZjhL3QV/bBcp+KVFX/QHteNYgA/0T0BvPqGHn x+X3SqMkg8rDTTF4g1YPtwVBmDGCOmk6EMeuJITc4p3mkXb+jqUT95ikO +ycX+W239a425Zk+SPNNCkW/Amdjuun/nyFlpoj5sNhtxwxy1dlJmzmOr mN3feRFs1Zxm1Pqt8MHg1+OPkCzsPNoD8HxP7frOT/ZGsdw6nOD/IlU6P BRbjMOfMMffaqLBFVmLdQI8ndtB7qIistGhy+V74ok9J7HRYfRalsxlQ8 h1mWHyMg5z8ptOg3FA86ffqXoPDgIRk7n6dy/lpsln/YgtZWqSU6TUdP1 g==; X-CSE-ConnectionGUID: MAKzrqLCR6G/Pc9n0IRoGw== X-CSE-MsgGUID: Srf1hU5VTd+bG7iK6yaMFw== X-IronPort-AV: E=McAfee;i="6800,10657,11681"; a="81887510" X-IronPort-AV: E=Sophos;i="6.21,252,1763452800"; d="scan'208";a="81887510" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2026 19:35:59 -0800 X-CSE-ConnectionGUID: mHNlEFcuSZ6CiJ6gsuZB5A== X-CSE-MsgGUID: TOHf7fr5QoqJz3LbsQFzlw== X-ExtLoop1: 1 Received: from jf5300-b11a338t.jf.intel.com ([10.242.51.115]) by fmviesa003.fm.intel.com with ESMTP; 24 Jan 2026 19:35:58 -0800 From: Kanchana P Sridhar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, hannes@cmpxchg.org, yosry.ahmed@linux.dev, nphamcs@gmail.com, chengming.zhou@linux.dev, usamaarif642@gmail.com, ryan.roberts@arm.com, 21cnbao@gmail.com, ying.huang@linux.alibaba.com, akpm@linux-foundation.org, senozhatsky@chromium.org, sj@kernel.org, kasong@tencent.com, linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au, davem@davemloft.net, clabbe@baylibre.com, ardb@kernel.org, ebiggers@google.com, surenb@google.com, kristen.c.accardi@intel.com, vinicius.gomes@intel.com, giovanni.cabiddu@intel.com Cc: wajdi.k.feghali@intel.com, kanchana.p.sridhar@intel.com Subject: [PATCH v14 14/26] crypto: acomp - Add bit to indicate segmentation support Date: Sat, 24 Jan 2026 19:35:25 -0800 Message-Id: <20260125033537.334628-15-kanchana.p.sridhar@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20260125033537.334628-1-kanchana.p.sridhar@intel.com> References: <20260125033537.334628-1-kanchana.p.sridhar@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This patch adds segmentation support for compression. Add a bit to the crypto_alg flags to indicate support for segmentation. Also add a helper for acomp to test whether a given tfm supports segmentation. Signed-off-by: Herbert Xu --- include/crypto/algapi.h | 5 +++++ include/crypto/internal/acompress.h | 5 +++++ include/linux/crypto.h | 3 +++ 3 files changed, 13 insertions(+) diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h index 05deea9dac5e..7d406cfe5751 100644 --- a/include/crypto/algapi.h +++ b/include/crypto/algapi.h @@ -280,6 +280,11 @@ static inline bool crypto_tfm_req_virt(struct crypto_t= fm *tfm) return tfm->__crt_alg->cra_flags & CRYPTO_ALG_REQ_VIRT; } =20 +static inline bool crypto_tfm_req_seg(struct crypto_tfm *tfm) +{ + return tfm->__crt_alg->cra_flags & CRYPTO_ALG_REQ_SEG; +} + static inline u32 crypto_request_flags(struct crypto_async_request *req) { return req->flags & ~CRYPTO_TFM_REQ_ON_STACK; diff --git a/include/crypto/internal/acompress.h b/include/crypto/internal/= acompress.h index 2d97440028ff..366dbdb987e8 100644 --- a/include/crypto/internal/acompress.h +++ b/include/crypto/internal/acompress.h @@ -188,6 +188,11 @@ static inline bool crypto_acomp_req_virt(struct crypto= _acomp *tfm) return crypto_tfm_req_virt(&tfm->base); } =20 +static inline bool crypto_acomp_req_seg(struct crypto_acomp *tfm) +{ + return crypto_tfm_req_seg(&tfm->base); +} + void crypto_acomp_free_streams(struct crypto_acomp_streams *s); int crypto_acomp_alloc_streams(struct crypto_acomp_streams *s); =20 diff --git a/include/linux/crypto.h b/include/linux/crypto.h index a2137e19be7d..89b9c3f87f4d 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h @@ -139,6 +139,9 @@ /* Set if the algorithm cannot have a fallback (e.g., phmac). */ #define CRYPTO_ALG_NO_FALLBACK 0x00080000 =20 +/* Set if the algorithm supports segmentation. */ +#define CRYPTO_ALG_REQ_SEG 0x00100000 + /* The high bits 0xff000000 are reserved for type-specific flags. */ =20 /* --=20 2.27.0