Skip to content

Conversation

@msnidhin
Copy link
Contributor

@msnidhin msnidhin commented Dec 4, 2025

If VDM type support is registered using dbus call RegisterVDMTypeSupport then based
on the format add 7E and 7F in GetMsgType control command response

src/mctpd.c Outdated
// Allocate extra space for the message types
resp_len = sizeof(*resp) + type_count;
// Allocate extra space for the message types. Also two byte for PCIe or IANA VDM
resp_len = sizeof(*resp) + type_count + sizeof(uint16_t);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but there is no uint16_t involved here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

msg_types[type_count++] = MCTP_TYPE_VENDOR_IANA;
resp_len++;
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if someone has already registered 7e/7f ?

Doing the find (setting the booleans) and message construction (setting msg_types) in the same place is a bit unusual.

If you're taking the approach that 7e/7f do not appear in the supported_message_types array, then I would suggest detecting their presence earlier (ie, iterating supported_vdm_types there), which means you can then allocate exactly the correct size message, then do the message construction later, based on the earlier detection.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think 7e or 7f can come in supported_message_types .
Updates the checks

cmd = MCTPControlCommand(True, 0, 0x05, bytes([0x00]))
rsp = await ep.send_control(mctpd.network.mctp_socket, cmd)
assert rsp.hex(' ') == '00 05 00 04 00 05 7e 7f'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be good to also test that the type is removed after unregistration, but you could also do that in the original unregistration test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the newly added test. Updated VDM test

If VDM type support is registered using dbus call
RegisterVDMTypeSupport then add 7E and 7F based on the format in
GetMsgType control command response

Signed-off-by: Nidhin MS <[email protected]>
@msnidhin
Copy link
Contributor Author

Hi @jk-ozlabs
Can you please revisit and provide feedback

@jk-ozlabs
Copy link
Member

At a conference at present, will check it out shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants