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

[sonic-py-swsssdk] sonic-py-swsssdk submodule commit updated #1184

Closed
wants to merge 1 commit into from

Conversation

Mrak-IW
Copy link

@Mrak-IW Mrak-IW commented Nov 24, 2017

Signed-off-by: Denis Maslov [email protected]

- What I did
Issue : Show mac command not working
Getting following error while entering command:

admin@sonic:~$ show mac
Command: fdbshow
Traceback (most recent call last):
  File "/usr/bin/fdbshow", line 33, in <module>
    from swsssdk import SonicV2Connector, port_util
ImportError: cannot import name port_util

port_util module is in src/swsssdk/port_util.py file of the https://github.com/Azure/sonic-py-swsssdk.git repository.
But it was created only several commits ago. The first commit where the file is present, is 96b4928
I supposed, that the image was built with the old version of this repository, where is no port_util.py file.

- How I did it
sonic-py-swsssdk submodule commit was updated to the latest.

- How to verify it
ssh to the device and try show mac command:

root@ba361ae173a9:/# show mac
Command: fdbshow
No.    Vlan    MacAddress    Port
-----  ------  ------------  ------
Total number of entries 0 

- Description for the changelog

show mac command error fixed

- A picture of a cute animal (not mandatory but encouraged)
^._.^

@Mrak-IW Mrak-IW changed the title [sonic-py-swsssdk] Submodule commit updated [sonic-py-swsssdk] sonic-py-swsssdk submodule commit updated Nov 24, 2017
@Mrak-IW
Copy link
Author

Mrak-IW commented Nov 30, 2017

PR is not actual for our SAI version. SAI_OBJECT_TYPE_FDB_ENTRY attribute that is used in port_util module is not implemented.

@Mrak-IW Mrak-IW closed this Nov 30, 2017
lguohan pushed a commit that referenced this pull request Feb 9, 2020
Including commits in those repos:

