Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net/hns3: fix mbuf leakage when RxQ started after reset
[ upstream commit f81a18f491522c56ca7ee6ea78be10c784f2ae32 ] In the reset restore-conf phase, the reset process will allocate for the Rx ring mbufs unconditionlly. And the rte_eth_dev_rx_queue_start() will also allocate for the Rx ring mbufs unconditionlly. So if the rte_eth_dev_rx_queue_start() is invoked after restore-conf phase, then the mbufs allocated in restore-conf phase will leak. So fix it by conditional release Rx ring mbufs in rte_eth_dev_rx_queue_start(): if the Rx ring mbufs were allocated then release them first. This patch also set all sw-ring[]'s mbuf is NULL when release Rx ring mbufs so that we can determine whether the Rx ring mbufs were allocated based only on the first sw-ring[0]'s mbuf. Fixes: fa29fe4 ("net/hns3: support queue start and stop") Signed-off-by: Chengwen Feng <fengchengwen@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
- Loading branch information