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

[SAG]: Add SAG implementation #1974

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

Conversation

superchild
Copy link

What I did

  • Add static anycast gateway implementation in intfmgr/intforch
  • Revise routeroch's API to handle add/delete IPv6 link-local route
  • Add related testcases

Why I did it

  • To support static anycast gateway feature

How I verified it

  • Using vs environment to execute the test cases, all test cases passed

Details if related

Signed-off-by: Jimi Chen jimi_chen@edge-core.com

@superchild
Copy link
Author

@prsunny could you please help to review the code?
The related schema changed PR is sonic-swss-common#540, but it doesn't have reviewer yet.
Could you please help to assign someone to review?
Thanks.

@@ -327,8 +327,13 @@ namespace aclorch_test
ASSERT_EQ(gVrfOrch, nullptr);
gVrfOrch = new VRFOrch(m_app_db.get(), APP_VRF_TABLE_NAME, m_state_db.get(), STATE_VRF_OBJECT_TABLE_NAME);

vector<table_name_with_pri_t> intf_tables = {
{ APP_INTF_TABLE_NAME, IntfsOrch::intfsorch_pri},
{ APP_SAG_TABLE_NAME, IntfsOrch::intfsorch_pri}
Copy link
Contributor

Choose a reason for hiding this comment

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

HLD has only CONFIG_DB for SAG MAC. Why do we need additional APP_DB? Any change between config and app_db?

Copy link
Author

Choose a reason for hiding this comment

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

The purpose to carry SAG MAC to app_db is to let intsforch to handle IPv6 link-local route add/delete in VRFs.
I'll update HLD to add the SAG table used in app_db.

SWSS_LOG_NOTICE("Created link local ipv6 route %s to cpu in default VRF", linklocal_prefix.to_string().c_str());

// add link local route for existed vrf
for (auto vrf_id: vrf_ids)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need refcount or other additional checks to see when SAG MAC is deleted but some interfaces are enabled with SAG to use that MAC?

Copy link
Author

@superchild superchild Nov 16, 2021

Choose a reason for hiding this comment

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

This part handles the IPv6 link-local route to ASIC_DB in VRFs.
In current design, the IPv6 link-local route to ASIC_DB in default VRF is added when routeorch init.
When SAG mac is added, it needs to add IPv6 link-local route to existed VRfs.
To simplify the design, I only use m_sagMac to store the SAG MAC info in intfsorch to handle the change.

@@ -652,6 +659,17 @@ void IntfsOrch::doTask(Consumer &consumer)
}
}

//TODO: consider to refactor for different private function
if (table_name == APP_SAG_TABLE_NAME)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you update sonic-swss/doc with the new CONFIG_DB or APP_DB tables.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please update the HLD if you are planning to have additional APP_DB tables

Copy link
Author

Choose a reason for hiding this comment

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

I'll update the HLD to address the APP_DB table change.

@superchild
Copy link
Author

@kperumalbfn
The new SAG_TABLE added in APPL_DB is updated in the HLD PR, please help to check.

@zhangyanzhao
Copy link
Collaborator

all the comments are addressed, @prsunny please help to review to see if you are ok to approve. Branch conflicts and build failure need be addressed by @superchild

@superchild
Copy link
Author

@zhangyanzhao , the code conflict has been resolved.
For the build failure, it's due to sonic-swss-common#540 not merged yet.
For that schema PR, the build failure seems timeout for the build task.
I don't have the permission to trigger the CI build again, could you help to trigger the build again?

@superchild
Copy link
Author

@prsunny could you please help to view?
@zhangyanzhao the CI build needs sonic-swss-common#540 to be merged first, and then I'll trigger another build to test

EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
…t#1974)

What I did
fixes sonic-net/sonic-buildimage#9411
on multi-asic platform, config reload CLI was not working without -f option.
This was because swss_ready function was checking status of swss.service and multi-asic platform will not have swss.service, it will have per-namespace swss service.

How I did it
Fix swss_ready function to check all swss services status running on the platform.
* Fix change SAG mac doesn't reset MAC address on VLAN interface
* Fix compile error for update admin status api change
@superchild
Copy link
Author

@prsunny @kperumalbfn
Could you help to review?
Thanks.

@prsunny
Copy link
Collaborator

prsunny commented May 7, 2022

@venkatmahalingam , please review

@zhangyanzhao
Copy link
Collaborator

Added maintainers as reviewers. Can you please help to finish the review and merge? This feature has been delayed from 202211 release. Thanks.

cfgmgr/intfmgr.cpp Outdated Show resolved Hide resolved
cfgmgr/intfmgr.cpp Outdated Show resolved Hide resolved
cfgmgr/intfmgr.cpp Show resolved Hide resolved
cfgmgr/intfmgr.cpp Show resolved Hide resolved
cfgmgr/intfmgr.cpp Outdated Show resolved Hide resolved
cfgmgr/intfmgr.cpp Outdated Show resolved Hide resolved
cfgmgr/intfmgrd.cpp Outdated Show resolved Hide resolved
orchagent/intfsorch.cpp Show resolved Hide resolved
orchagent/intfsorch.cpp Outdated Show resolved Hide resolved
@zhangyanzhao
Copy link
Collaborator

@Junchao-Mellanox can you please help to approve the PR if you are good? Thanks.
@superchild can you please help to resolve the conflict? Thanks.

@Junchao-Mellanox
Copy link
Collaborator

hi @zhangyanzhao , i will approve once all comments are fixed.

@superchild
Copy link
Author

@Junchao-Mellanox ,
Please help to review again for the latest commit, it should address all comments.

* Fix test cases errors
* Refine logic to keep it simple
@zhangyanzhao
Copy link
Collaborator

/azpw run "Azure.sonic-swss"

@zhangyanzhao
Copy link
Collaborator

/azpw run

@zhangyanzhao
Copy link
Collaborator

@superchild can you please fix the conflicts? Thanks.

Copy link

linux-foundation-easycla bot commented Feb 7, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@superchild
Copy link
Author

@linarnan please help to sign the easyCLA

* Fixes mock test failure

* Fixes mock test run failure

fixes pipeline run failure

FAIL: p4orch_tests_usan
=======================

../../../orchagent/vrforch.cpp:113:41: runtime error: member call on
null pointer of type 'struct RouteOrch'
../../../orchagent/vrforch.cpp:113:41: runtime error: member access
within null pointer of type 'struct RouteOrch'
FAIL p4orch_tests_usan (exit status: 139)
@superchild
Copy link
Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liat-grozovik
Copy link
Collaborator

@superchild can you please handle conflict so i can go a head and merge?

@superchild
Copy link
Author

@liat-grozovik
I don't work on this project anymore and don't have related build machine to test.
I'll suggest someone can help to finish this or send the other PR.

@linarnan
Copy link

@liat-grozovik

I am from Edgecore, and will continue this work, thx

* Fixes mock test failure

* Fixes mock test run failure

fixes pipeline run failure

FAIL: p4orch_tests_usan
=======================

../../../orchagent/vrforch.cpp:113:41: runtime error: member call on
null pointer of type 'struct RouteOrch'
../../../orchagent/vrforch.cpp:113:41: runtime error: member access
within null pointer of type 'struct RouteOrch'
FAIL p4orch_tests_usan (exit status: 139)

