|WARNING| net/bnxt: remove redundant Rx queue array check
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Tue Sep 15 12:53:31 CEST 2026
Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/169571
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-09-15
# DPDK Patch Review
## Summary
This patch removes a redundant NULL check for `eth_dev->data->rx_queues` in the bnxt driver's `bnxt_rx_queue_setup_op()` function. The patch is correct in principle -- the array is allocated during `rte_eth_dev_configure()` before this function is called -- but there is one **correctness bug** that must be fixed.
---
## Errors
### 1. Implicit comparison on pointer variable
**Location:** `drivers/net/bnxt/bnxt_rxq.c:373`
```c
rxq = eth_dev->data->rx_queues[queue_idx];
if (rxq)
bnxt_rx_queue_release_op(eth_dev, queue_idx);
```
**Issue:** DPDK coding style requires explicit comparison against `NULL` for pointer variables. The implicit truthiness test `if (rxq)` violates this requirement.
**Fix:**
```c
rxq = eth_dev->data->rx_queues[queue_idx];
if (rxq != NULL)
bnxt_rx_queue_release_op(eth_dev, queue_idx);
```
### 2. Implicit comparison on pointer variable
**Location:** `drivers/net/bnxt/bnxt_rxq.c:377`
```c
if (!rxq) {
```
**Issue:** Same as above. Explicit comparison required.
**Fix:**
```c
if (rxq == NULL) {
```
---
## Warnings
None.
---
## Info
None.
---
## Notes
- The removal of the `rx_queues` NULL check is correct. The array is allocated in `rte_eth_dev_allocate()` - `rte_eth_dev_data_alloc()` before `nb_rx_queues` is set, so by the time `bnxt_rx_queue_setup_op()` is called (via `rte_eth_rx_queue_setup()` which validates `queue_idx < nb_rx_queues`), the array must exist.
- The logic change is sound. Only the implicit pointer comparisons need correction to comply with DPDK style.
More information about the test-report
mailing list