-
Notifications
You must be signed in to change notification settings - Fork 545
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
[sub intf] Port object reference count update #1712
Conversation
can you describe why you did this in detail? need to understand why first. |
@wendani , is this a bug fix? |
this seems to be having the similar changes in PR #1521. Is this the superset? |
There are two parts of changes in this pr: One is the reference count of sub port Port object itself. This part is bug fix. The motivation is that for each Port object instantiated, it should be initialized in PortsOrch::m_port_ref_count. For each Port object to be removed, its m_port_ref_count check should be zero to proceed further. These operations are generic and therefore should also apply to sub port Port object. Currently, Port object reference count increments
Port object reference count decrements
Item 1, router interface creation and removal, is of direct relevance to sub port Port object. The other part of change is the reference count update to parent port Port object when a sub port Port object is added/removed on top. This part is motivated by change in Add reference counting to ports for ACL bindings. For a sub port Port add/removal, I think reference count of parent port Port object should be updated accordingly. However, I do not have strong justification for this change, just following the practice in #1614 |
Yes, this is incremental development on top of #1521. When #1521 is merged, we can see the incremental part clearly. #1521 fixes the sub interface removal sequence.
Before change in #1521, |
@wendani , please rebase so that incremental changes are clearly visible |
Signed-off-by: Wenda Ni <wonda.ni@gmail.com>
Signed-off-by: Wenda Ni <wonda.ni@gmail.com>
Signed-off-by: Wenda Ni <wonda.ni@gmail.com>
Signed-off-by: Wenda Ni <wonda.ni@gmail.com>
Signed-off-by: Wenda Ni <wonda.ni@gmail.com>
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
LGTM. @prsunny, can you take a look? |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Wenda Ni <wonda.ni@gmail.com> There are two parts of changes in this pr: The motivation is that for each Port object instantiated, it should be initialized in PortsOrch::m_port_ref_count. For each Port object to be removed, its m_port_ref_count check should be zero to proceed further. These operations are generic and therefore should also apply to sub port Port object. Currently, Port object reference count increments - When a router interface is created on top. - When an ACL table is bound to Port (i.e., becoming a member of the ACL table group associated with the Port object). Port object reference count decrements - When a router interface on top is removed. - When an ACL table is unbound from Port (i.e, removing membership from the ACL table group associated with the Port object). Item 1, router interface creation and removal, is of direct relevance to sub port Port object. The other part of change is the reference count update to parent port Port object when a sub port Port object is added/removed on top. This part is motivated by change in Add reference counting to ports for ACL bindings. What I did At sub port Port object instantiation - Init sub port Port object reference count - Increase parent port Port object reference count At sub port Port object removal - Check sub port Port object reference count drops to zero - Decrease parent port Port object reference count At physical port removal - Check physical port Port object reference count drops to zero How I verified it vs test extension Issue parent port removal at APPL_DB level before removing sub port interface. Verify that parent port persists in ASIC_DB until sub interface is removed. Without the change, extended vs test fails:
Advance submodule head for sonic-swss on 202012 bb383be2 [Dynamic Buffer Calc][Mellanox] Bug fixes and enhancements for the lua plugins for buffer pool calculation and headroom checking (sonic-net/sonic-swss#1781) f949dfe9 [Dynamic Buffer Calc] Avoid creating lossy PG for admin down ports during initialization (sonic-net/sonic-swss#1776) def0a914 Fix config prompt question issue (sonic-net/sonic-swss#1799) 21f97506 [ci]: Merge azure pipelines from master to 202012 branch (sonic-net/sonic-swss#1764) a83a2a42 [vstest]: add dvs_route fixture 849bdf9c [Mux] Add support for mux metrics to State DB (sonic-net/sonic-swss#1757) 386de717 [qosorch] Dot1p map list initialization fix (sonic-net/sonic-swss#1746) f99abdca [sub intf] Port object reference count update (sonic-net/sonic-swss#1712) 4a00042d [vstest/nhg]: use dvs_route fixture to make test_nhg more robust Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Wenda Ni <wonda.ni@gmail.com> There are two parts of changes in this pr: The motivation is that for each Port object instantiated, it should be initialized in PortsOrch::m_port_ref_count. For each Port object to be removed, its m_port_ref_count check should be zero to proceed further. These operations are generic and therefore should also apply to sub port Port object. Currently, Port object reference count increments - When a router interface is created on top. - When an ACL table is bound to Port (i.e., becoming a member of the ACL table group associated with the Port object). Port object reference count decrements - When a router interface on top is removed. - When an ACL table is unbound from Port (i.e, removing membership from the ACL table group associated with the Port object). Item 1, router interface creation and removal, is of direct relevance to sub port Port object. The other part of change is the reference count update to parent port Port object when a sub port Port object is added/removed on top. This part is motivated by change in Add reference counting to ports for ACL bindings. What I did At sub port Port object instantiation - Init sub port Port object reference count - Increase parent port Port object reference count At sub port Port object removal - Check sub port Port object reference count drops to zero - Decrease parent port Port object reference count At physical port removal - Check physical port Port object reference count drops to zero How I verified it vs test extension Issue parent port removal at APPL_DB level before removing sub port interface. Verify that parent port persists in ASIC_DB until sub interface is removed. Without the change, extended vs test fails:
Introduce a new function `load_db_config()`. This function will load the global database file or database config file based on the platform.
What I did
At sub port Port object instantiation
At sub port Port object removal
At physical port removal
Why I did it
Enhancement
How I verified it
vs test extension
Issue parent port removal at APPL_DB level before removing sub port interface. Verify that parent port persists in ASIC_DB until sub interface is removed.
Without the change, extended vs test fails:
Physical port
LAG
syslog
Details if related
Contains, and therefore after #1642
Incremental change to #1642 base can be found at wendani#9