Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1300492 > unrolled thread

[PATCH RFC 0/7] Introduce new async/sync compression APIs

Started byJoonsoo Kim <js1304@gmail.com>
First post2016-01-04 05:50 +0100
Last post2016-01-13 09:30 +0100
Articles 6 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH RFC 0/7] Introduce new async/sync compression APIs Joonsoo Kim <js1304@gmail.com> - 2016-01-04 05:50 +0100
    [PATCH RFC 6/7] crypto/compress: add algorithm type specific flag, DECOMP_NOCTX Joonsoo Kim <js1304@gmail.com> - 2016-01-04 05:50 +0100
    Re: [PATCH RFC 0/7] Introduce new async/sync compression APIs "Li, Weigang" <weigang.li@intel.com> - 2016-01-12 09:10 +0100
      Re: [PATCH RFC 0/7] Introduce new async/sync compression APIs Herbert Xu <herbert@gondor.apana.org.au> - 2016-01-12 13:50 +0100
        Re: [PATCH RFC 0/7] Introduce new async/sync compression APIs Herbert Xu <herbert@gondor.apana.org.au> - 2016-01-13 09:30 +0100
        Re: [PATCH RFC 0/7] Introduce new async/sync compression APIs Joonsoo Kim <iamjoonsoo.kim@lge.com> - 2016-01-13 09:30 +0100

#1300492 — [PATCH RFC 0/7] Introduce new async/sync compression APIs

FromJoonsoo Kim <js1304@gmail.com>
Date2016-01-04 05:50 +0100
Subject[PATCH RFC 0/7] Introduce new async/sync compression APIs
Message-ID<qN5fH-6LH-7@gated-at.bofh.it>
Happy New Year!

This patchset is to introduce new compression APIs. It supports async/sync
compression although there is no async compression driver yet. But, async
APIs can be used as front-end to sync compression algorithm. Major change
is that now APIs are stateless. Instead of previous implementation, tfm
objects doesn't embedded any context so we can de/compress concurrently
with one tfm object. Instead, this de/compression context is coupled with
the request. This architecture change will make APIs more flexible.

This is just a RFC so commit description isn't sufficient. If Herbert
confirms that this is what he expect, I will respin the series with proper
commit description and adding more algorithm support.

Thanks.

Joonsoo Kim (6):
  crypto/compress: remove unused pcomp interface
  crypto/compress: introduce sychronuous compression API
  crypto/lzo: support SCOMPRESS alg type
  crypto: testmgr: add scompress/acompress test
  crypto/compress: add algorithm type specific flag, DECOMP_NOCTX
  crypto/lzo: add CRYPTO_ALG_SCOMPRESS_DECOMP_NOCTX cra_flags

Weigang Li (1):
  crypto: add asynchronous compression support

 crypto/Kconfig                     |  19 +-
 crypto/Makefile                    |   4 +-
 crypto/acompress.c                 | 164 ++++++++++++++++
 crypto/lzo.c                       |  95 +++++++--
 crypto/pcompress.c                 | 115 -----------
 crypto/scompress.c                 | 283 +++++++++++++++++++++++++++
 crypto/testmgr.c                   | 376 +++++++++++++++---------------------
 crypto/testmgr.h                   | 142 --------------
 crypto/zlib.c                      | 381 -------------------------------------
 include/crypto/compress.h          | 354 +++++++++++++++++++++++++---------
 include/crypto/internal/compress.h |  32 +---
 include/linux/crypto.h             |  10 +-
 12 files changed, 969 insertions(+), 1006 deletions(-)
 create mode 100644 crypto/acompress.c
 delete mode 100644 crypto/pcompress.c
 create mode 100644 crypto/scompress.c
 delete mode 100644 crypto/zlib.c

-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1300493 — [PATCH RFC 6/7] crypto/compress: add algorithm type specific flag, DECOMP_NOCTX

