> -----Original Message----- > From: Ferruh Yigit [mailto:[email protected]] > Sent: Tuesday, September 15, 2020 10:53 PM > To: wangyunjian <[email protected]>; [email protected] > Cc: [email protected]; Lilijun (Jerry) <[email protected]>; xudingke > <[email protected]> > Subject: Re: [dpdk-dev] [PATCH] net/tap: release port upon close > > On 8/28/2020 1:37 PM, wangyunjian wrote: > > From: Yunjian Wang <[email protected]> > > > > Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the private resources > > for the port can be freed by rte_eth_dev_close(). > > > > Signed-off-by: Yunjian Wang <[email protected]> > > <...> > > > @@ -1040,6 +1044,9 @@ tap_dev_close(struct rte_eth_dev *dev) > > struct pmd_process_private *process_private = dev->process_private; > > struct rx_queue *rxq; > > > > + if (process_private == NULL) > > + return; > > Why this check is required?
When user first call 'close()' and later call 'remove()' the tap PMD, in this case, the tap_dev_close() will be called twice. The second call of tap_dev_close() shouldn't do any process, we can use this check to return immediately. Thanks, Yunjian