sonic-swss-common
7ee1179 2020-01-15 | Add unregister method to NetDispatcher (#326) [Kamil Cudnik]
b080150 2019-12-19 | Add resultToString method for Select class (#325) [Kamil Cudnik]

sonic-swss
412c5eb 2020-02-06 | Quote input strings before constructing a command line (#1193) [Qi Luo]
1215262 2020-02-06 | [DPB portsyncd/portmgrd/portorch] Support dynamic port add/deletion without dependencies (#1112) [zhenggen-xu]
ddb84fb 2020-02-03 | [aclorch] Enable IN_PORTS ACL qualifier on MIRROR tables (#1176) [Danny Allen]
750982e 2020-01-30 | adding mirrorv6 support for mrvl platform (#1190) [B S Rama krishna]
73ab143 2020-01-29 | [pytest]: print out stdout/stderr message when cmd fails (#1188) [lguohan]
1883c0a 2020-01-29 | [vs tests] Remove class-level flaky fixtures (#1189) [Danny Allen]
dc695fb 2020-01-29 | [orch] change Consumer class to support multiple values for the same key (#1184) [zhenggen-xu]
49ad38f 2020-01-30 | [orchagent/copp] : copp trap priority not supported for marvell platf… (#1163) [rajkumar38]
cbe1811 2020-01-28 | Fix the stack-overflow issue in AclOrch::getTableById() (#1073) [zhenggen-xu]
c6a8a04 2020-01-29 | [aclorch]: add support for acl rule to match out port (#810) [shine4chen]
8f4c54a 2020-01-29 | [qosorch] converting shaper bandwidth value to unsigned long instead of int (#1167) [Sabareesh-Kumar-Anandan]
84415f6 2020-01-28 | [vs tests] Activate flaky plugin for virtual switch pytests (#1186) [Danny Allen]
5eb1ea3 2020-01-28 | [qosorch]: Remove Init Color ACLs (#1084) [zhenggen-xu]
madhanmellanox pushed a commit to madhanmellanox/sonic-buildimage that referenced this pull request Mar 23, 2020
…key (sonic-net#1184)

Description

The Consumer class is used by the orch objects to deal with the redis consumer tables' popped items. It has m_toSync map to save the tasks. During the operations (more items than the orch objects can handle), the tasks in the map is merged for optimization. However, since it is a map, we would only have one value for each key. This potentially eliminate the necessary actions from Redis, e,g, we have a DEL action and SET action coming out from Redis for some key, we would overwrite the DEL action today in the code and thus not able to delete some objects as we intended.

The PR changed the m_toSync from map to multi-map to get multiple values for one key. In this design, we keep maximun two values per key, DEL or SET or DEL+SET. We need strictly keep the order of DEL and SET. It is possible to use map of vectors to fulfill this, we chose multi-map because:
1, It will have less/no changes to different orch classes to iterate the m_toSync
2, The order can be guaranteed. The order of the key-value pairs whose keys compare equivalent is the order of insertion and does not change. (since C++11). See
https://en.cppreference.com/w/cpp/container/multimap

The PR also refactors the consumer class so vlanmgr.cpp and routeorch.cpp will leverage the Consumer functions instead of operating on the members. It also refactors the UT code (aclorch_ut.cpp) so it removes the redundant code and uses the same code.

Google UT tests were added for Consumer Class especially for different cases for addToSync() function.

What I did
Change the m_toSync in Consumer class to multimap so it could support both DEL and SET
Reload Consumer addToSync() and refactor vlanmgr/route-orch and ut code to use it
Add google ut for consumer class

Why I did it
See description.

How I verified it
Unit tests:
Running main() from gtest_main.cc

```
[==========] Running 19 tests from 5 test cases.
[----------] Global test environment set-up.
[----------] 1 test from AclTest
[ RUN      ] AclTest.Create_L3_Acl_Table
[       OK ] AclTest.Create_L3_Acl_Table (1 ms)
[----------] 1 test from AclTest (1 ms total)

[----------] 3 tests from AclOrchTest
[ RUN      ] AclOrchTest.ACL_Creation_and_Destorying
[       OK ] AclOrchTest.ACL_Creation_and_Destorying (1000 ms)
[ RUN      ] AclOrchTest.L3Acl_Matches_Actions
[       OK ] AclOrchTest.L3Acl_Matches_Actions (1001 ms)
[ RUN      ] AclOrchTest.L3V6Acl_Matches_Actions
[       OK ] AclOrchTest.L3V6Acl_Matches_Actions (1000 ms)
[----------] 3 tests from AclOrchTest (3003 ms total)

[----------] 2 tests from PortsOrchTest
[ RUN      ] PortsOrchTest.PortReadinessColdBoot
[       OK ] PortsOrchTest.PortReadinessColdBoot (21 ms)
[ RUN      ] PortsOrchTest.PortReadinessWarmBoot
[       OK ] PortsOrchTest.PortReadinessWarmBoot (13 ms)
[----------] 2 tests from PortsOrchTest (34 ms total)

[----------] 4 tests from SaiSpy
[ RUN      ] SaiSpy.CURD
[       OK ] SaiSpy.CURD (0 ms)
[ RUN      ] SaiSpy.Same_Function_Signature_In_Same_API_Table
[       OK ] SaiSpy.Same_Function_Signature_In_Same_API_Table (0 ms)
[ RUN      ] SaiSpy.Same_Function_Signature_In_Different_API_Table
[       OK ] SaiSpy.Same_Function_Signature_In_Different_API_Table (0 ms)
[ RUN      ] SaiSpy.create_switch_and_acl_table
[       OK ] SaiSpy.create_switch_and_acl_table (0 ms)
[----------] 4 tests from SaiSpy (0 ms total)

[----------] 9 tests from ConsumerTest
[ RUN      ] ConsumerTest.ConsumerAddToSync_Set
[       OK ] ConsumerTest.ConsumerAddToSync_Set (1 ms)
[ RUN      ] ConsumerTest.ConsumerAddToSync_Del
[       OK ] ConsumerTest.ConsumerAddToSync_Del (0 ms)
[ RUN      ] ConsumerTest.ConsumerAddToSync_Set_Del
[       OK ] ConsumerTest.ConsumerAddToSync_Set_Del (0 ms)
[ RUN      ] ConsumerTest.ConsumerAddToSync_Del_Set
[       OK ] ConsumerTest.ConsumerAddToSync_Del_Set (130 ms)
[ RUN      ] ConsumerTest.ConsumerAddToSync_Set_Del_Set_Multi
[       OK ] ConsumerTest.ConsumerAddToSync_Set_Del_Set_Multi (204 ms)
[ RUN      ] ConsumerTest.ConsumerAddToSync_Set_Del_Set_Multi_In_Q
[       OK ] ConsumerTest.ConsumerAddToSync_Set_Del_Set_Multi_In_Q (4 ms)
[ RUN      ] ConsumerTest.ConsumerAddToSync_Del_Set_Setnew
[       OK ] ConsumerTest.ConsumerAddToSync_Del_Set_Setnew (0 ms)
[ RUN      ] ConsumerTest.ConsumerAddToSync_Del_Set_Setnew1
[       OK ] ConsumerTest.ConsumerAddToSync_Del_Set_Setnew1 (0 ms)
[ RUN      ] ConsumerTest.ConsumerAddToSync_Ind_Set_Del
[       OK ] ConsumerTest.ConsumerAddToSync_Ind_Set_Del (0 ms)
[----------] 9 tests from ConsumerTest (340 ms total)

[----------] Global test environment tear-down
[==========] 19 tests from 5 test cases ran. (4344 ms total)
[  PASSED  ] 19 tests.
```

Signed-off-by: Zhenggen Xu <[email protected]>
AidanCopeland pushed a commit to Metaswitch/sonic-buildimage that referenced this pull request Apr 14, 2022
* c0bdac2 2021-01-24 | [saithrift]: add correct libs to build saithrift on libsaivs (sonic-net#1184) (HEAD, origin/v1.7) [lguohan]

Signed-off-by: Guohan Lu <[email protected]>
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.

1 participant