|WARNING| [v7, 4/4] net/af_packet: use kernel to filter multi-queue Rx

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Fri Oct 16 23:38:42 CEST 2026


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

_AI Code Review_

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

# DPDK Patch Review

## Patch 1/4: test/af_packet: ignore stray packets in loopback test

### Errors

None.

### Warnings

None.

### Info

None.

---

## Patch 2/4: net/af_packet: filter Rx of outgoing packets in the PMD

### Errors

None.

### Warnings

None.

### Info

None.

---

## Patch 3/4: net/af_packet: use kernel to filter single-queue Rx

### Errors

**Error path resource leak:** Line 1044
```c
rc = setsockopt(qsockfd, SOL_PACKET, PACKET_IGNORE_OUTGOING,
        &ignore_outgoing, sizeof(ignore_outgoing));
if (rc == -1) {
    PMD_LOG_ERRNO(ERR, ...);
    goto error;
}
```

The `setsockopt()` call for `PACKET_IGNORE_OUTGOING` is placed after the socket has been opened (`qsockfd`) but before the `PACKET_RX_RING` setsockopt and before the `rx_queue->map` mmap. If this new setsockopt fails and the code goes to the `error` label, the socket `qsockfd` is not closed on this path. The existing `error:` label only closes `(*internals)->rx_queue[q].sockfd` for queues that successfully completed setup, but `qsockfd` for the failing queue is never assigned to `(*internals)->rx_queue[q].sockfd` (that assignment happens later), so it leaks.

**Suggested fix:** Either close `qsockfd` explicitly before `goto error`, or assign it to `(*internals)->rx_queue[q].sockfd` earlier so the cleanup loop can close it. Example:

```c
if (rc == -1) {
    PMD_LOG_ERRNO(ERR, ...);
    close(qsockfd);
    goto error;
}
```

---

## Patch 4/4: net/af_packet: use kernel to filter multi-queue Rx

### Errors

None.

### Warnings

None.

### Info

None.

---

Review-Result: ERROR


More information about the test-report mailing list