[PATCH v2] kni: fix possible alloc_q starvation when mbufs are exhausted
Stephen Hemminger
stephen at networkplumber.org
Wed Nov 9 17:39:09 CET 2022
On Wed, 9 Nov 2022 14:04:34 +0800
Yangchao Zhou <zhouyates at gmail.com> wrote:
> In some scenarios, mbufs returned by rte_kni_rx_burst are not freed
> immediately. So kni_allocate_mbufs may be failed, but we don't know.
>
> Even worse, when alloc_q is completely exhausted, kni_net_tx in
> rte_kni.ko will drop all tx packets. kni_allocate_mbufs is never
> called again, even if the mbufs are eventually freed.
>
> In this patch, we always try to allocate mbufs for alloc_q.
>
> Don't worry about alloc_q being allocated too many mbufs, in fact,
> the old logic will gradually fill up alloc_q.
> Also, the cost of more calls to kni_allocate_mbufs should be acceptable.
>
> Fixes: 3e12a98fe397 ("kni: optimize Rx burst")
> Cc: Hemant at freescale.com
> Cc: stable at dpdk.org
>
> Signed-off-by: Yangchao Zhou <zhouyates at gmail.com>
Since fifo_get returning 0 (no buffers) is very common would this
change impact performance.
If the problem is pool draining might be better to make the pool
bigger.
More information about the dev
mailing list