|WARNING| test: add larger input len test for CRC16-CCITT

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Fri Jun 12 05:23:27 CEST 2026


Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/165376

_AI Code Review_

=== Patch Review: series.patch (via Claude) ===
Review date: 2026-06-12

# DPDK Patch Review

## Patch Summary
This patch adds a larger input length test (348 bytes) for CRC16-CCITT to improve code coverage of SSE4.2 and AVX512 code paths.

---

## Errors

None identified.

---

## Warnings

### 1. Buffer size mismatch in memset
**File:** `app/test/test_crc.c`  
**Line:** `memset(test_data, 0, CRC32_VEC_LEN1);`

The code uses `CRC32_VEC_LEN1` (length for CRC32 tests) when clearing the buffer for a CRC16 test.
While `CRC32_VEC_LEN1` (CRC_VEC_LEN = 32) is smaller than `CRC16_VEC_LEN3` (348),
this inconsistency is confusing and could cause issues if buffer sizes change in the future.

**Suggested fix:**
```c
memset(test_data, 0, CRC16_VEC_LEN3);
```
This makes the intent clear: zero the entire buffer that will be used for this test.

### 2. Missing release notes entry
**Context:** Test infrastructure change

While the guidelines note that "Release notes are NOT required for test-only changes,"
this test addition improves coverage of previously untested code paths in production code (SSE4.2 and AVX512 implementations).
Consider adding a brief note in the release notes under a "Test Infrastructure" or "Validation" section
to document the improved CRC test coverage.

**Suggested addition to release notes:**
```
* **Improved CRC test coverage.**

  Added CRC16-CCITT test with 348-byte input to exercise SSE4.2 4x loop
  and AVX512 code paths that were previously untested.
```

(Note: This is a suggestion, not a requirement per the guidelines.)

---

## Info

### Code style observation
The patch follows existing test patterns correctly:
- Uses `rte_memcpy()` appropriately in test code
- Follows the established pattern of CRC32 Test 3 for creating larger test vectors
- Maintains consistent formatting and naming conventions

### Test correctness
The test vector construction (copying 12-byte chunks to create a 348-byte input)
matches the pattern used in the existing CRC32 tests, which is appropriate for exercising vector code paths.

---

## Summary

The patch is functionally correct with one minor issue:
- **Warning:** Use `CRC16_VEC_LEN3` instead of `CRC32_VEC_LEN1` in the `memset()` call for consistency and clarity

No blocking errors were identified. The patch successfully adds test coverage for larger CRC16-CCITT inputs as intended.


More information about the test-report mailing list