net/netvsc: fix underflow when Rx external mbuf
authorLong Li <longli@microsoft.com>
Wed, 24 Jun 2020 01:11:45 +0000 (18:11 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Sat, 11 Jul 2020 04:18:53 +0000 (06:18 +0200)
commitd43b8c710836db953fad1bb6449a827e19b5a87a
tree3aa600ffcc4aa1468ccda38787443cbd3f7c149d
parent46dac7d1115c66762aa78e308d5f1c401ee5e3a0
net/netvsc: fix underflow when Rx external mbuf

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.

Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
Cc: stable@dpdk.org
Signed-off-by: Long Li <longli@microsoft.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
drivers/net/netvsc/hn_nvs.c
drivers/net/netvsc/hn_rxtx.c
drivers/net/netvsc/hn_var.h