* Fixed orchagent crash in VM with the Qos BUFFER_QUEUE|system-port|Queue-id-range config (sonic-net#3050)

* Fixed orchagent crash in VM with the Qos BUFFER_QUEUE|system-port|Queue-id-range config

* [intfsorch] Enable ipv6 proxy ndp along with proxy arp (sonic-net#3045)

* [intfsorch] Enable ipv6 proxy ndp along with proxy arp

setting SAI_VLAN_ATTR_UNKNOWN_MULTICAST_FLOOD_CONTROL_TYPE to
SAI_VLAN_FLOOD_CONTROL_TYPE_NONE when proxy arp is enabled. This fixes a
bug where ipv6 NS packets were flooding ports with duplicate packets. We
now set multicast flood type to none.

* Fix multi VLAN neighbor learning (sonic-net#3049)

What I did

When adding a new neighbor, check if the neighbor IP has already been learned on a different VLAN. If it has, remove the old neighbor entry before adding the new one.

Why I did it
On Gemini devices, if a neighbor IP moves from an active port in one VLAN to a second VLAN, then back to the first VLAN (with 3 different MAC addresses), orchagent will crash. Even though the MAC address of the last move is different from the first MAC address, orchagent believes the last MAC address to already be programmed in the hardware and tries to set an attribute of the entry which doesn't exist.

* [asan] Disable the "maybe-uninitialized" warning when compiled with ASAN enabled.

* Set HOST_TX_READY_NOTIFY attribute only after query capabilities(sonic-net#3070)

*Set HOST_TX_READY_NOTIFY attribute only after query capabilities

* [EVPN] Skip EVPN routes with invalid VNI or router mac field (sonic-net#3073)

* Skip EVPN routes with invalid VNI or router mac field

* Add port flap count and last flap timestamp to APPL_DB (sonic-net#3052)

* Add port flap count and last flap timestamp

* Add basic fabric link monitoring counters and states handling. (sonic-net#2988)

* Add basic fabric link monitoring counters and states handling.

* [Mellanox] Fix inconsistence in the shared headroom pool initialization (sonic-net#3057)

* Fix inconsistence in the shared headroom pool initialization

* Why I did it

During initialization, if SHP is enabled

the buffer pool sizes, xoff have initialized to 0, which means SHP is disabled
but the buffer profiles already indicate SHP
later on the buffer pool sizes are updated with off being non-zero
In case the orchagent starts handling buffer configuration between 2 and 3, it is inconsistent between buffer pools and profiles, which fails Mellanox SAI sanity check.
To avoid it, it indicates SHP enabled by setting a very small buffer pool and SHP sizes

* [acl] Add IN_PORTS qualifier for L3 table (sonic-net#3078)

* Apply IN_PORTS qualifiier for L3 table

Why I did it
IN_PORTS qualifier was allowed for L3 table in 202012 release and below. Changes in sonic-net#1982 removed that support leading to regression in some of our testcases. The following error was observed
ERR swss#orchagent: :- validateAclRuleMatch: Match SAI_ACL_ENTRY_ATTR_FIELD_IN_PORTS in rule RULE_1 is not supported by table DATAACL

* [bulker] add support for neighbor bulking (sonic-net#2768)

Adding support for sai_neighbor_api_t bulking in bulker.h

* [buffermgrd] Move switch-statement outside of if-statement in BufferMgr::doTask (sonic-net#3055)

* [buffermgr] Moved switch statement outside of if-statmement in Buffermgr::doTask

The switch statement which would normally erase buffer events was moved
to be inside the if-statement which would only enter if the event is a
SET event. This was introduced in commit e5329c39.

This would cause an infinite loop, since non-set events would never be
erased.

The switch statement has now been moved to occur outside the if,
allowing for non-set commands to be processed.

* [portsorch] process only updated APP_DB fields when port is already   created (sonic-net#3025)

* [portsorch] process only updated APP_DB fields when port is already created

What I did

Fixing an issue when setting some port attribute in APPL_DB triggers serdes parameters to be re-programmed with port toggling. Made portsorch to handle only those attributes that were pushed to APPL_DB, so that serdes programming happens only by xcvrd's request to do so.

* [Copp]Refactor coppmgr tests (sonic-net#3093)

What I did
Refactoring coppmgr mock tests

Why I did it
After migration to bookworm, coppmgr tests started failing due to the use of sudo commands.

* Revert "[acl] Add IN_PORTS qualifier for L3 table (sonic-net#3078)" (sonic-net#3092)

This reverts commit 9d4a3ad.
*Revert "[acl] Add IN_PORTS qualifier for L3 table"

* [orchagent] TWAMP Light orchagent implementation (sonic-net#2927)

* [orchagent] TWAMP Light orchagent implementation. (sonic-net#2927)
* What I did
Implemented the TWAMP Light feature according to the SONiC TWAMP Light HLD(sonic-net/SONiC#1320).

* Clang format change. (sonic-net#3080)

What I did
This PR has no real code change. It is purely clang formatting. It only applies to the P4Orch codes.
Commands that I run:
find orchagent/p4orch -name *.h -o -name .cpp | xargs clang-format -i -style="{BasedOnStyle: Microsoft, DerivePointerAlignment: false}"

find orchagent -name response_publisher -o -name return_code.h | xargs clang-format -i -style="{BasedOnStyle: Microsoft, DerivePointerAlignment: false}"

* T2-VOQ-VS: Fix iBGP bringup issue  (sonic-net#3053)

* Fix iBGP bringup issue T2-vswitch
* On T2-VOQ chassis Emulation with multi-asic linecards, iBGP sessions dont come up. Related Issue: sonic-net/sonic-buildimage#18129

* [Fdbsyncd] Adding extern_learn flag with fdb entry so Kernel doesn't age out (sonic-net#2985)

* Adding extern_learn flag with fdb entry so that Kernel doesn't age out the MAC

* [Fdbsyncd] Adding extern_learn flag with fdb entry so Kernel doesn't age out

What I did
extern_learn flag is added while programming the fdb entry into the Kernel. This will make sure that kernel doesn't age out the fdb entry. (#15004)

How I did it
A flag extern_learn will be passed while programing the fdb entry. (#15004)

How to verify it
Tested MAC add/del to the Kernel from the local FDB entry. (#15004)

Signed-off-by: kishore.kunal@broadcom.com

---------

Signed-off-by: kishore.kunal@broadcom.com
Co-authored-by: Sudharsan Dhamal Gopalarathnam <sudharsand@nvidia.com>

* Fix oper FEC retrieval after warmboot (sonic-net#3100)

Updating oper FEC status in state_db after warm-reboot as part of refresh port status call

* [EVPN]Fix fpmsyncd crash when EVPN type5 is received with bgp fib suppression enabled (sonic-net#3101)

* [EVPN]Fix fpmsyncd crash when EVPN type5 is received with bgp fib suppression enabled

* [portsorch] Handle TRANSCEIVER_INFO table on warm boot (sonic-net#3087)

* Add existing data from TRANSCEIVER_INFO table

* Introduce a new role for DPU-NPU Interconnect

Signed-off-by: Vivek Reddy Karri <vkarri@nvidia.com>
Co-authored-by: Sudharsan Dhamal Gopalarathnam <sudharsand@nvidia.com>

* [p4orch] Clang format change. (sonic-net#3096)

What I did
[p4orch]  This PR has no real code change. It is purely clang formatting. 
It does the same as sonic-net#3080.

* [dash] fix ENI admin state update (sonic-net#3081)

* [dash] fix ENI admin state update

* Add force option for fabric port unisolate command (sonic-net#3089)

What I did
Add force option to the unisolate link command, so users can make the links not isolate if they want.
depends on sonic-net/sonic-buildimage#18447

* [twamporch] Explicitly initialize local variable (sonic-net#3115)

What I did
Explicitly initialized local variable.

Why I did it
We met below error message in sonic-buildimage armhf build (sonic-net/sonic-buildimage#18334)

* Add bookworm build to the PR checkers (sonic-net#3114)

What I did
Add a Bookworm build to the PR checkers. Also fix some Bookworm build errors that crept in.

Why I did it
Buildimage now builds swss for Bookworm, so the build needs to succeed.

* [ACL] Remove flex counter when updating ACL rule (sonic-net#3118)

What I did
This PR is to fix sonic-net/sonic-buildimage#18719

When ACL rule is created for the first time, a flex counter is created and registered. When the same ACL rule is being updated, the FlexCounter created before is not removed, and another FlexCounter is created and registered.

Why I did it
Fix the issue that FlexCounter is duplicated when updating existing ACL rule.

---------

Signed-off-by: kishore.kunal@broadcom.com
Signed-off-by: Vivek Reddy Karri <vkarri@nvidia.com>
Co-authored-by: saksarav-nokia <sakthivadivu.saravanaraj@nokia.com>
Co-authored-by: Nikola Dancejic <26731235+Ndancejic@users.noreply.github.com>
Co-authored-by: Lawrence Lee <lawlee@microsoft.com>
Co-authored-by: Oleksandr Ivantsiv <oivantsiv@nvidia.com>
Co-authored-by: noaOrMlnx <58519608+noaOrMlnx@users.noreply.github.com>
Co-authored-by: Lior Avramov <73036155+liorghub@users.noreply.github.com>
Co-authored-by: Prince George <45705344+prgeor@users.noreply.github.com>
Co-authored-by: jfeng-arista <98421150+jfeng-arista@users.noreply.github.com>
Co-authored-by: Stephen Sun <5379172+stephenxs@users.noreply.github.com>
Co-authored-by: Neetha John <nejo@microsoft.com>
Co-authored-by: Amir <mazora@marvell.com>
Co-authored-by: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com>
Co-authored-by: Sudharsan Dhamal Gopalarathnam <sudharsand@nvidia.com>
Co-authored-by: xiaodong hu <32903206+huseratgithub@users.noreply.github.com>
Co-authored-by: mint570 <70396898+mint570@users.noreply.github.com>
Co-authored-by: Deepak Singhal <115033986+deepak-singhal0408@users.noreply.github.com>
Co-authored-by: KISHORE KUNAL <64033340+kishorekunal01@users.noreply.github.com>
Co-authored-by: Vivek <vivekreddykarri98@gmail.com>
Co-authored-by: Yakiv Huryk <62013282+Yakiv-Huryk@users.noreply.github.com>
Co-authored-by: Saikrishna Arcot <sarcot@microsoft.com>
Co-authored-by: bingwang-ms <66248323+bingwang-ms@users.noreply.github.com>
@pbrisset
Copy link

pbrisset commented May 1, 2024

Hi,
It's been a while this PR is in this state. Is there any plan to continue / finish the work on this?
Patrice

{
setHostSubIntfAdminStatus(alias, "down");
setIntfMac(alias, gwmac);
setHostSubIntfAdminStatus(alias, "up");

Choose a reason for hiding this comment

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

Wouldn't it be better to restore the interface to its original admin state instead of just bringing it up directly?

@yanjundeng
Copy link

Hi ALL Reviewers:
Since the PR is out of date with the latest master branch, Pls review : #3167
Thanks/yanjun

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.