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

Cable diagnostics attribute added #1894

Merged
merged 4 commits into from
Jan 10, 2024
Merged

Conversation

prafull-brcm
Copy link
Contributor

@prafull-brcm prafull-brcm commented Sep 8, 2023

Cable diagnostics is required when the characteristics of the problems associated with a cable become of paramount concern when a link cannot be established or is performing poorly.
Enhanced Cable Diagnostics (ECD) provides with intelligent pre-processing and post-processing algorithm inside HW that can be initiated at any time by setting specific register bits and then reading the results.
Usage of the attribute:
sai_attr_set[0].id = SAI_PORT_ATTR_CABLE_TYPE;
sai_attr_set[0].value.s32 = SAI_PORT_CABLE_TYPE_CAT6;
ret = create_port(&port_id_0, phy_2_switch_id, 2, sai_attr_set);
or Cable type can be set latter also using set port attribute function if port is already created.
sai_attr_set.id = SAI_PORT_ATTR_CABLE_TYPE;
sai_attr_set.value.s32 = SAI_PORT_CABLE_TYPE_CAT6;
set_port_attribute(port_id_0, &sai_attr_set);

Cable pair status and cable length is read only attribute, can be called anytime.
sai_attr_get.id = SAI_PORT_ATTR_CABLE_PAIR_STATE;
ret = get_port_attribute(port_id_0,1, &sai_attr_get);
Note: Please note that cable diagnostics is debug feature it puts chip in debug mode user needs to re-configure the mode and auto-negotiation after cable pair status and cable length attribute is requested to work in normal mode.

Signed-off-by: Prafull Singh <56103377+prafull-brcm@users.noreply.github.com>
@kcudnik
Copy link
Collaborator

kcudnik commented Sep 8, 2023

please fix build errors

Signed-off-by: Prafull Singh <56103377+prafull-brcm@users.noreply.github.com>
@prafull-brcm
Copy link
Contributor Author

please fix build errors

Fixed

@rlhui
Copy link
Collaborator

rlhui commented Sep 21, 2023

please add description of this PR with motivation, thanks.

@prafull-brcm
Copy link
Contributor Author

prafull-brcm commented Oct 12, 2023

@lguohan
Copy link
Collaborator

lguohan commented Oct 19, 2023

@jiahua-wang , @prafull-brcm ,

  1. please change the doc to md format and incoporate this into the PR.
  2. can you clarify the example, make the create_port optional. as my understand, we can also set the port cable type to CAT6.
  3. as my understanding, the diagnostic process happened during the query for the attributes. when you query status, it runs on diagnose once, when you try to get length, it will run another time.

@prafull-brcm
Copy link
Contributor Author

prafull-brcm commented Oct 20, 2023

@jiahua-wang , @prafull-brcm ,

  1. please change the doc to md format and incoporate this into the PR.
  2. can you clarify the example, make the create_port optional. as my understand, we can also set the port cable type to CAT6.
  3. as my understanding, the diagnostic process happened during the query for the attributes. when you query status, it runs on diagnose once, when you try to get length, it will run another time.
    @lguohan
  1. I incorporated the the document in the PR in md format
  2. I mentioned in example that using set property cable type can be set.
  3. Yes it is correct, Run diagnostics command runs for both cable pair status and cable length in this case but it is implementation specific. The cable length information can be cached once Cable Pair status is requested, it can be read at the same time and can be stored to read latter.

@prafull-brcm
Copy link
Contributor Author

@lguohan
Updated the documentation in proper md format.

Signed-off-by: Prafull Singh <56103377+prafull-brcm@users.noreply.github.com>
become of paramount concern when a link cannot be established or is
performing poorly.

Enhanced Cable Diagnostics (ECD) provides with intelligent
Copy link
Contributor

Choose a reason for hiding this comment

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

@prafull-brcm where is ECD implemented on the hardware? On the ASIC? Serdes core?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@prgeor ECD is implemented inside the PHY chip HW.

* @brief Attribute data for #SAI_PORT_ATTR_CABLE_TYPE
* Copper cable types
*/
typedef enum _sai_port_cable_type_t
Copy link
Contributor

Choose a reason for hiding this comment

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

@prafull-brcm how does the platform detect cable type of the plugged DAC cable? From the cable eeprom? i could not find this in any SFF spec

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@prgeor Cable type information need to be provided by the user, it is not automatically detected. If no information is provided it takes cable type as Unknown.

* @type sai_s32_list_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_CABLE_PAIR_LENGTH,
Copy link
Contributor

Choose a reason for hiding this comment

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

@prafull-brcm is it the length of the DAC/copper cable? If not, what exactly is this length indicate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@prgeor It indicates copper cable length for example twisted wire pairs, coaxial cables with tolerance of +-1meter

@rlhui rlhui merged commit b8482a1 into opencomputeproject:master Jan 10, 2024
3 checks passed
saiarcot895 added a commit to saiarcot895/sonic-sairedis that referenced this pull request Jan 26, 2024
The primary purpose of this is to bring in support for compiling on
Debian Bookworm.

This brings in the following changes:
* Update the Doxyfile for doxygen in Debian Bookworm (opencomputeproject/SAI#1946)
* Enable sai_uint16_t in ProcessStructValueType Struct Member (opencomputeproject/SAI#1949)
* [meta] Add support for port stat extensions (opencomputeproject/SAI#1947)
* [meta] Add custom range start end values check (opencomputeproject/SAI#1945)
* Cable diagnostics attribute added (opencomputeproject/SAI#1894)
* Add attributes to disable L3 rewrites (opencomputeproject/SAI#1924)
* Add MAC remote loopback to the port loopback enums. (opencomputeproject/SAI#1934)
* [TAM] Granular counter subscription (opencomputeproject/SAI#1670)

Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
JaiOCP pushed a commit to JaiOCP/SAI that referenced this pull request Mar 7, 2024
Cable diagnostics is required when the characteristics of the problems associated with a cable become of paramount concern when a link cannot be established or is performing poorly.
Enhanced Cable Diagnostics (ECD) provides with intelligent pre-processing and post-processing algorithm inside HW that can be initiated at any time by setting specific register bits and then reading the results.

Signed-off-by: Prafull Singh <56103377+prafull-brcm@users.noreply.github.com>
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.

5 participants