|WARNING| net/bnxt: check return code of bnxt_hwrm_vnic_rss_cfg in flow create

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Tue Sep 15 11:47:53 CEST 2026


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

_AI Code Review_

=== Patch Review: series.patch (via Claude) ===
Review date: 2026-09-15

# DPDK Patch Review

## Summary
This patch adds error checking for `bnxt_hwrm_vnic_rss_cfg()` in the flow creation path. The change is straightforward and addresses a real bug where RSS configuration failures were silently ignored.

---

## Errors

### 1. Incorrect error code transformation (Error)

**Location:** Line 1641

**Problem:**
```c
rc = -rte_errno;
```

This is incorrect. The function `bnxt_hwrm_vnic_rss_cfg()` already returns a negative error code on failure (standard DPDK convention). The code path is:

1. `bnxt_hwrm_vnic_rss_cfg()` returns negative error code - stored in `rc`
2. `rte_flow_error_set()` is called with `-rc` (positive) as the error code
3. Then `rc = -rte_errno` overwrites the actual error code

**Why it matters:**
- `rte_flow_error_set()` sets `rte_errno` to the absolute value of the error code passed to it (the `-rc` parameter)
- Then negating `rte_errno` produces the wrong sign or wrong error code entirely
- The original `rc` value is lost
- Callers will receive incorrect error codes

**Suggested fix:**
```c
rc = bnxt_hwrm_vnic_rss_cfg(bp, vnic);
if (rc) {
	rte_flow_error_set(error,
			   -rc,
			   RTE_FLOW_ERROR_TYPE_ACTION,
			   act,
			   "VNIC RSS configure failed");
	goto ret;
}
```

Remove the `rc = -rte_errno;` line. The `rc` value is already correct (negative error code) and should be returned as-is.

---

## Warnings

None.

---

## Info

None.

---

## Overall Assessment

The patch correctly identifies a missing error check, which is a real bug. However, the error handling implementation contains a logic error in how it processes the return code. With the suggested fix, this patch properly addresses the issue.


More information about the test-report mailing list