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

Update PTP usage of secondary dedicated mailbox #45

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ssamudrala
Copy link
Contributor

Clarify the usage of secondary dedicated mailbox in the PTP offload section of the spec and update the virtchnl2 header file.

@@ -6487,7 +6487,7 @@ Flow here is for first the driver to learn what Device capabilities are being gr
7. A driver will do the Initialization of the Device PHC. Depending on the CPU complex trust level this capability may or may not be given to the driver instance by the Device Control. The opcode used for setting of the Device clock indirectly is VIRTCHNL2_OP_PTP_SET_DEVICE_CLK_TIME.
8. If the access is a direct access for setting the clock, then the Driver may have to adjust both the Device PHC clock as well as the Phy clock if the the Device PHC and Phy clock are not automatically synchornized. If done over mailbox the Device Control needs to do the same.
9. At this point the driver registers a PTP clock device with the SW stack for PTP runtime callbacks.
10. A driver may also configure a separate dedicated mailbox (secondary mailbox) for doing the indirect access such as for Tx Timestamping, adjusting the Device PHC etc. The way the Device control indicates to the driver to use a dedicated secondary mailbox or not is again through the PTP capability negotiation data structures setting the flag (secondary_mbx) for driver to do the right setup. After the initial capability exchange over the default mailbox, if the Device Control suggests using a secondary mailbox, the driver sets up a secondary mailbox using the default mailbox and then switches to use secondary mailbox for any PTP related operations.
10. A driver may also configure a separate dedicated mailbox(secondary mailbox) for doing the indirect access to enable features such as Tx Timestamping, adjusting the Device PHC etc. The CP indicates to the driver to use a dedicated secondary mailbox or not through the PTP capability negotiation data structure by setting the mbx_q_index field. After the initial capability exchange over the default mailbox, if the CP suggests using a secondary mailbox, the driver sets up a secondary mailbox using the default mailbox and then switches to use secondary mailbox for any PTP related operations. If CP supports allocation of PF/VF secondary MBXs dedicated for PTP, mbx_q_index will hold a non-zero value. If mbx_q_index is non-zero, driver should allocate secondary MBX queue for PTP. Driver should pass mbx_q_index received in the PTP_GET_CAPS response as mbx_q_index and qtype as VIRTCHNL2_QUEUE_TYPE_MBX_TX/RX in the ADD_QUEUES request to inform CP to allocate new PF/VF MBX queue meant for PTP handling.
Copy link

@mwolech mwolech Jan 8, 2025

Choose a reason for hiding this comment

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

Can we add more details about the flow?

To my best knowledge, ADD_QUEUES is only one of the first steps of the sequence.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added additional steps required to configure/enable/map the queues to use the secondary mailbox. Please review and let me know any other steps i am missing.

Clarify the usage of secondary dedicated mailbox in the PTP offload
section of the spec and update the virtchnl2 header file.

Signed-off-by: Sridhar Samudrala <[email protected]>
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.

3 participants