Skip to content

mctp interface removal/reattach (hotplug devices), doesnt update nl_query structure #73

@faizana-nvidia

Description

@faizana-nvidia

We are working on MCTPoUSB binding, where we were testing for hot pluggability nature for USB devices.

Setup : FPGA over USB with downstream devices attached
Experiment details:
1 ) unbind the usb device from mctp driver, causing interface mctpusb0 removal. This action also purges out local eid along with deletion of interface data.

mctpd[19435]: Removing local eid 8 net 1
mctpd[19435]: mctpd: emit_endpoint_removed: /au/com/codeconstruct/mctp1/networks/1/endpoints/8
mctpd[19435]: Deleting interface #3

2 ) rebind the driver and let mctpusb0 come up again, later using mctp tool to put the link state for mctpusb0 to up state

mctpd: Warning, interface mctpusb0 is down
Adding interface #5 mctpusb0

  1. Try AssignEndpointStatic command to assign peer eid. Seeing failure in seeing up route point for new peer eid under the failure reason of not recognising new interface index

failure : mctpd: BUG peer_route_update: Unknown ifindex 5

Problem
Checking the code base shows peer_route_update() checks for linkmap data based on interface index from nl_query structure which won't get updated since all the NETLINK relevant evnts are addressed on ctx->nl structure.

from looks of things nl_query only got synced during early init time and remains keeping old linkmap data through the service life.

Need some help in understanding the real intention behind keeping two copies of linkmap data via nl and nl_query structure? Would there be any possibility to integrate synchronization aspect of the two structures in oder to tackled scenarios like hotplug where interface index and other relevant aspect could change?

struct ctx {
sd_event *event;
sd_bus *bus;

// Configuration
const char *config_filename;

// Main instance for link/address state and listening for updates
mctp_nl *nl;

// Second instance for sending mctp socket requests. State is unused.
mctp_nl *nl_query;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions