* [PATCH v1] compress/zlib: fix UDC checksum logic
@ 2025-12-16 19:36 Sameer Vaze
2025-12-18 7:32 ` [EXTERNAL] " Ashish Gupta
0 siblings, 1 reply; 2+ messages in thread
From: Sameer Vaze @ 2025-12-16 19:36 UTC (permalink / raw)
To: Sunila Sahu, Fan Zhang, Ashish Gupta; +Cc: dev, Sameer Vaze, stable
Fixes bugs with casting and checksum calculation for
UDC checksum
Fixes: 0dc314debb22 ("compress/zlib: support dictionaries and PDCP checksum")
Cc: stable@dpdk.org
Signed-off-by: Sameer Vaze <svaze@qti.qualcomm.com>
---
drivers/compress/zlib/zlib_pmd.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/compress/zlib/zlib_pmd.c b/drivers/compress/zlib/zlib_pmd.c
index 1d7651dd7d..bb970912cb 100644
--- a/drivers/compress/zlib/zlib_pmd.c
+++ b/drivers/compress/zlib/zlib_pmd.c
@@ -48,12 +48,12 @@ process_zlib_deflate_chksum(struct rte_comp_op *op,
return;
}
- dictionary_start = (uint32_t)(*dictionary);
- dictionary_end = (uint32_t)(*(dictionary + dictionary_len - 4));
+ dictionary_start = *(uint32_t *)dictionary;
+ dictionary_end = *(uint32_t *)(dictionary + dictionary_len - 4);
sum = (dictionary_start & BOTTOM_NIBBLE_OF_BYTES_IN_DOUBLE_WORD)
- + (dictionary_start & (TOP_NIBBLE_OF_BYTE_IN_DOUBLE_WORD >> 4))
+ + ((dictionary_start & TOP_NIBBLE_OF_BYTE_IN_DOUBLE_WORD) >> 4)
+ (dictionary_end & BOTTOM_NIBBLE_OF_BYTES_IN_DOUBLE_WORD)
- + (dictionary_end & (TOP_NIBBLE_OF_BYTE_IN_DOUBLE_WORD >> 4));
+ + ((dictionary_end & TOP_NIBBLE_OF_BYTE_IN_DOUBLE_WORD) >> 4);
op->output_chksum = ~(sum_bytes[0] + sum_bytes[1] + sum_bytes[2] + sum_bytes[3])
& BOTTOM_NIBBLE_OF_BYTE;
@@ -98,12 +98,12 @@ process_zlib_inflate_chksum(struct rte_comp_op *op,
return;
}
- dictionary_start = (uint32_t)(*dictionary);
- dictionary_end = (uint32_t)(*(dictionary + dictionary_len - 4));
+ dictionary_start = *(uint32_t *)dictionary;
+ dictionary_end = *(uint32_t *)(dictionary + dictionary_len - 4);
sum = (dictionary_start & BOTTOM_NIBBLE_OF_BYTES_IN_DOUBLE_WORD)
- + (dictionary_start & (TOP_NIBBLE_OF_BYTE_IN_DOUBLE_WORD >> 4))
+ + ((dictionary_start & TOP_NIBBLE_OF_BYTE_IN_DOUBLE_WORD) >> 4)
+ (dictionary_end & BOTTOM_NIBBLE_OF_BYTES_IN_DOUBLE_WORD)
- + (dictionary_end & (TOP_NIBBLE_OF_BYTE_IN_DOUBLE_WORD >> 4));
+ + ((dictionary_end & TOP_NIBBLE_OF_BYTE_IN_DOUBLE_WORD) >> 4);
op->output_chksum = ~(sum_bytes[0] + sum_bytes[1] + sum_bytes[2] + sum_bytes[3])
& BOTTOM_NIBBLE_OF_BYTE;
--
2.31.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [EXTERNAL] [PATCH v1] compress/zlib: fix UDC checksum logic
2025-12-16 19:36 [PATCH v1] compress/zlib: fix UDC checksum logic Sameer Vaze
@ 2025-12-18 7:32 ` Ashish Gupta
0 siblings, 0 replies; 2+ messages in thread
From: Ashish Gupta @ 2025-12-18 7:32 UTC (permalink / raw)
To: Sameer Vaze, Sunila Sahu, Fan Zhang; +Cc: dev, stable
[-- Attachment #1: Type: text/plain, Size: 4212 bytes --]
From: Sameer Vaze <svaze@qti.qualcomm.com>
Sent: Wednesday, December 17, 2025 1:06 AM
To: Sunila Sahu <ssahu@marvell.com>; Fan Zhang <fanzhang.oss@gmail.com>; Ashish Gupta <ashishg@marvell.com>
Cc: dev@dpdk.org; Sameer Vaze <svaze@qti.qualcomm.com>; stable@dpdk.org
Subject: [EXTERNAL] [PATCH v1] compress/zlib: fix UDC checksum logic
Fixes bugs with casting and checksum calculation for UDC checksum Fixes: 0dc314debb22 ("compress/zlib: support dictionaries and PDCP checksum") Cc: stable@ dpdk. org Signed-off-by: Sameer Vaze <svaze@ qti. qualcomm. com> --- drivers/compress/zlib/zlib_pmd. c
ZjQcmQRYFpfptBannerStart
Prioritize security for external emails:
Confirm sender and content safety before clicking links or opening attachments
Report Suspicious <https://us-phishalarm-ewt.proofpoint.com/EWT/v1/CRVmXkqW!ti3Z1f8UAlWa1M-dmb2aTtrSCkcdEIRIFWg-YVjcPEhmOerTATSVvntd2S9OqvFQwGz2AuKqJLO-tb0Pf2JxhUZLz0GegAL_$>
ZjQcmQRYFpfptBannerEnd
Fixes bugs with casting and checksum calculation for
UDC checksum
Fixes: 0dc314debb22 ("compress/zlib: support dictionaries and PDCP checksum")
Cc: stable@dpdk.org<mailto:stable@dpdk.org>
Signed-off-by: Sameer Vaze <svaze@qti.qualcomm.com<mailto:svaze@qti.qualcomm.com>>
---
drivers/compress/zlib/zlib_pmd.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/compress/zlib/zlib_pmd.c b/drivers/compress/zlib/zlib_pmd.c
index 1d7651dd7d..bb970912cb 100644
--- a/drivers/compress/zlib/zlib_pmd.c
+++ b/drivers/compress/zlib/zlib_pmd.c
@@ -48,12 +48,12 @@ process_zlib_deflate_chksum(struct rte_comp_op *op,
return;
}
- dictionary_start = (uint32_t)(*dictionary);
- dictionary_end = (uint32_t)(*(dictionary + dictionary_len - 4));
+ dictionary_start = *(uint32_t *)dictionary;
+ dictionary_end = *(uint32_t *)(dictionary + dictionary_len - 4);
sum = (dictionary_start & BOTTOM_NIBBLE_OF_BYTES_IN_DOUBLE_WORD)
- + (dictionary_start & (TOP_NIBBLE_OF_BYTE_IN_DOUBLE_WORD >> 4))
+ + ((dictionary_start & TOP_NIBBLE_OF_BYTE_IN_DOUBLE_WORD) >> 4)
+ (dictionary_end & BOTTOM_NIBBLE_OF_BYTES_IN_DOUBLE_WORD)
- + (dictionary_end & (TOP_NIBBLE_OF_BYTE_IN_DOUBLE_WORD >> 4));
+ + ((dictionary_end & TOP_NIBBLE_OF_BYTE_IN_DOUBLE_WORD) >> 4);
op->output_chksum = ~(sum_bytes[0] + sum_bytes[1] + sum_bytes[2] + sum_bytes[3])
& BOTTOM_NIBBLE_OF_BYTE;
@@ -98,12 +98,12 @@ process_zlib_inflate_chksum(struct rte_comp_op *op,
return;
}
- dictionary_start = (uint32_t)(*dictionary);
- dictionary_end = (uint32_t)(*(dictionary + dictionary_len - 4));
+ dictionary_start = *(uint32_t *)dictionary;
+ dictionary_end = *(uint32_t *)(dictionary + dictionary_len - 4);
sum = (dictionary_start & BOTTOM_NIBBLE_OF_BYTES_IN_DOUBLE_WORD)
- + (dictionary_start & (TOP_NIBBLE_OF_BYTE_IN_DOUBLE_WORD >> 4))
+ + ((dictionary_start & TOP_NIBBLE_OF_BYTE_IN_DOUBLE_WORD) >> 4)
+ (dictionary_end & BOTTOM_NIBBLE_OF_BYTES_IN_DOUBLE_WORD)
- + (dictionary_end & (TOP_NIBBLE_OF_BYTE_IN_DOUBLE_WORD >> 4));
+ + ((dictionary_end & TOP_NIBBLE_OF_BYTE_IN_DOUBLE_WORD) >> 4);
op->output_chksum = ~(sum_bytes[0] + sum_bytes[1] + sum_bytes[2] + sum_bytes[3])
& BOTTOM_NIBBLE_OF_BYTE;
--
2.31.1
Acked-by: Ashish Gupta <ashishg@marvell.com>
[-- Attachment #2: Type: text/html, Size: 19172 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-12-18 7:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-16 19:36 [PATCH v1] compress/zlib: fix UDC checksum logic Sameer Vaze
2025-12-18 7:32 ` [EXTERNAL] " Ashish Gupta
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).