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

@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.

Copy link
Member

@jk-ozlabs jk-ozlabs left a comment

Choose a reason for hiding this comment

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

There seems to a conflict with registering 0x7e / 0x7f directly here.

I think we may want to prohibit 0x7e/0x7f from appearing in the supported_msg_types array, and hence also being registered through the RegisterTypeSupport dbus method. If a client wants to register a vendor type, we really need the extra information to appear in the Get Vendor Message Types response.

src/mctpd.c Outdated
Comment on lines 998 to 1003
for (i = 0; i < ctx->num_supported_msg_types; i++) {
pcie_support |= (ctx->supported_msg_types[i].msg_type ==
MCTP_TYPE_VENDOR_PCIE);
iana_support |= (ctx->supported_msg_types[i].msg_type ==
MCTP_TYPE_VENDOR_IANA);
}
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't this duplicate the entries for 0x7e/0x7f in the response?

Copy link
Contributor Author

@msnidhin msnidhin Dec 17, 2025

Choose a reason for hiding this comment

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

It should not.. since pcie_support and iana_support will be either true or false at the end
Let me add a unit test for two PCIe VDMs

@msnidhin msnidhin force-pushed the get_msg_type_vdm branch 2 times, most recently from 120b5e8 to 7448d19 Compare December 17, 2025 12:39
@msnidhin msnidhin requested a review from jk-ozlabs December 17, 2025 12:40
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 <nidhin.ms@intel.com>
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