FromJoonsoo Kim <js1304@gmail.com>
Date2016-01-04 05:50 +0100
Subject[PATCH RFC 6/7] crypto/compress: add algorithm type specific flag, DECOMP_NOCTX
Message-ID<qN5fI-6LH-21@gated-at.bofh.it>
In reply to#1300492
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
---
 crypto/testmgr.c          | 2 ++
 include/crypto/compress.h | 8 ++++++++
 include/linux/crypto.h    | 6 ++++++
 3 files changed, 16 insertions(+)

diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index bd0c639..acd7428 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -1289,6 +1289,8 @@ static int test_comp(struct crypto_tfm *tfm, void *ctx, int type,
 			break;
 
 		case 1:
+			if (crypto_scomp_decomp_noctx(crypto_scomp_cast(tfm)))
+				ctx = NULL;
 			ret = crypto_scomp_decompress(crypto_scomp_cast(tfm),
 						dtemplate[i].input, ilen,
 						result, &dlen, ctx);
diff --git a/include/crypto/compress.h b/include/crypto/compress.h
index f1e91c5..21c698e 100644
--- a/include/crypto/compress.h
+++ b/include/crypto/compress.h
@@ -2,6 +2,8 @@
 #define _CRYPTO_COMPRESS_H
 #include <linux/crypto.h>
 
+#define CRYPTO_ALG_SCOMPRESS_DECOMP_NOCTX CRYPTO_ALG_PRIVATE
+
 struct crypto_scomp {
 	struct crypto_tfm base;
 };
@@ -71,6 +73,12 @@ static inline int crypto_scomp_decompress(struct crypto_scomp *tfm,
 						dst, dlen, ctx);
 }
 
+static inline bool crypto_scomp_decomp_noctx(struct crypto_scomp *tfm)
+{
+	return crypto_scomp_tfm(tfm)->__crt_alg->cra_flags &
+			CRYPTO_ALG_SCOMPRESS_DECOMP_NOCTX;
+}
+
 extern int crypto_register_scomp(struct scomp_alg *alg);
 extern int crypto_unregister_scomp(struct scomp_alg *alg);
 
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 86baa61..a8a522c 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -104,6 +104,12 @@
 #define CRYPTO_ALG_INTERNAL		0x00002000
 
 /*
+ * Use this flag as type specific one. For example, it would be used
+ * to check if context is needed or not in CRYPTO_ALG_TYPE_SCOMPRESS.
+ */
+#define CRYPTO_ALG_PRIVATE		0x00004000
+
+/*
  * Transform masks and values (for crt_flags).
  */
 #define CRYPTO_TFM_REQ_MASK		0x000fff00
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1307073

From"Li, Weigang" <weigang.li@intel.com>
Date2016-01-12 09:10 +0100
Message-ID<qQ2bE-6zh-21@gated-at.bofh.it>
In reply to#1300492
On 1/4/2016 12:46 PM, Joonsoo Kim wrote:
> Happy New Year!
>
> This patchset is to introduce new compression APIs. It supports async/sync
> compression although there is no async compression driver yet. But, async
> APIs can be used as front-end to sync compression algorithm. Major change
> is that now APIs are stateless. Instead of previous implementation, tfm
> objects doesn't embedded any context so we can de/compress concurrently
> with one tfm object. Instead, this de/compression context is coupled with
> the request. This architecture change will make APIs more flexible.
>
> This is just a RFC so commit description isn't sufficient. If Herbert
> confirms that this is what he expect, I will respin the series with proper
> commit description and adding more algorithm support.
>
> Thanks.
>
> Joonsoo Kim (6):
>    crypto/compress: remove unused pcomp interface
>    crypto/compress: introduce sychronuous compression API
>    crypto/lzo: support SCOMPRESS alg type
>    crypto: testmgr: add scompress/acompress test
>    crypto/compress: add algorithm type specific flag, DECOMP_NOCTX
>    crypto/lzo: add CRYPTO_ALG_SCOMPRESS_DECOMP_NOCTX cra_flags
>
> Weigang Li (1):
>    crypto: add asynchronous compression support
>
>   crypto/Kconfig                     |  19 +-
>   crypto/Makefile                    |   4 +-
>   crypto/acompress.c                 | 164 ++++++++++++++++
>   crypto/lzo.c                       |  95 +++++++--
>   crypto/pcompress.c                 | 115 -----------
>   crypto/scompress.c                 | 283 +++++++++++++++++++++++++++
>   crypto/testmgr.c                   | 376 +++++++++++++++---------------------
>   crypto/testmgr.h                   | 142 --------------
>   crypto/zlib.c                      | 381 -------------------------------------
>   include/crypto/compress.h          | 354 +++++++++++++++++++++++++---------
>   include/crypto/internal/compress.h |  32 +---
>   include/linux/crypto.h             |  10 +-
>   12 files changed, 969 insertions(+), 1006 deletions(-)
>   create mode 100644 crypto/acompress.c
>   delete mode 100644 crypto/pcompress.c
>   create mode 100644 crypto/scompress.c
>   delete mode 100644 crypto/zlib.c
>
Hello Herbert,
Any comments on this patchset?

[toc] | [prev] | [next] | [standalone]


#1307376

FromHerbert Xu <herbert@gondor.apana.org.au>
Date2016-01-12 13:50 +0100
Message-ID<qQ6yC-WB-23@gated-at.bofh.it>
In reply to#1307073
On Tue, Jan 12, 2016 at 04:00:50PM +0800, Li, Weigang wrote:
> On 1/4/2016 12:46 PM, Joonsoo Kim wrote:
> >Happy New Year!
> >
> >This patchset is to introduce new compression APIs. It supports async/sync
> >compression although there is no async compression driver yet. But, async
> >APIs can be used as front-end to sync compression algorithm. Major change
> >is that now APIs are stateless. Instead of previous implementation, tfm
> >objects doesn't embedded any context so we can de/compress concurrently
> >with one tfm object. Instead, this de/compression context is coupled with
> >the request. This architecture change will make APIs more flexible.
> >
> >This is just a RFC so commit description isn't sufficient. If Herbert
> >confirms that this is what he expect, I will respin the series with proper
> >commit description and adding more algorithm support.
> >
> >Thanks.
> >
> >Joonsoo Kim (6):
> >   crypto/compress: remove unused pcomp interface
> >   crypto/compress: introduce sychronuous compression API
> >   crypto/lzo: support SCOMPRESS alg type
> >   crypto: testmgr: add scompress/acompress test
> >   crypto/compress: add algorithm type specific flag, DECOMP_NOCTX
> >   crypto/lzo: add CRYPTO_ALG_SCOMPRESS_DECOMP_NOCTX cra_flags
> >
> >Weigang Li (1):
> >   crypto: add asynchronous compression support
> >
> >  crypto/Kconfig                     |  19 +-
> >  crypto/Makefile                    |   4 +-
> >  crypto/acompress.c                 | 164 ++++++++++++++++
> >  crypto/lzo.c                       |  95 +++++++--
> >  crypto/pcompress.c                 | 115 -----------
> >  crypto/scompress.c                 | 283 +++++++++++++++++++++++++++
> >  crypto/testmgr.c                   | 376 +++++++++++++++---------------------
> >  crypto/testmgr.h                   | 142 --------------
> >  crypto/zlib.c                      | 381 -------------------------------------
> >  include/crypto/compress.h          | 354 +++++++++++++++++++++++++---------
> >  include/crypto/internal/compress.h |  32 +---
> >  include/linux/crypto.h             |  10 +-
> >  12 files changed, 969 insertions(+), 1006 deletions(-)
> >  create mode 100644 crypto/acompress.c
> >  delete mode 100644 crypto/pcompress.c
> >  create mode 100644 crypto/scompress.c
> >  delete mode 100644 crypto/zlib.c
> >
> Hello Herbert,
> Any comments on this patchset?

