From: Stephen Hemminger <stephen@networkplumber.org>
To: Sameer Vaze <svaze@qti.qualcomm.com>
Cc: Sunila Sahu <ssahu@marvell.com>,
Fan Zhang <fanzhang.oss@gmail.com>,
Ashish Gupta <ashishg@marvell.com>,
dev@dpdk.org
Subject: Re: [PATCH] compress/zlib: support for dictionary and PDCP checksum
Date: Thu, 18 Sep 2025 14:42:25 -0700 [thread overview]
Message-ID: <20250918144225.63a09b8d@hermes.local> (raw)
In-Reply-To: <20250918203210.1689254-1-svaze@qti.qualcomm.com>
On Thu, 18 Sep 2025 14:32:10 -0600
Sameer Vaze <svaze@qti.qualcomm.com> wrote:
> Adds support to provide predefined dictionaries to zlib. Handles setting
> and getting of dictionaries using zlib apis. Also includes support to
> read dictionary files
>
> Adds support for passing in and validationg 3GPP PDCP spec defined
> checksums as defined under the Uplink Data Compression(UDC) feature.
> Changes also include functions that do inflate or deflate specfic
> checksum operations.
>
> Signed-off-by: Sameer Vaze <svaze@qti.qualcomm.com>
> ---
> drivers/compress/zlib/zlib_pmd.c | 173 +++++++++++++++++++++--
> drivers/compress/zlib/zlib_pmd_private.h | 8 ++
> lib/compressdev/rte_comp.h | 31 ++++
> 3 files changed, 203 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/compress/zlib/zlib_pmd.c b/drivers/compress/zlib/zlib_pmd.c
> index 92e808e78c..1b1abd72e7 100644
> --- a/drivers/compress/zlib/zlib_pmd.c
> +++ b/drivers/compress/zlib/zlib_pmd.c
> @@ -4,6 +4,7 @@
>
> #include <bus_vdev_driver.h>
> #include <rte_common.h>
> +#include <rte_malloc.h>
>
> #include "zlib_pmd_private.h"
>
> @@ -15,6 +16,120 @@
> (data = rte_pktmbuf_mtod(mbuf, uint8_t *)), \
> (len = rte_pktmbuf_data_len(mbuf)) : 0)
>
> +#define BOTTOM_NIBBLE_OF_BYTE 0xf
> +#define TOP_NIBBLE_OF_BYTE 0xf0
> +
> +static void
> +process_zlib_deflate_chksum(struct rte_comp_op *op,
> + z_stream *strm, enum rte_comp_checksum_type chksum)
> +{
> + uint8_t *dictionary = NULL;
Maybe best to not initialize this. That way if there attempts
to use the variable when still NULL, the compiler can detect
use of uninitialized variable.
> + uint32_t dictionary_len = 0;
> + op->status = RTE_COMP_OP_STATUS_SUCCESS;
> +
> + switch (chksum) {
> + case RTE_COMP_CHECKSUM_NONE:
> + case RTE_COMP_CHECKSUM_CRC32:
> + case RTE_COMP_CHECKSUM_ADLER32:
> + case RTE_COMP_CHECKSUM_CRC32_ADLER32:
> + ZLIB_PMD_ERR("Checksum type not supported");
> + op->status = RTE_COMP_OP_STATUS_INVALID_ARGS;
> + break;
Why is this different than the default case?
> + case RTE_COMP_CHECKSUM_3GPP_PDCP_UDC:
> + dictionary = rte_zmalloc(NULL, DEFLATE_MAX_WINDOW_SIZE, 0);
Is there a requirement that the dictionary be in huge pages.
If not use malloc() since that has better error checking.
prev parent reply other threads:[~2025-09-18 21:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-18 20:32 Sameer Vaze
2025-09-18 20:44 ` Sameer Vaze
2025-09-18 21:42 ` Stephen Hemminger [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250918144225.63a09b8d@hermes.local \
--to=stephen@networkplumber.org \
--cc=ashishg@marvell.com \
--cc=dev@dpdk.org \
--cc=fanzhang.oss@gmail.com \
--cc=ssahu@marvell.com \
--cc=svaze@qti.qualcomm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).