DPDK patches and discussions
 help / color / mirror / Atom feed
* net/failsafe: segfault happens on hotplug alarm.
@ 2024-09-05 16:07 Edwin Brossette
  0 siblings, 0 replies; only message in thread
From: Edwin Brossette @ 2024-09-05 16:07 UTC (permalink / raw)
  To: dev; +Cc: Didier Pallard, Olivier Matz, Laurent Hardy, grive

[-- Attachment #1: Type: text/plain, Size: 1618 bytes --]

Hello,

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.

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:
https://git.dpdk.org/dpdk/tree/drivers/net/failsafe/failsafe_ether.c#n276

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:
https://mails.dpdk.org/archives/dev/2022-November/256898.html

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.

Perhaps someone could look into it?

Regards,
Edwin Brossette.

[-- Attachment #2: Type: text/html, Size: 1866 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-09-05 16:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-05 16:07 net/failsafe: segfault happens on hotplug alarm Edwin Brossette

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).