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

[orchagent] Add trap flow counter support #1951

Merged
merged 9 commits into from
Dec 1, 2021

Conversation

Junchao-Mellanox
Copy link
Collaborator

@Junchao-Mellanox Junchao-Mellanox commented Oct 11, 2021

Added new VS test case in this PR, and the new VS test case requires #1967 and sonic-net/sonic-sairedis#954

What I did

Add trap flow counter support. See HLD: sonic-net/SONiC#858

Why I did it

Flow counters are usually used for debugging, troubleshooting and performance enhancement processes. Host interface trap counter can get number of received traps per Trap ID.

How I verified it

Manual test/VS test/sonic mgmt test

Details if related

@Junchao-Mellanox
Copy link
Collaborator Author

Build dependency: sonic-net/sonic-swss-common#534

@prsunny
Copy link
Collaborator

prsunny commented Oct 12, 2021

@dgsudharsan for review

orchagent/flow_counter/flow_counter_handler.cpp Outdated Show resolved Hide resolved
orchagent/copporch.cpp Outdated Show resolved Hide resolved
orchagent/copporch.cpp Outdated Show resolved Hide resolved
orchagent/copporch.h Outdated Show resolved Hide resolved
orchagent/copporch.h Outdated Show resolved Hide resolved
orchagent/copporch.cpp Outdated Show resolved Hide resolved
orchagent/flexcounterorch.cpp Outdated Show resolved Hide resolved
@dgsudharsan
Copy link
Collaborator

@Junchao-Mellanox Can you please check the recent changes made based on the comment #1859 (comment)
Please check this commit for reference 7ddb0ab

@Junchao-Mellanox
Copy link
Collaborator Author

@Junchao-Mellanox Can you please check the recent changes made based on the comment #1859 (comment) Please check this commit for reference 7ddb0ab

Hi @dgsudharsan , fixed, could you please review and sign off?

dgsudharsan
dgsudharsan previously approved these changes Nov 1, 2021
dgsudharsan
dgsudharsan previously approved these changes Nov 3, 2021
keboliu
keboliu previously approved these changes Nov 17, 2021
orchagent/flow_counter/flow_counter_handler.cpp Outdated Show resolved Hide resolved
orchagent/copporch.cpp Outdated Show resolved Hide resolved
dgsudharsan
dgsudharsan previously approved these changes Nov 23, 2021
dgsudharsan
dgsudharsan previously approved these changes Nov 24, 2021
@Junchao-Mellanox
Copy link
Collaborator Author

/AzurePipelines run Azure.sonic-swss

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 1951 in repo Azure/sonic-swss

@xumia
Copy link
Collaborator

xumia commented Nov 26, 2021

/AzurePipelines run Azure.sonic-swss

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@xumia
Copy link
Collaborator

xumia commented Nov 26, 2021

@Junchao-Mellanox , if you want to trigger a check rerun, please try to use "/azpw run Azure.sonic-swss"

@Junchao-Mellanox
Copy link
Collaborator Author

Hi @xumia, sure, thanks.

extern bool gIsNatSupported;

#define FLEX_COUNTER_UPD_INTERVAL 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please change this to 10.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This interval here is the timer to add flex counter to flex DB, it is not the query interval.

Copy link
Collaborator

Choose a reason for hiding this comment

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

But this is the interval where the select gets triggered, right? So why select this every 1 sec?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Here we use a timer to timely add flex counter to FLEX COUNTER DB due to comment: #1859 (comment) . We set the interval 1 here because we want flex counter to be created as soon as possible. It won't cost much CPU because:

  • the timer will be started when the first item is added to queue "m_pendingAddToFlexCntr"
  • when the queue "m_pendingAddToFlexCntr" is empty, the timer will be stopped

Please check copporch.cpp line 770:

    auto was_empty = m_pendingAddToFlexCntr.empty();
    m_pendingAddToFlexCntr[counter_id] = trap_name;

    if (was_empty)
    {
        m_FlexCounterUpdTimer->start();
    }

and copporch.cpp line 1229

    if (m_pendingAddToFlexCntr.empty())
    {
        m_FlexCounterUpdTimer->stop();
    }

@prsunny
Copy link
Collaborator

prsunny commented Nov 29, 2021

@Junchao-Mellanox , I think we have discussed this before, please do not "close" and "reopen" the PR multiple times. It is not clear whether you really want to close the PR without merging. If the intention is to to retrigger tests, please do "/azpw run".

@Junchao-Mellanox
Copy link
Collaborator Author

@Junchao-Mellanox , I think we have discussed this before, please do not "close" and "reopen" the PR multiple times. It is not clear whether you really want to close the PR without merging. If the intention is to to retrigger tests, please do "/azpw run".

Sure

orchagent/flow_counter/flow_counter_handler.cpp Outdated Show resolved Hide resolved
orchagent/flow_counter/flow_counter_handler.h Outdated Show resolved Hide resolved
extern bool gIsNatSupported;

#define FLEX_COUNTER_UPD_INTERVAL 1
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This interval here is the timer to add flex counter to flex DB, it is not the query interval.

@prsunny prsunny merged commit ed783e1 into sonic-net:master Dec 1, 2021
@Junchao-Mellanox Junchao-Mellanox deleted the flow-counter-review branch December 1, 2021 06:22
liat-grozovik pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Dec 28, 2021
691c37b [Route bulk] Fix bugs in case a SET operation follows a DEL operation in the same bulk (sonic-net/sonic-swss#2086)
a4c80c3 patch for issue sonic-net/sonic-swss#1971 - enable Rx Drop handling for cisco-8000 (sonic-net/sonic-swss#2041)
71751d1 [macsec] Support setting IPG by gearbox_config.json (sonic-net/sonic-swss#2051)
5d5c169 [bulk mode] Fix bulk conflict when in case there are both remove and set operations (sonic-net/sonic-swss#2071)
8bbdbd2 Fix SRV6 NHOP CRM object type (sonic-net/sonic-swss#2072)
ef5b35f [vstest] VS test failure fix after fabric port orch PR merge (sonic-net/sonic-swss#1811)
89ea538 Supply the missing ingress/egress port profile list in document (sonic-net/sonic-swss#2064)
8123437 [pfc_detect] fix RedisReply errors (sonic-net/sonic-swss#2040)
b38f527 [swss][CRM][MPLS] MPLS CRM Nexthop - switch back to using SAI OBJECT rather than SWITCH OBJECT
ae061e5 create debug_shell_enable config to enable debug shell (sonic-net/sonic-swss#2060)
45e446d [cbf] Fix max FC value (sonic-net/sonic-swss#2049)
b1b5b29 Initial p4orch pytest code. (sonic-net/sonic-swss#2054)
d352d5a Update default route status to state DB (sonic-net/sonic-swss#2009)
24a64d6 Orchagent: Integrate P4Orch (sonic-net/sonic-swss#2029)
15a3b6c Delete the IPv6 link-local Neighbor when ipv6 link-local mode is disabled (sonic-net/sonic-swss#1897)
ed783e1 [orchagent] Add trap flow counter support (sonic-net/sonic-swss#1951)
e9b05a3 [vnetorch] ECMP for vnet tunnel routes with endpoint health monitor (sonic-net/sonic-swss#1955)
bcb7d61 P4Orch: inital add of source (sonic-net/sonic-swss#1997)
f6f6f86 [mclaglink] fix acl out ports (sonic-net/sonic-swss#2026)
fd887bf [Reclaim buffer] Reclaim unused buffer for dynamic buffer model (sonic-net/sonic-swss#1910)
9258978 [orchagent, cfgmgr] Add response publisher and state recording (sonic-net/sonic-swss#1992)
3d862a7 Fixing subport vs test script for subport under VNET (sonic-net/sonic-swss#2048)
fb0a5fd Don't handle buffer pool watermark during warm reboot reconciling (sonic-net/sonic-swss#1987)
16d4bcd Routed subinterface enhancements (sonic-net/sonic-swss#1907)
9639db7 [vstest/subintf] Add vs test to validate sub interface ingress to a vnet (sonic-net/sonic-swss#1642)

Signed-off-by: Stephen Sun [email protected]
stephenxs added a commit to stephenxs/sonic-buildimage that referenced this pull request Jan 6, 2022
691c37b [Route bulk] Fix bugs in case a SET operation follows a DEL operation in the same bulk (sonic-net/sonic-swss#2086)
a4c80c3 patch for issue sonic-net/sonic-swss#1971 - enable Rx Drop handling for cisco-8000 (sonic-net/sonic-swss#2041)
71751d1 [macsec] Support setting IPG by gearbox_config.json (sonic-net/sonic-swss#2051)
5d5c169 [bulk mode] Fix bulk conflict when in case there are both remove and set operations (sonic-net/sonic-swss#2071)
8bbdbd2 Fix SRV6 NHOP CRM object type (sonic-net/sonic-swss#2072)
ef5b35f [vstest] VS test failure fix after fabric port orch PR merge (sonic-net/sonic-swss#1811)
89ea538 Supply the missing ingress/egress port profile list in document (sonic-net/sonic-swss#2064)
8123437 [pfc_detect] fix RedisReply errors (sonic-net/sonic-swss#2040)
b38f527 [swss][CRM][MPLS] MPLS CRM Nexthop - switch back to using SAI OBJECT rather than SWITCH OBJECT
ae061e5 create debug_shell_enable config to enable debug shell (sonic-net/sonic-swss#2060)
45e446d [cbf] Fix max FC value (sonic-net/sonic-swss#2049)
b1b5b29 Initial p4orch pytest code. (sonic-net/sonic-swss#2054)
d352d5a Update default route status to state DB (sonic-net/sonic-swss#2009)
24a64d6 Orchagent: Integrate P4Orch (sonic-net/sonic-swss#2029)
15a3b6c Delete the IPv6 link-local Neighbor when ipv6 link-local mode is disabled (sonic-net/sonic-swss#1897)
ed783e1 [orchagent] Add trap flow counter support (sonic-net/sonic-swss#1951)
e9b05a3 [vnetorch] ECMP for vnet tunnel routes with endpoint health monitor (sonic-net/sonic-swss#1955)
bcb7d61 P4Orch: inital add of source (sonic-net/sonic-swss#1997)
f6f6f86 [mclaglink] fix acl out ports (sonic-net/sonic-swss#2026)
fd887bf [Reclaim buffer] Reclaim unused buffer for dynamic buffer model (sonic-net/sonic-swss#1910)
9258978 [orchagent, cfgmgr] Add response publisher and state recording (sonic-net/sonic-swss#1992)
3d862a7 Fixing subport vs test script for subport under VNET (sonic-net/sonic-swss#2048)
fb0a5fd Don't handle buffer pool watermark during warm reboot reconciling (sonic-net/sonic-swss#1987)
16d4bcd Routed subinterface enhancements (sonic-net/sonic-swss#1907)
9639db7 [vstest/subintf] Add vs test to validate sub interface ingress to a vnet (sonic-net/sonic-swss#1642)

Signed-off-by: Stephen Sun [email protected]
judyjoseph pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Jan 6, 2022
691c37b [Route bulk] Fix bugs in case a SET operation follows a DEL operation in the same bulk (sonic-net/sonic-swss#2086)
a4c80c3 patch for issue sonic-net/sonic-swss#1971 - enable Rx Drop handling for cisco-8000 (sonic-net/sonic-swss#2041)
71751d1 [macsec] Support setting IPG by gearbox_config.json (sonic-net/sonic-swss#2051)
5d5c169 [bulk mode] Fix bulk conflict when in case there are both remove and set operations (sonic-net/sonic-swss#2071)
8bbdbd2 Fix SRV6 NHOP CRM object type (sonic-net/sonic-swss#2072)
ef5b35f [vstest] VS test failure fix after fabric port orch PR merge (sonic-net/sonic-swss#1811)
89ea538 Supply the missing ingress/egress port profile list in document (sonic-net/sonic-swss#2064)
8123437 [pfc_detect] fix RedisReply errors (sonic-net/sonic-swss#2040)
b38f527 [swss][CRM][MPLS] MPLS CRM Nexthop - switch back to using SAI OBJECT rather than SWITCH OBJECT
ae061e5 create debug_shell_enable config to enable debug shell (sonic-net/sonic-swss#2060)
45e446d [cbf] Fix max FC value (sonic-net/sonic-swss#2049)
b1b5b29 Initial p4orch pytest code. (sonic-net/sonic-swss#2054)
d352d5a Update default route status to state DB (sonic-net/sonic-swss#2009)
24a64d6 Orchagent: Integrate P4Orch (sonic-net/sonic-swss#2029)
15a3b6c Delete the IPv6 link-local Neighbor when ipv6 link-local mode is disabled (sonic-net/sonic-swss#1897)
ed783e1 [orchagent] Add trap flow counter support (sonic-net/sonic-swss#1951)
e9b05a3 [vnetorch] ECMP for vnet tunnel routes with endpoint health monitor (sonic-net/sonic-swss#1955)
bcb7d61 P4Orch: inital add of source (sonic-net/sonic-swss#1997)
f6f6f86 [mclaglink] fix acl out ports (sonic-net/sonic-swss#2026)
fd887bf [Reclaim buffer] Reclaim unused buffer for dynamic buffer model (sonic-net/sonic-swss#1910)
9258978 [orchagent, cfgmgr] Add response publisher and state recording (sonic-net/sonic-swss#1992)
3d862a7 Fixing subport vs test script for subport under VNET (sonic-net/sonic-swss#2048)
fb0a5fd Don't handle buffer pool watermark during warm reboot reconciling (sonic-net/sonic-swss#1987)
16d4bcd Routed subinterface enhancements (sonic-net/sonic-swss#1907)
9639db7 [vstest/subintf] Add vs test to validate sub interface ingress to a vnet (sonic-net/sonic-swss#1642)

Signed-off-by: Stephen Sun [email protected]
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
#### What I did
* Added "show platform barefoot profile" command
* Added "config platform barefoot profile" command
* Updated Command Line Reference Guide

#### How I did it
* Created plugins for Barefoot in show/plugins/barefoot.py and config/plugins/barefoot.py
* Updated doc/Command-Reference.md
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
…t#1951)"" (sonic-net#2019)

Refer to sonic-net#1951 for details

The PR sonic-net#1951 was reverted in sonic-net#2016 because it was thought to be causing the build failure in sonic-swss TestWarmReboot UTs. But it seems the failures in TestWarmReboot are still occurring e.g. sonic-net#2017 [build](https://dev.azure.com/mssonic/build/_build/results?buildId=65653&view=logs&s=859b8d9a-8fd6-5a5c-6f5e-f84f1990894e)

I think we can reapply sonic-net#1951 and need to investigate TestWarmReboot tests instability
preetham-singh pushed a commit to preetham-singh/sonic-swss that referenced this pull request Aug 6, 2022
* Add trap flow counter support. See HLD: sonic-net/SONiC#858
* Flow counters are usually used for debugging, troubleshooting and performance enhancement processes. Host interface trap counter can get number of received traps per Trap ID.
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.

7 participants