Skip to content

Questions about device identification and re-initialization after FPGA hot-plugging #68

@yanweitao

Description

@yanweitao

Hi Ulf,
I am implementing a system using multiple FPGA devices with LeechCore, and I have some concerns regarding hardware stability and device management when a device is power-cycled or re-plugged.

Current Setup:
I am using the connection string format: -device fpga://devindex=n.

Context:
I am using the connection string format: -device fpga://devindex=1. In my setup, the FPGA device might occasionally be unplugged and replugged.

Questions:

  1. devindex Persistence: If an FPGA device is unplugged and replugged, will the devindex remain persistent, or is it subject to change based on the OS enumeration order?
  2. Handle Invalidation: Once a hardware disconnection occurs, do the existing VMM/LeechCore handles for that specific device become completely invalid? Is a full re-initialization (destroying and re-creating objects) the recommended recovery path?
  3. The Index Shifting Problem: If I have multiple devices connected and one of them is disconnected, the devindex of the remaining active devices might shift (e.g., Device 2 becomes Device 1).
    In this case, even if the VMM objects for the "stable" devices still seem to work, how should I handle the reconnection?
    If I need to re-initialize the disconnected device, how can I ensure I am binding to the correct physical hardware if the indices have changed?
  4. Unique Identification: Since the Wiki doesn't explicitly mention a way to connect via a Serial Number or UUID, is there a hidden parameter or a way to query a unique hardware ID from a live VMM handle? This would allow me to verify the mapping between VMM objects and physical devices regardless of their devindex.
  5. Best Practices: What is the most robust way to detect a disconnection and automate the recovery/re-mapping process within the current API?

Thank you for your time and for this amazing project!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions