|WARNING| net/bnxt: fix promiscuous mode set
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Tue Oct 6 15:34:37 CEST 2026
Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/170626
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-10-06
# DPDK Patch Review
## Summary
This patch adds a platform check to skip promiscuous mode configuration on unsupported platforms (Whitney). The change is minimal and targeted.
---
## Errors
None found.
---
## Warnings
### 1. Missing explicit return value comparison
**Location:** `drivers/net/bnxt/tf_ulp/ulp_def_rules.c:830`
```c
if (!bp->ulp_ctx)
return rc;
```
DPDK coding style requires explicit comparison against `NULL` for pointers.
**Fix:**
```c
if (bp->ulp_ctx == NULL)
return rc;
```
### 2. Missing explicit return value comparison (existing code)
**Location:** `drivers/net/bnxt/tf_ulp/ulp_def_rules.c:828`
```c
if (!BNXT_TRUFLOW_EN(bp) ||
!bp->ulp_ctx)
```
The second condition uses implicit NULL check.
**Fix:**
```c
if (!BNXT_TRUFLOW_EN(bp) ||
bp->ulp_ctx == NULL)
```
**Note:** This is pre-existing code, but should be noted for consistency.
### 3. Uninitialized return value on new error path
**Location:** `drivers/net/bnxt/tf_ulp/ulp_def_rules.c:834`
```c
if (!BNXT_CHIP_P5_P7(bp))
return rc;
```
The variable `rc` is returned uninitialized when the platform check fails. Looking at the function context, `rc` appears to be used for error codes but its initial value is not visible in this patch. If `rc` is declared as `int rc;` without initialization at the start of the function, this returns an undefined value on the new early-exit path.
**Fix:**
Either ensure `rc` is initialized to 0 at declaration, or explicitly return 0:
```c
if (!BNXT_CHIP_P5_P7(bp))
return 0;
```
Since this is skipping an unsupported operation (not an error), returning 0 (success) is likely correct.
---
## Info
### Context suggests return value should be 0
The new platform check is meant to silently skip the operation on unsupported platforms, which is not an error condition. The function should return success (0) rather than an uninitialized value. Review the function's `rc` initialization and consider whether this path should explicitly `return 0;` for clarity.
---
## Overall Assessment
The patch correctly addresses the platform support issue mentioned in the commit message. The primary concern is ensuring the return value on the new early-exit path is well-defined and appropriate (likely should be 0 for "operation not needed" rather than relying on `rc`'s initial value).
More information about the test-report
mailing list