[dpdk-dev] [PATCH 1/2] net/netvsc: fix underflow error when external mbuf are used in the receive path

Stephen Hemminger stephen at networkplumber.org
Thu Jul 2 02:06:46 CEST 2020


On Tue, 23 Jun 2020 18:11:45 -0700
longli at linuxonhyperv.com wrote:

> From: Long Li <longli at microsoft.com>
> 
> When rte_pktmbuf_attach_extbuf() is used, the driver should not decrease the
> reference count in its callback function hn_rx_buf_free_cb, because the
> reference count is already decreased by rte_pktmbuf. Doing it twice may result
> in underflow and driver may never send an ack packet over vmbus to host.
> 
> Also declares rxbuf_outstanding as atomic, because this value is shared
> among all receive queues.
> 
> Signed-off-by: Long Li <longli at microsoft.com>

Good catch. DPDK ought to have a real refcnt type like the kernel.
One that traps on underflow.

Acked-by: Stephen Hemminger <stephen at networkplumber.org>


More information about the dev mailing list