|WARNING| net/qede/base: fix division by zero

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Fri Nov 13 21:43:09 CET 2026


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

_AI Code Review_

=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-13

**drivers/net/qede/base/ecore_dev.c: valid configuration rejected (Warning)**

The new check fails WFQ setup outright whenever every vport has requested a minimum rate:

```c
+	if (non_requested_count == 0) {
+		...
+		return ECORE_INVAL;
+	}
```

Per the commit message, this triggers exactly when `num_vports == req_count`. That means all vports have explicit min-rate requests, which is a legitimate configuration rather than an error. With nothing left to distribute, there is simply no `left_rate_per_vp` to compute.

Returning `ECORE_INVAL` turns a division-by-zero crash into a functional regression: the last vport can no longer be given a minimum rate.

Suggested fix: avoid the division instead of rejecting the request. The later per-vport limit checks and distribution of `left_rate_per_vp` should only apply when there are unrequested vports:

```c
	total_left_rate = min_pf_rate - total_req_min_rate;
	if (non_requested_count != 0) {
		left_rate_per_vp = total_left_rate / non_requested_count;
		/* existing left_rate_per_vp validation */
	}
```

**Log message wording (Info)**

The message "The number of vports is equal to the number of requests" does not say why the request failed. If the reject behaviour is kept, the message should state the actual reason.

Review-Result: WARNING


More information about the test-report mailing list