Skip to content

[trim]: Add Packet Trimming Drop Counters DB schema#1055

Merged
qiluo-msft merged 1 commit intosonic-net:masterfrom
nazariig:master-trim-counter
Jul 30, 2025
Merged

[trim]: Add Packet Trimming Drop Counters DB schema#1055
qiluo-msft merged 1 commit intosonic-net:masterfrom
nazariig:master-trim-counter

Conversation

@nazariig
Copy link
Copy Markdown
Collaborator

Signed-off-by: Nazarii Hnydyn nazariig@nvidia.com

HLD: sonic-net/SONiC#2033

A picture of a cute animal (not mandatory but encouraged)

      .---.        .-----------
     /     \  __  /    ------
    / /     \(  )/    -----
   //////   ' \/ `   ---
  //// / // :    : ---
 // /   /  /`    '--
//          //..\\
       ====UU====UU====
           '//||\\`
             ''``

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@nazariig
Copy link
Copy Markdown
Collaborator Author

/azpw run

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@nazariig
Copy link
Copy Markdown
Collaborator Author

/azpw run

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@nazariig
Copy link
Copy Markdown
Collaborator Author

Compilation errors:

2025-07-25T09:08:42.7204256Z g++ -DHAVE_CONFIG_H -I. -I.. -I ../lib -I .. -I ../warmrestart -I switch -I flex_counter -I debug_counter -I port -I pbh -I nhg -g -DNDEBUG  -std=c++14 -Wall -fPIC -Wno-write-strings -I/usr/include/swss -I/usr/include -I/usr/include/libnl3 -Werror -Wno-reorder -Wcast-align -Wcast-qual -Wconversion -Wdisabled-optimization -Wextra -Wfloat-equal -Wformat=2 -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wimport -Winit-self -Winvalid-pch -Wlong-long -Wmissing-field-initializers -Wmissing-format-attribute -Wno-aggregate-return -Wno-padded -Wno-switch-enum -Wno-unused-parameter -Wpacked -Wpointer-arith -Wredundant-decls -Wstack-protector -Wstrict-aliasing=3 -Wswitch -Wswitch-default -Wunreachable-code -Wunused -Wvariadic-macros -Wno-switch-default -Wno-long-long -Wno-redundant-decls -Wno-error=missing-field-initializers -I /usr/include/sai  -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 -ffile-prefix-map=/__w/1/s=. -fstack-protector-strong -Wformat -Werror=format-security -c -o orchagent-pbutils.o `test -f 'dash/pbutils.cpp' || echo './'`dash/pbutils.cpp
2025-07-25T09:08:44.0535934Z dash/pbutils.cpp: In function 'sai_uint16_t to_sai(dash::types::HaRole)':
2025-07-25T09:08:44.0536455Z dash/pbutils.cpp:159:27: error: 'HA_SCOPE_ROLE_DEAD' is not a member of 'dash::types'; did you mean 'HA_ROLE_DEAD'?
2025-07-25T09:08:44.0536790Z   159 |         case dash::types::HA_SCOPE_ROLE_DEAD:
2025-07-25T09:08:44.0537021Z       |                           ^~~~~~~~~~~~~~~~~~
2025-07-25T09:08:44.0537217Z       |                           HA_ROLE_DEAD
2025-07-25T09:08:44.0562102Z dash/pbutils.cpp:162:27: error: 'HA_SCOPE_ROLE_ACTIVE' is not a member of 'dash::types'; did you mean 'HA_ROLE_ACTIVE'?
2025-07-25T09:08:44.0562590Z   162 |         case dash::types::HA_SCOPE_ROLE_ACTIVE:
2025-07-25T09:08:44.0562818Z       |                           ^~~~~~~~~~~~~~~~~~~~
2025-07-25T09:08:44.0563001Z       |                           HA_ROLE_ACTIVE
2025-07-25T09:08:44.0563307Z dash/pbutils.cpp:165:27: error: 'HA_SCOPE_ROLE_STANDBY' is not a member of 'dash::types'; did you mean 'HA_ROLE_STANDBY'?
2025-07-25T09:08:44.0563632Z   165 |         case dash::types::HA_SCOPE_ROLE_STANDBY:
2025-07-25T09:08:44.0563855Z       |                           ^~~~~~~~~~~~~~~~~~~~~
2025-07-25T09:08:44.0564045Z       |                           HA_ROLE_STANDBY
2025-07-25T09:08:44.0564361Z dash/pbutils.cpp:168:27: error: 'HA_SCOPE_ROLE_STANDALONE' is not a member of 'dash::types'; did you mean 'HA_ROLE_STANDALONE'?
2025-07-25T09:08:44.0564726Z   168 |         case dash::types::HA_SCOPE_ROLE_STANDALONE:
2025-07-25T09:08:44.0564980Z       |                           ^~~~~~~~~~~~~~~~~~~~~~~~
2025-07-25T09:08:44.0565192Z       |                           HA_ROLE_STANDALONE
2025-07-25T09:08:44.0565537Z dash/pbutils.cpp:171:27: error: 'HA_SCOPE_ROLE_SWITCHING_TO_ACTIVE' is not a member of 'dash::types'; did you mean 'HA_ROLE_SWITCHING_TO_ACTIVE'?
2025-07-25T09:08:44.0565927Z   171 |         case dash::types::HA_SCOPE_ROLE_SWITCHING_TO_ACTIVE:
2025-07-25T09:08:44.0566202Z       |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-07-25T09:08:44.0566420Z       |                           HA_ROLE_SWITCHING_TO_ACTIVE
2025-07-25T09:08:44.0566682Z dash/pbutils.cpp: In function 'dash::types::HaRole to_pb(sai_dash_ha_role_t)':
2025-07-25T09:08:44.0567077Z dash/pbutils.cpp:188:33: error: 'HA_SCOPE_ROLE_DEAD' is not a member of 'dash::types'; did you mean 'HA_ROLE_DEAD'?
2025-07-25T09:08:44.0567432Z   188 |             return dash::types::HA_SCOPE_ROLE_DEAD;
2025-07-25T09:08:44.0567658Z       |                                 ^~~~~~~~~~~~~~~~~~
2025-07-25T09:08:44.0567990Z       |                                 HA_ROLE_DEAD
2025-07-25T09:08:44.0568281Z dash/pbutils.cpp:190:33: error: 'HA_SCOPE_ROLE_ACTIVE' is not a member of 'dash::types'; did you mean 'HA_ROLE_ACTIVE'?
2025-07-25T09:08:44.0568612Z   190 |             return dash::types::HA_SCOPE_ROLE_ACTIVE;
2025-07-25T09:08:44.0568833Z       |                                 ^~~~~~~~~~~~~~~~~~~~
2025-07-25T09:08:44.0569020Z       |                                 HA_ROLE_ACTIVE
2025-07-25T09:08:44.0569333Z dash/pbutils.cpp:192:33: error: 'HA_SCOPE_ROLE_STANDBY' is not a member of 'dash::types'; did you mean 'HA_ROLE_STANDBY'?
2025-07-25T09:08:44.0569680Z   192 |             return dash::types::HA_SCOPE_ROLE_STANDBY;
2025-07-25T09:08:44.0569931Z       |                                 ^~~~~~~~~~~~~~~~~~~~~
2025-07-25T09:08:44.0570134Z       |                                 HA_ROLE_STANDBY
2025-07-25T09:08:44.0570455Z dash/pbutils.cpp:194:33: error: 'HA_SCOPE_ROLE_STANDALONE' is not a member of 'dash::types'; did you mean 'HA_ROLE_STANDALONE'?
2025-07-25T09:08:44.0596385Z   194 |             return dash::types::HA_SCOPE_ROLE_STANDALONE;
2025-07-25T09:08:44.0596682Z       |                                 ^~~~~~~~~~~~~~~~~~~~~~~~
2025-07-25T09:08:44.0596905Z       |                                 HA_ROLE_STANDALONE
2025-07-25T09:08:44.0597335Z dash/pbutils.cpp:196:33: error: 'HA_SCOPE_ROLE_SWITCHING_TO_ACTIVE' is not a member of 'dash::types'; did you mean 'HA_ROLE_SWITCHING_TO_ACTIVE'?
2025-07-25T09:08:44.0598221Z   196 |             return dash::types::HA_SCOPE_ROLE_SWITCHING_TO_ACTIVE;
2025-07-25T09:08:44.0598528Z       |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-07-25T09:08:44.0598764Z       |                                 HA_ROLE_SWITCHING_TO_ACTIVE
2025-07-25T09:08:44.0599110Z dash/pbutils.cpp:198:33: error: 'HA_SCOPE_ROLE_DEAD' is not a member of 'dash::types'; did you mean 'HA_ROLE_DEAD'?
2025-07-25T09:08:44.0599489Z   198 |             return dash::types::HA_SCOPE_ROLE_DEAD;
2025-07-25T09:08:44.0599751Z       |                                 ^~~~~~~~~~~~~~~~~~
2025-07-25T09:08:44.0599945Z       |                                 HA_ROLE_DEAD
2025-07-25T09:08:44.1895212Z make[4]: *** [Makefile:2078: orchagent-pbutils.o] Error 1
2025-07-25T09:08:44.1902103Z make[4]: *** Waiting for unfinished jobs....
2025-07-25T09:08:47.5238132Z make[4]: Leaving directory '/__w/1/s/orchagent'
2025-07-25T09:08:47.5242143Z make[3]: *** [Makefile:2625: all-recursive] Error 1
2025-07-25T09:08:47.5244493Z make[3]: Leaving directory '/__w/1/s/orchagent'
2025-07-25T09:08:47.5250468Z make[2]: *** [Makefile:420: all-recursive] Error 1
2025-07-25T09:08:47.5251935Z make[2]: Leaving directory '/__w/1/s'
2025-07-25T09:08:47.5257099Z make[1]: *** [Makefile:352: all] Error 2
2025-07-25T09:08:47.5257887Z make[1]: Leaving directory '/__w/1/s'
2025-07-25T09:08:47.5264314Z dh_auto_build: error: make -j2 returned exit code 2
2025-07-25T09:08:47.5302218Z make: *** [debian/rules:22: build] Error 25
2025-07-25T09:08:47.5305973Z dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
2025-07-25T09:08:47.5347991Z 
2025-07-25T09:08:47.5389262Z ##[error]Bash exited with code '2'.
2025-07-25T09:08:47.5494712Z ##[section]Finishing: Compile sonic swss

All are DASH related, have nothing to do with the current change

@prsunny
Copy link
Copy Markdown
Contributor

prsunny commented Jul 25, 2025

Please rebase. Breaking in swss is fixed and PR merged.

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
@nazariig nazariig force-pushed the master-trim-counter branch from f3c05a6 to 7d150d7 Compare July 26, 2025 10:33
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@nazariig nazariig marked this pull request as ready for review July 26, 2025 10:34
@nazariig
Copy link
Copy Markdown
Collaborator Author

/azpw run

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run

@nazariig
Copy link
Copy Markdown
Collaborator Author

UT errors:

2025-07-28T08:32:41.2747797Z Expected equality of these values:
2025-07-28T08:32:41.2747984Z   output
2025-07-28T08:32:41.2748317Z     Which is: "{\"API\":\"basic_set_name\",\"RPS[k]\":5.0,\"Tasks\":3000,\"Total[ms]\":603,\"busy[ms]\":400,\"idle[ms]\":203,\"m_gaps\":[3,200],\"m_incs\":[1000,2000],\"m_intervals\":[100,300]}"
2025-07-28T08:32:41.2748644Z   expected
2025-07-28T08:32:41.2748977Z     Which is: "{\"API\":\"basic_set_name\",\"RPS[k]\":5.0,\"Tasks\":3000,\"Total[ms]\":600,\"busy[ms]\":400,\"idle[ms]\":200,\"m_gaps\":[0,200],\"m_incs\":[1000,2000],\"m_intervals\":[100,300]}"
2025-07-28T08:32:41.2749328Z [  FAILED  ] PerformancetimerTest.basic (705 ms)
2025-07-28T08:32:41.2749570Z [----------] 1 test from PerformancetimerTest (705 ms total)

