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

[debugcounterorch] check if counter type is supported before querying… #1789

Merged
merged 3 commits into from
Jul 20, 2021

Conversation

stepanblyschak
Copy link
Contributor

… object availability count

Signed-off-by: Stepan Blyschak stepanb@nvidia.com

DEPENDS: sonic-net/sonic-sairedis#842
ALSO: sonic-net/sonic-sairedis#843

What I did

Implemented check for debug counter type support prio to querying unsupported counter type availablility counter.

Why I did it
This is done in order to prevent error message seen on mellanox platform:

Mar 11 16:28:42.945332 ptr-sonic-n2-t3 ERR syncd#SDK: [SAI_DEBUG_COUNTER.ERR] mlnx_sai_debug_counter.c[324]- mlnx_debug_counter_availability_get: Unsupported debug counter type - 1
Mar 11 16:28:42.948092 ptr-sonic-n2-t3 ERR syncd#SDK: [SAI_DEBUG_COUNTER.ERR] mlnx_sai_debug_counter.c[324]- mlnx_debug_counter_availability_get: Unsupported debug counter type - 0

How I verified it

  1. Run on mellanox and observe no errors.
  2. Run VS test for debug counters:
tests/test_drop_counters.py::TestDropCounters::test_deviceCapabilitiesTablePopulated PASSED               [  6%]
tests/test_drop_counters.py::TestDropCounters::test_flexCounterGroupInitialized PASSED                    [ 12%]
tests/test_drop_counters.py::TestDropCounters::test_createAndRemoveDropCounterBasic PASSED                [ 18%]
tests/test_drop_counters.py::TestDropCounters::test_createAndRemoveDropCounterReversed PASSED             [ 25%]
tests/test_drop_counters.py::TestDropCounters::test_createCounterWithInvalidCounterType PASSED            [ 31%] 
tests/test_drop_counters.py::TestDropCounters::test_createCounterWithInvalidDropReason PASSED             [ 37%]
tests/test_drop_counters.py::TestDropCounters::test_addReasonToInitializedCounter PASSED                  [ 43%]
tests/test_drop_counters.py::TestDropCounters::test_removeReasonFromInitializedCounter PASSED             [ 50%]
tests/test_drop_counters.py::TestDropCounters::test_removeAllDropReasons PASSED                           [ 56%]
tests/test_drop_counters.py::TestDropCounters::test_addDropReasonMultipleTimes PASSED                     [ 62%]
tests/test_drop_counters.py::TestDropCounters::test_addInvalidDropReason PASSED                           [ 68%]
tests/test_drop_counters.py::TestDropCounters::test_removeDropReasonMultipleTimes PASSED                  [ 75%]
tests/test_drop_counters.py::TestDropCounters::test_removeNonexistentDropReason PASSED                    [ 81%]
tests/test_drop_counters.py::TestDropCounters::test_removeInvalidDropReason PASSED                        [ 87%]
tests/test_drop_counters.py::TestDropCounters::test_createAndDeleteMultipleCounters PASSED                [ 93%]
tests/test_drop_counters.py::test_nonflaky_dummy PASSED                                                   [100%]

Details if related

… object availability count

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
SAI_DEBUG_COUNTER_ATTR_TYPE);
if (!meta)
{
SWSS_LOG_THROW("SAI BUG: metadata null pointer returned by "
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please specify ERROR log and return. No need to throw here. Same for below case as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
@liat-grozovik
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liat-grozovik
Copy link
Collaborator

@prsunny could you please review following the fix provided?

@liat-grozovik
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liat-grozovik
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@stepanblyschak
Copy link
Contributor Author

stepanblyschak commented Jun 24, 2021

Does pipeline run with latest VS lib implementation?

@liat-grozovik
Copy link
Collaborator

@prsunny can you please review and approve?

@liat-grozovik
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liat-grozovik
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@stepanblyschak
Copy link
Contributor Author

/azpw run

@liat-grozovik
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prsunny prsunny merged commit ed6786d into sonic-net:master Jul 20, 2021
qiluo-msft pushed a commit that referenced this pull request Jul 20, 2021
#1789)

* [debugcounterorch] check if counter type is supported before querying object availability count
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
@prsunny
Copy link
Collaborator

prsunny commented Jul 21, 2021

@qiluo-msft, @liat-grozovik , I'm not sure why this alone was marked for 202012. Is this required to be backported? If so, I see that there are dependent PRs in sairedis.

@qiluo-msft
Copy link
Contributor

@liat-grozovik Please let me know if this is not required for 202012.

qiluo-msft pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Jul 30, 2021
Update submodule for swss

f54b7d0b [Dynamic Buffer Calc][202012]Bug fix: Don't create lossless buffer profile for active ports without speed configured (sonic-net/sonic-swss#1820)
ac7f5cff Td2: Reclaim buffer from unused ports (sonic-net/sonic-swss#1830)
04105a4b [debugcounterorch] check if counter type is supported before querying (sonic-net/sonic-swss#1789)
a67d8af6 [202012][portsorch] fix errors when moving port from one lag to another. (sonic-net/sonic-swss#1819)
lguohan pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Jul 31, 2021
This PR includes the following commits

a67d8af [202012][portsorch] fix errors when moving port from one lag to another (sonic-net/sonic-swss#1819)
04105a4 [debugcounterorch] check if counter type is supported before querying (sonic-net/sonic-swss#1789)
ac7f5cff Td2: Reclaim buffer from unused ports (sonic-net/sonic-swss#1830)
f54b7d0 [Dynamic Buffer Calc][202012]Bug fix: Don't create lossless buffer profile for active ports without speed configured  (sonic-net/sonic-swss#1820)

Signed-off-by: Neetha John <nejo@microsoft.com>
vaibhavhd added a commit to sonic-net/sonic-buildimage that referenced this pull request Aug 3, 2021
Update sonic-swss submodule head to include below fixes:

Ignore ALREADY_EXIST error in FDB creation (sonic-net/sonic-swss#1815)
Update MACsec SA PN counter to support SAI API 1.8 (sonic-net/sonic-swss#1818)
[swss]: Allow portsyncd to run on system without ports (sonic-net/sonic-swss#1808)
[debugcounterorch] check if counter type is supported before querying… (sonic-net/sonic-swss#1789)
[configure.ac] Add the option of passing libnl path to configure script (sonic-net/sonic-swss#1824)
refactor(fdbsyncd): Convert files with dos2unix (sonic-net/sonic-swss#1828)
[VS] Fix for VS test failures (sonic-net/sonic-swss#1836)
Td2: Reclaim buffer from unused ports (sonic-net/sonic-swss#1830)
[gearbox] Set context for phys based on configs (sonic-net/sonic-swss#1826)
[Dynamic Buffer Calc] Bug fix: Don't create lossless buffer profile for active ports without speed configured (sonic-net/sonic-swss#1822)
Bridge mac setting, fix statedb time format (sonic-net/sonic-swss#1844)
[cfgmgr]: Introduce common libs. (sonic-net/sonic-swss#1842)
carl-nokia pushed a commit to carl-nokia/sonic-buildimage that referenced this pull request Aug 7, 2021
…t#8313)

Update sonic-swss submodule head to include below fixes:

Ignore ALREADY_EXIST error in FDB creation (sonic-net/sonic-swss#1815)
Update MACsec SA PN counter to support SAI API 1.8 (sonic-net/sonic-swss#1818)
[swss]: Allow portsyncd to run on system without ports (sonic-net/sonic-swss#1808)
[debugcounterorch] check if counter type is supported before querying… (sonic-net/sonic-swss#1789)
[configure.ac] Add the option of passing libnl path to configure script (sonic-net/sonic-swss#1824)
refactor(fdbsyncd): Convert files with dos2unix (sonic-net/sonic-swss#1828)
[VS] Fix for VS test failures (sonic-net/sonic-swss#1836)
Td2: Reclaim buffer from unused ports (sonic-net/sonic-swss#1830)
[gearbox] Set context for phys based on configs (sonic-net/sonic-swss#1826)
[Dynamic Buffer Calc] Bug fix: Don't create lossless buffer profile for active ports without speed configured (sonic-net/sonic-swss#1822)
Bridge mac setting, fix statedb time format (sonic-net/sonic-swss#1844)
[cfgmgr]: Introduce common libs. (sonic-net/sonic-swss#1842)
prsunny added a commit to prsunny/sonic-swss that referenced this pull request Aug 25, 2021
qiluo-msft pushed a commit that referenced this pull request Aug 26, 2021
raphaelt-nvidia pushed a commit to raphaelt-nvidia/sonic-swss that referenced this pull request Oct 5, 2021
sonic-net#1789)

* [debugcounterorch] check if counter type is supported before querying object availability count
Signed-off-by: Stepan Blyschak <stepanb@nvidia.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.

4 participants