Fix sai_thrift_read_port_counters for DNX#14743
Conversation
…from SAI 11.x. Reading this counter may fail to retrieve other counters. To work around the issue, read SAI_PORT_STAT_IN_DROPPED_PKTS count in a separate SAI call.
|
Add @kenneth-arista @arlakshm @vmittal-msft @wenyiz2021 for viz. |
|
@mlok-nokia for viz.. |
| # Read SAI_PORT_STAT_IN_DROPPED_PKTS now and insert the cnt at the correct | ||
| # index in the counter results. | ||
| if asic_type == 'broadcom': | ||
| in_drop_pkts_cnt_id = [SAI_PORT_STAT_IN_DROPPED_PKTS] |
There was a problem hiding this comment.
if BRCM SAI 11.x, SAI_PORT_STAT_IN_DROPPED_PKTS is not supported, will the call to sai_thrift_get_port_stats be successful?
There was a problem hiding this comment.
The counter is supported on Broadcom XGS. On Broadcom DNX, the SAI call will fail. But this does not fail test today since the sai thrift call does not check the return value. So on DNX, test will get count value 0.
There was a problem hiding this comment.
Can we check for broadcom-dnx instead ?
There was a problem hiding this comment.
Hi @vmittal-msft , today the SAI API sai_thrift_read_port_counters takes asic_type as input, which only tells if the asic if broadcom or not. If we need to restrict the change to DNX, we have to pass platform_type to the API, which requires a large scope of fix because the API is used in many places today.
vmittal-msft
left a comment
There was a problem hiding this comment.
Please see if we can ignore this for DNX only using available switch type or asic type.
Hi @vmittal-msft , today the SAI API |
…_PKTS starting from SAI 11.x. (sonic-net#14743) SAI thrift call sai_thrift_read_port_counters() reads a collection of counters together, including SAI_PORT_STAT_IN_DROPPED_PKTS. Starting from BRCM SAI 11.x, SAI_PORT_STAT_IN_DROPPED_PKTS is not supported and retrieving the count may fail SAI call sonic-net/sonic-buildimage#19998. In order to retrieve other counters correctly, read SAI_PORT_STAT_IN_DROPPED_PKTS in a separate SAI call.
|
Cherry-pick PR to 202405: #14867 |
…_PKTS starting from SAI 11.x. (#14743) SAI thrift call sai_thrift_read_port_counters() reads a collection of counters together, including SAI_PORT_STAT_IN_DROPPED_PKTS. Starting from BRCM SAI 11.x, SAI_PORT_STAT_IN_DROPPED_PKTS is not supported and retrieving the count may fail SAI call sonic-net/sonic-buildimage#19998. In order to retrieve other counters correctly, read SAI_PORT_STAT_IN_DROPPED_PKTS in a separate SAI call.
…_PKTS starting from SAI 11.x. (sonic-net#14743) SAI thrift call sai_thrift_read_port_counters() reads a collection of counters together, including SAI_PORT_STAT_IN_DROPPED_PKTS. Starting from BRCM SAI 11.x, SAI_PORT_STAT_IN_DROPPED_PKTS is not supported and retrieving the count may fail SAI call sonic-net/sonic-buildimage#19998. In order to retrieve other counters correctly, read SAI_PORT_STAT_IN_DROPPED_PKTS in a separate SAI call.
…_PKTS starting from SAI 11.x. (sonic-net#14743) SAI thrift call sai_thrift_read_port_counters() reads a collection of counters together, including SAI_PORT_STAT_IN_DROPPED_PKTS. Starting from BRCM SAI 11.x, SAI_PORT_STAT_IN_DROPPED_PKTS is not supported and retrieving the count may fail SAI call sonic-net/sonic-buildimage#19998. In order to retrieve other counters correctly, read SAI_PORT_STAT_IN_DROPPED_PKTS in a separate SAI call.
Description of PR
SAI thrift call sai_thrift_read_port_counters() reads a collection of counters together, including SAI_PORT_STAT_IN_DROPPED_PKTS. Starting from BRCM SAI 11.x, SAI_PORT_STAT_IN_DROPPED_PKTS is not supported and retrieving the count may fail SAI call sonic-net/sonic-buildimage#19998. In order to retrieve other counters correctly, read SAI_PORT_STAT_IN_DROPPED_PKTS in a separate SAI call.
Summary:
Fixes # (issue)
Type of change
Back port request
Approach
What is the motivation for this PR?
How did you do it?
How did you verify/test it?
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation