Skip to content

Use Vendor message types for mctp-bench, mctp-echo #72

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mkj
Copy link
Member

@mkj mkj commented Apr 28, 2025

Previously PLDM message type (1) was being used, but it would be better to use a specific type that won't conflict with other uses.

This could still clash with other vendor types, pending future kernel support to distinguish those.

mkj added 2 commits May 15, 2025 12:45
mctp-bench now uses a distinct message type instead of PLDM.

Signed-off-by: Matt Johnston <[email protected]>
mctp-req and mctp-echo now use a distinct message type instead of PLDM.
The length argument is the length of the "payload", with an additional
3 bytes added for message type.

The first buffer byte is no longer printed (it would be incorrect for
len=0 regardless).

Signed-off-by: Matt Johnston <[email protected]>
@mkj mkj force-pushed the dev/matt/vendor-msg-type branch from 756a308 to 47042a8 Compare May 15, 2025 04:45
@mkj mkj requested a review from jk-ozlabs May 15, 2025 05:11
@@ -116,6 +121,12 @@ static int handle_incoming_msg(struct recv_ctx *recv_ctx)
}

hdr = (struct msg_header *)recv_ctx->buf;
if (memcmp(hdr->vendor_prefix, VENDOR_TYPE_BENCH, sizeof(VENDOR_TYPE_BENCH)) != 0) {
Copy link
Member

Choose a reason for hiding this comment

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

We should check that we have at least sizeof(VENDOR_TYPE_BENCH).

But I guess we're not checking that we have a full header either; we should probably add that, before the initial (struct msg_header *) cast.

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