<div dir="ltr">Hello,<br><br>I recently ran into an issue when using DPDK's failsafe pmd on a Microsoft Azure setup. On this setup, I have the failsafe pmd managing a netvsc interface with a Mellanox nic (which can be used through the hardware acceleration feature). A segfault is sometimes seen whenever I unplug the Mellanox device, which is a case that should be handled by the pmd. On a more recent DPDK version (I tested with stable v23.11.1), this segfault is systematic.<br><br>This seems to happen because the function rte_eth_dev_release_port() is called twice when the hotplug_alarm triggers. You can see it in this bit of code here:<br><a href="https://git.dpdk.org/dpdk/tree/drivers/net/failsafe/failsafe_ether.c#n276">https://git.dpdk.org/dpdk/tree/drivers/net/failsafe/failsafe_ether.c#n276</a><br><br>In the fs_dev_remove() function, the rte_eth_dev_close() calls run the rte_eth_dev_release_port() the first time, and it is then called a second time when handling the DEV_PROBED case. I noticed when searching into the mailing list that this problem was already seen once and a patch was suggested. Here is the link to the mail:<br><a href="https://mails.dpdk.org/archives/dev/2022-November/256898.html">https://mails.dpdk.org/archives/dev/2022-November/256898.html</a><br><br>Applying this patch on my local branched fixed the issue on my end although I cannot attest for sure that it is the best possible fix. I could see a memory leak happening if the fs_dev_remove() function was called as sdev->state == DEV_PROBED, as the release would never be done. But it is still weird that if sdev->state == DEV_STARTED, we do rte_eth_dev_release_port() first then rte_dev_remove(), and if sdev->state == DEV_PROBED, we call them in the opposite order.<br><br>Perhaps someone could look into it?<br><br>Regards,<br>Edwin Brossette.<br></div>