The interfaces look good to me.

Thanks!
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[toc] | [prev] | [next] | [standalone]


#1308160

FromHerbert Xu <herbert@gondor.apana.org.au>
Date2016-01-13 09:30 +0100
Message-ID<qQoYz-5ni-17@gated-at.bofh.it>
In reply to#1307376
On Wed, Jan 13, 2016 at 05:31:34PM +0900, Joonsoo Kim wrote:
>
> Herbert, for you, is it better to send it after merge window?

Yes that would be very much appreciated.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[toc] | [prev] | [next] | [standalone]


#1308161

FromJoonsoo Kim <iamjoonsoo.kim@lge.com>
Date2016-01-13 09:30 +0100
Message-ID<qQoYz-5ni-9@gated-at.bofh.it>
In reply to#1307376
On Tue, Jan 12, 2016 at 08:47:39PM +0800, Herbert Xu wrote:
> On Tue, Jan 12, 2016 at 04:00:50PM +0800, Li, Weigang wrote:
> > On 1/4/2016 12:46 PM, Joonsoo Kim wrote:
> > >Happy New Year!
> > >
> > >This patchset is to introduce new compression APIs. It supports async/sync
> > >compression although there is no async compression driver yet. But, async
> > >APIs can be used as front-end to sync compression algorithm. Major change
> > >is that now APIs are stateless. Instead of previous implementation, tfm
> > >objects doesn't embedded any context so we can de/compress concurrently
> > >with one tfm object. Instead, this de/compression context is coupled with
> > >the request. This architecture change will make APIs more flexible.
> > >
> > >This is just a RFC so commit description isn't sufficient. If Herbert
> > >confirms that this is what he expect, I will respin the series with proper
> > >commit description and adding more algorithm support.
> > >
> > >Thanks.
> > >
> > >Joonsoo Kim (6):
> > >   crypto/compress: remove unused pcomp interface
> > >   crypto/compress: introduce sychronuous compression API
> > >   crypto/lzo: support SCOMPRESS alg type
> > >   crypto: testmgr: add scompress/acompress test
> > >   crypto/compress: add algorithm type specific flag, DECOMP_NOCTX
> > >   crypto/lzo: add CRYPTO_ALG_SCOMPRESS_DECOMP_NOCTX cra_flags
> > >
> > >Weigang Li (1):
> > >   crypto: add asynchronous compression support
> > >
> > >  crypto/Kconfig                     |  19 +-
> > >  crypto/Makefile                    |   4 +-
> > >  crypto/acompress.c                 | 164 ++++++++++++++++
> > >  crypto/lzo.c                       |  95 +++++++--
> > >  crypto/pcompress.c                 | 115 -----------
> > >  crypto/scompress.c                 | 283 +++++++++++++++++++++++++++
> > >  crypto/testmgr.c                   | 376 +++++++++++++++---------------------
> > >  crypto/testmgr.h                   | 142 --------------
> > >  crypto/zlib.c                      | 381 -------------------------------------
> > >  include/crypto/compress.h          | 354 +++++++++++++++++++++++++---------
> > >  include/crypto/internal/compress.h |  32 +---
> > >  include/linux/crypto.h             |  10 +-
> > >  12 files changed, 969 insertions(+), 1006 deletions(-)
> > >  create mode 100644 crypto/acompress.c
> > >  delete mode 100644 crypto/pcompress.c
> > >  create mode 100644 crypto/scompress.c
> > >  delete mode 100644 crypto/zlib.c
> > >
> > Hello Herbert,
> > Any comments on this patchset?
> 
> The interfaces look good to me.

Thanks for confirmation.
Then, I will add more algorithm support and respin next version
with minor fixes.

Herbert, for you, is it better to send it after merge window?

Thanks.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web