Failures have nothing to do with the current change

@nazariig
Copy link
Copy Markdown
Collaborator Author

/azpw run

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@kperumalbfn
Copy link
Copy Markdown

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@nazariig nazariig requested a review from prsunny July 30, 2025 07:34
@nazariig
Copy link
Copy Markdown
Collaborator Author

@prsunny can you please help to merge?

@nazariig nazariig requested a review from qiluo-msft July 30, 2025 12:13
@kperumalbfn
Copy link
Copy Markdown

@qiluo-msft Could you please merge this PR

@qiluo-msft qiluo-msft merged commit d7c661b into sonic-net:master Jul 30, 2025
15 checks passed
@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to msft-202412: Azure/sonic-swss-common.msft#48

wen587 pushed a commit to wen587/sonic-swss-common that referenced this pull request Aug 5, 2025
mssonicbld added a commit to mssonicbld/sonic-sairedis.msft that referenced this pull request Aug 7, 2025
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>

**DEPENDS:**
1. sonic-net/sonic-swss-common#1055

**HLD:** sonic-net/SONiC#2033

Requires SAI API v1.16.2

#### A picture of a cute animal (not mandatory but encouraged)
```
      .---.        .-----------
     /     \  __  /    ------
    / /     \(  )/    -----
   //////   ' \/ `   ---
  //// / // :    : ---
 // /   /  /`    '--
//          //..\\
       ====UU====UU====
           '//||\\`
             ''``
```
mssonicbld added a commit to Azure/sonic-sairedis.msft that referenced this pull request Aug 7, 2025
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>

**DEPENDS:**
1. sonic-net/sonic-swss-common#1055

**HLD:** sonic-net/SONiC#2033

Requires SAI API v1.16.2

#### A picture of a cute animal (not mandatory but encouraged)
```
 .---. .-----------
 / \ __ / ------
 / / \( )/ -----
 ////// ' \/ ` ---
 //// / // : : ---
 // / / /` '--
// //..\\
 ====UU====UU====
 '//||\\`
 ''``
```
@yejianquan
Copy link
Copy Markdown

Remove 202505 request label since packet trimming feature won't be included into 202505 branch.

mssonicbld added a commit to mssonicbld/sonic-mgmt.msft that referenced this pull request Oct 23, 2025
### Summary: Add packet trimming counter testcase phase1

### Related PR
- Add packet trimming drop counter test plan
sonic-net/sonic-mgmt#19824
- Packet Trimming: Drop Counters HLD
sonic-net/SONiC#2033
- [trim]: Add Packet Trimming Drop Counters YANG model
sonic-net/sonic-buildimage#23422
- [trim]: Add Packet Trimming Drop Counters DB schema
sonic-net/sonic-swss-common#1055
- [trim]: Add Packet Trimming Drop Counters to VS lib
sonic-net/sonic-sairedis#1630
- [trim]: Add Packet Trimming Drop Counters to OA
sonic-net/sonic-swss#3777
- [trim]: Add Packet Trimming Drop Counters CLI
sonic-net/sonic-utilities#3993

### Type of change

<!--
- Fill x for your type of change.
- e.g.
- [x] Bug fix
-->

- [ ] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [ ] New Test case
    - [ ] Skipped for non-supported platforms
- [ ] Test case improvement

### Back port request
- [ ] 202205
- [ ] 202305
- [ ] 202311
- [ ] 202405
- [ ] 202411
- [x] 202505

### 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
<!--
(If it's a new feature, new test case)
Did you update documentation/Wiki relevant to your implementation?
Link to the wiki page?
-->
mssonicbld added a commit to Azure/sonic-mgmt.msft that referenced this pull request Oct 23, 2025
### Summary: Add packet trimming counter testcase phase1

### Related PR
- Add packet trimming drop counter test plan
sonic-net/sonic-mgmt#19824
- Packet Trimming: Drop Counters HLD
sonic-net/SONiC#2033
- [trim]: Add Packet Trimming Drop Counters YANG model
sonic-net/sonic-buildimage#23422
- [trim]: Add Packet Trimming Drop Counters DB schema
sonic-net/sonic-swss-common#1055
- [trim]: Add Packet Trimming Drop Counters to VS lib
sonic-net/sonic-sairedis#1630
- [trim]: Add Packet Trimming Drop Counters to OA
sonic-net/sonic-swss#3777
- [trim]: Add Packet Trimming Drop Counters CLI
sonic-net/sonic-utilities#3993

### Type of change

<!--
- Fill x for your type of change.
- e.g.
- [x] Bug fix
-->

- [ ] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [ ] New Test case
 - [ ] Skipped for non-supported platforms
- [ ] Test case improvement

### Back port request
- [ ] 202205
- [ ] 202305
- [ ] 202311
- [ ] 202405
- [ ] 202411
- [x] 202505

### 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
<!--
(If it's a new feature, new test case)
Did you update documentation/Wiki relevant to your implementation?
Link to the wiki page?
-->
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.

8 participants