|WARNING| net/pcap: fix handling of transmit errors

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Tue Nov 17 01:00:11 CET 2026


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

_AI Code Review_

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

**Warning: stale comment contradicts the new logic**

The patch leaves this line in place:

```c
			/* Assume failure is backpressure */
```

It now sits in the branch that handles hard errors by dropping the packet. Backpressure (`EINTR`/`EAGAIN`/`EWOULDBLOCK`) is handled by the new `break` above it. The comment says the opposite of what the code does.

Suggested fix: replace it with something accurate, for example:

```c
			/* Hard error: drop the packet and count it */
```

**Info: per-packet error logging in the Tx fast path**

```c
			PMD_LOG(ERR, "pcap_sendpacket() failed: %s", pcap_geterr(pcap));
			rte_pktmbuf_free(mbuf);
			tx_queue->tx_stat.err_pkts++;
			continue;
```

Previously the loop broke after the first failure, so at most one message was logged per burst. With `continue`, a persistent hard error (for example ENETDOWN or a bad device) now logs once for every packet in every burst. That can flood the log at line rate.

Consider rate-limiting the message, or logging only on the first failure in a burst. The `err_pkts` counter already records the drops.

Review-Result: WARNING


More information about the test-report mailing list