-
Notifications
You must be signed in to change notification settings - Fork 32
mctpd: update get msg type if vdm is registered #134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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++; | ||
| } | ||
| } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
tests/test_mctpd.py
Outdated
| 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' | ||
|
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
c9aeda9 to
b65f632
Compare
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]>
|
Hi @jk-ozlabs |
|
At a conference at present, will check it out shortly. |
If VDM type support is registered using dbus call RegisterVDMTypeSupport then based
on the format add 7E and 7F in GetMsgType control command response