net/bnxt: fix memory leak during queue restart
authorRahul Gupta <rahul.gupta@broadcom.com>
Thu, 23 Apr 2020 15:02:23 +0000 (20:32 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Sat, 25 Apr 2020 21:09:29 +0000 (23:09 +0200)
commitd256c73c11229c0a7eae32a7e0baaa7a457000e1
treea989a71ddf9d14d7f8a5f589a71f2bfad6c0daa6
parent27efcf2003113fc9a236d8cf5b6c5e01b28b59ca
net/bnxt: fix memory leak during queue restart

During port 0 rxq 1 start ie queue start,
bnxt_free_hwrm_rx_ring() we are clearing the pointers to mbuf array.
Due to this we overwrite the queue with fresh mbuf allocations
causing previously allocated mbufs to leak.
Add a check before allocating mbuf to replenish only empty mbuf slots
in the RxQ.

Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code")
Cc: stable@dpdk.org
Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_hwrm.c
drivers/net/bnxt/bnxt_rxr.c