Skip to content
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

Tag owner bit in Request message #64

Closed
chandu-tmba opened this issue Feb 14, 2025 · 6 comments
Closed

Tag owner bit in Request message #64

chandu-tmba opened this issue Feb 14, 2025 · 6 comments
Labels
kernel Related to Linux kernel mctp stack question Further information is requested

Comments

@chandu-tmba
Copy link

I am working on sending a request from the BMC, and I want to utilize my own tag rather than the tag generated by the kernel. For this request, I am using:

addrlen = sizeof(struct sockaddr_mctp_ext);
addr.smctp_base.smctp_family = AF_MCTP;
addr.smctp_base.smctp_network = MCTP_NET_ANY;
addr.smctp_base.smctp_type = MCTP_CTRL_TYPE;
addr.smctp_halen = I3C_PID_SIZE;
addr.smctp_ifindex = ifaceindex;
uint8_t tag = 0x05;
addr.smctp_base.smctp_tag = tag & MCTP_TAG_MASK;

Is this approach correct?

@jk-ozlabs
Copy link
Member

Is this approach correct?

It will work, provided this is a non-owned tag (ie, TO is not set).

Given you're using a tag value of 0x05, this will send a message with the tag value of 0x05, which indicates a non-owned tag.

However, you also say:

I am working on sending a request from the BMC

If this is a request from the BMC, you will need the TO bit set, in which case your code is not correct.

@chandu-tmba
Copy link
Author

thanks

@chandu-tmba
Copy link
Author

chandu-tmba commented Feb 18, 2025

@jk-ozlabs so if i want to create my own tag and send request with my own tag(i am the tag owner and i will set tag owner bit)

its not possible in existing mctp sockets ?

@jk-ozlabs
Copy link
Member

You cannot specify your own tag if you need the TO bit set.

The kernel is responsible for owned-tag allocation, and the tag you specify may conflict with tags that the kernel has allocated. So, we do not permit arbitrary TO=1 tags to be specified here.

Can I ask why you're trying to use your own tag here?

@jk-ozlabs jk-ozlabs reopened this Feb 19, 2025
@jk-ozlabs jk-ozlabs added question Further information is requested kernel Related to Linux kernel mctp stack labels Feb 20, 2025
@chandu-tmba
Copy link
Author

i am trying to use libmctp , there tag handling is done by library

@jk-ozlabs
Copy link
Member

You should not be using libmctp if you are using the Linux kernel MCTP implementation.

libmctp is intended for stand-alone environments - typically embedded - where the entire MCTP stack is implemented in the one library. This is not the case when using the Linux MCTP stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel Related to Linux kernel mctp stack question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants