Re: [PATCH v3] staging: octeon: fix asymmetric output buffer pool accounting
From: Greg Kroah-Hartman
Date: Mon Nov 16 2026 - 04:40:53 EST
On Mon, Nov 16, 2026 at 06:57:30AM +0000, Priyanshu Singh wrote:
> In cvm_oct_configure_common_hw(), when CVMX_FPA_OUTPUT_BUFFER_POOL differs
> from CVMX_FPA_PACKET_POOL, 1024 output buffers are allocated and added to
> the hardware Free Pool Allocator (FPA) pool. However, in cvm_oct_probe()
> (err_tx:) and in cvm_oct_remove(), cvm_oct_mem_empty_fpa() is called with
> 128 instead of 1024 as the expected buffer count.
>
> This asymmetric accounting causes cvm_oct_free_hw_memory() to report a
> false warning ("Freeing of pool 2 had too many buffers (-896)") upon
> draining the pool.
>
> Define CVM_OCT_NUM_OUTPUT_BUFFERS in ethernet-defines.h and use this
> constant across cvm_oct_configure_common_hw(),
> cvm_oct_probe(), and cvm_oct_remove() to ensure symmetric allocation
> and deallocation.
>
> This was found via manual code inspection and is compile-tested only.
Please test this on real hardware in order for us to be able to accept
it.
thanks,
greg k-h