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

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Tue Nov 17 01:15:46 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-17

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

The comment kept in the error branch now says the opposite of what the code does:

```
			/* Assume failure is backpressure */
			PMD_LOG(ERR, "pcap_sendpacket() failed: %s", pcap_geterr(pcap));
			rte_pktmbuf_free(mbuf);
			tx_queue->tx_stat.err_pkts++;
			continue;
```

After this patch, this branch handles hard errors: the packet is dropped and counted, not treated as backpressure. Replace the comment with something like:

```
			/* Hard error: drop the packet and continue */
```

**Warning: missing `Cc: stable at dpdk.org`**

The patch is a bug fix carrying a `Fixes:` tag, but it has no `Cc: stable at dpdk.org` line. Add one so the fix is picked up for backport.

**Info: `ENOBUFS` is now treated as a hard error**

Only `EINTR`, `EAGAIN` and `EWOULDBLOCK` are classified as soft:

```
			if (errno == EINTR || errno == EAGAIN ||
			    errno == EWOULDBLOCK)
				break;
```

On Linux, a `PF_PACKET` send can fail with `ENOBUFS` when the device transmit queue or qdisc is full. That is a transient congestion condition. With this patch, such packets are dropped and logged rather than returned to the caller for retry. Consider adding `ENOBUFS` to the soft-error list if backpressure is still wanted in that case.

**Info: per-packet error logging in the datapath**

`PMD_LOG(ERR, ...)` is now emitted for every dropped packet, and the loop continues. A persistent hard error (for example, the interface going down) will therefore log once per packet per burst. Consider rate-limiting the log or relying on the `err_pkts` counter.

Review-Result: WARNING


More information about the test-report mailing list