-
Notifications
You must be signed in to change notification settings - Fork 20
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
Make mctp-req generic #6
base: main
Are you sure you want to change the base?
Make mctp-req generic #6
Conversation
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.
Looks good: a couple of fixups mentioned in the code though.
I think we should simplify the user interface for this a little - I'd suggest making the data
argument mandatory (sending sequential bytes was handy while bringing up the kernel interface, but now that's done, it's no longer very useful). That means we could drop the len
argument too (since we can calculate that from the data argument). I'm also fine with making the type
argument mandatory too - assuming PLDM is a bit strange (again, this was from the kernel bringup, where we just needed an arbitrary type value).
Then, we would no longer need the conditional code in the mctp_req()
function that re-uses the rxbuf
, and just always use separate buffers for tx & rx.
88d0816
to
985df80
Compare
Added a new commit to install the systemd units. |
That would be better as a separate PR. |
@leiyu-bytedance just wanted to check-in on this - anything pending from your side? |
Oh, we totally missed this. |
The usage description is missing the `data` argument, add it and an example of how it is used. Signed-off-by: Lei YU <[email protected]>
The mctp-req was acting like a echo client that sends and receive the same data. Change the code to make it a generic sender and receiver, so that user could use it to send all types of data and prints the received data. * Add a `type` argument to specify the mctp type, default to 1 (PLDM). * Remove the code that expects the same len and data for sent and received data. * Add print of the received data. Tested: Get UUID of an endpoint: $ mctp-req eid 9 type 0 data 80:03 req: sending to (net 1, eid 9), type 0, len 2 req: message from (net 1, eid 9) type 0 len 19 data: 0x00 0x03 0x00 0x7e 0x92 0x05 0xfc 0x01 0xc2 0xeb 0x11 0x80 0x00 0xb8 0xce 0xf6 0xae 0xcd 0x16 Signed-off-by: Lei YU <[email protected]>
b2ccdf2
to
93f45c9
Compare
|
@leiyu-bytedance The new branch lost some requested change above, you may want to review them again. |
No description provided.