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

[ycable] add definitions of some new API's for Y-Cable infrastructure #301

Merged
merged 6 commits into from
Sep 17, 2022

Conversation

vdahiya12
Copy link
Contributor

@vdahiya12 vdahiya12 commented Aug 16, 2022

Signed-off-by: vaibhav-dahiya vdahiya@microsoft.com
This PR adds the following API's useful for muxcable MCU's debug, these are added as base class for muxcable API's and implemented by vendor

    def queue_info(self):

        This API should dump all the meaningful data from the eeprom which can
        help vendor debug the queue info currently relevant to the MCU
        using this API the vendor could check how many txns are currently in the queue etc
        for debugging purposes


    def reset_cause(self):

        This API should return the reset cause for the NIC MCU.
        This should help ascertain whether a reset was caused by soft reboot or
        cable poweroff

   

    def operation_time(self):
        This API should return the time since the cable is powered on from NIC MCU side
        This should be helpful in debugging purposes as to if/when the cable has been powered on

 

    def mem_read(self):

        This API should return the memory contents/as well as pointers/counters for DMA or hardware 
        FIFO's which could be useful for debugging the state of the MCU

Description

Motivation and Context

How Has This Been Tested?

Additional Information (Optional)

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@vdahiya12 vdahiya12 requested a review from prgeor August 23, 2022 23:27
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>

raise NotImplementedError

def mem_read(self):
Copy link
Contributor

@xinyulin xinyulin Aug 26, 2022

Choose a reason for hiding this comment

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

def mem_read(self, target, addr, length):

Could we add additional three input parameters:

  • target : local (TOR) or remote (NIC) MCU
  • addr : the starting address of the MCU's memory space
  • length: length to be read, unit: byte

None

Returns:
a Dictionary:
Copy link
Contributor

@xinyulin xinyulin Aug 26, 2022

Choose a reason for hiding this comment

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

Should we return bytearray to represent the data or there is another approach is to convert the data to human readable string and return it as dictionary?

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@vdahiya12 vdahiya12 merged commit fed93df into sonic-net:master Sep 17, 2022
qiluo-msft pushed a commit that referenced this pull request Sep 17, 2022
…#301)

Signed-off-by: vaibhav-dahiya vdahiya@microsoft.com
This PR adds the following API's useful for muxcable MCU's debug, these are added as base class for muxcable API's and implemented by vendor

    def queue_info(self):

        This API should dump all the meaningful data from the eeprom which can
        help vendor debug the queue info currently relevant to the MCU
        using this API the vendor could check how many txns are currently in the queue etc
        for debugging purpose
    def reset_cause(self):

        This API should return the reset cause for the NIC MCU.
        This should help ascertain whether a reset was caused by soft reboot or
        cable poweroff
    def operation_time(self):
        This API should return the time since the cable is powered on from NIC MCU side
        This should be helpful in debugging purposes as to if/when the cable has been powered on
    def mem_read(self):

        This API should return the memory contents/as well as pointers/counters for DMA or hardware 
        FIFO's which could be useful for debugging the state of the MCU
yxieca pushed a commit that referenced this pull request Aug 10, 2023
…#301)

Signed-off-by: vaibhav-dahiya vdahiya@microsoft.com
This PR adds the following API's useful for muxcable MCU's debug, these are added as base class for muxcable API's and implemented by vendor

    def queue_info(self):

        This API should dump all the meaningful data from the eeprom which can
        help vendor debug the queue info currently relevant to the MCU
        using this API the vendor could check how many txns are currently in the queue etc
        for debugging purpose
    def reset_cause(self):

        This API should return the reset cause for the NIC MCU.
        This should help ascertain whether a reset was caused by soft reboot or
        cable poweroff
    def operation_time(self):
        This API should return the time since the cable is powered on from NIC MCU side
        This should be helpful in debugging purposes as to if/when the cable has been powered on
    def mem_read(self):

        This API should return the memory contents/as well as pointers/counters for DMA or hardware 
        FIFO's which could be useful for debugging the state of the MCU
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-platform-common that referenced this pull request Oct 25, 2024
…PI's (sonic-net#301)

This PR adds a try/catch block for some abstract muxcable API's. In particular the exception logic is added for all the API's where there is a possibility for exceptions to be passed by Vendor API's implementation, in this regard ycabled will have all abstract muxcable API's covered by exception logic with this PR.
If the exception is caught it will be just logged and daemon will resume its normal operation.

Description
Motivation and Context
How Has This Been Tested?
Unit-tests and deploying changes on testbed

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants