Page MenuHomeFreeBSD

ifnet/API: Use buf_ring for putback in drbr_* APIs
Needs ReviewPublic

Authored by pkochanowski_sii.pl on Oct 13 2025, 3:19 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 28, 11:15 PM
Unknown Object (File)
Sun, Nov 23, 11:06 PM
Unknown Object (File)
Sun, Nov 23, 8:09 PM
Unknown Object (File)
Tue, Nov 4, 3:59 PM
Unknown Object (File)
Tue, Nov 4, 3:58 PM
Unknown Object (File)
Tue, Nov 4, 3:55 PM
Unknown Object (File)
Tue, Nov 4, 3:55 PM
Unknown Object (File)
Tue, Nov 4, 3:54 PM

Details

Reviewers
jhibbits
imp
Summary

In case an ALTQ is used a memory leak can happen if drbr_putback is executed as no other function check for driver queue.
Always putback into the buf_ring and change the order of checks in other drbr_* functions.

This ensures that no frames are lost and no additional synchronization is needed.

This also have an additional effect of increasing the network performance in case the ALTQ is compiled in but not really enabled on the interface (the order of functions changed and the default path is checked first).

This is a second approach to fix this bug that occurred on custom ARM board with driver that uses this interface and have ALTQ enabled (https://reviews.freebsd.org/D52424). The previous approach changed the synchronization requirements and led to spontaneous kernel crashes so it could be closed.

Test Plan

Verified with iperf, trex and other tools with long running tests on custom ARM Cortex-A72 device.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped