Skip to content

Update ECMP NHopGroup for Port Channel oper down #1030

Merged
sumukhatv merged 5 commits intosonic-net:masterfrom
sumukhatv:portchannel
Sep 30, 2019
Merged

Update ECMP NHopGroup for Port Channel oper down #1030
sumukhatv merged 5 commits intosonic-net:masterfrom
sumukhatv:portchannel

Conversation

@sumukhatv
Copy link
Contributor

What I did
Remove nexthop member from nexthop group immediately when port-channel oper status becomes down

Why I did it
This will reduce the response time for port-channel down event thus helping prevent packet drops

How I verified it

Details if related
Timeline of events on a DUT immediately after bringing down a portchannel:
21:20:51 Updated NextHop group to 3 members
21:20:52 First v4 route update
21:21:13 Last v4 route update
21:21:13 4 member NextHop group deleted (v4)
21:21:13 3 member NextHop group created (v6)
21:21:13 First v6 route update
21:21:16 Last v6 route update

Sumukha Tumkur Vani added 3 commits August 9, 2019 14:46
@sumukhatv sumukhatv requested review from lguohan and prsunny August 16, 2019 20:00
@sumukhatv sumukhatv closed this Aug 16, 2019
@sumukhatv sumukhatv reopened this Aug 16, 2019
@prsunny
Copy link
Collaborator

prsunny commented Aug 16, 2019

@sumukhatv , would need to add a VS test for this change

@sumukhatv sumukhatv changed the title Portchannel Update ECMP NHopGroup for Port Channel oper down Aug 16, 2019
1. Add 4 PortChannels
2. Add to nexthop group
after bringing down a portchannel
tbl = swsscommon.Table(self.cdb, "PORTCHANNEL")
fvs = swsscommon.FieldValuePairs([("admin_status", "up"),("mtu", "9100"),("oper_status", "up")])

tbl.set("PortChannel001", fvs)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see that there is code repetition. If you can create a list of Portchannels and call function to do set, del operation, it will simplify and reduce the code. Just a suggestion.

@sumukhatv sumukhatv merged commit 175f3de into sonic-net:master Sep 30, 2019
tbl._del("PortChannel002")
tbl._del("PortChannel003")
tbl._del("PortChannel004")
time.sleep(1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Restore eth0 up. If test_port.py follows this test, we got persistent test failure.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@wendani , would you please provide the fix?

Janetxxx pushed a commit to Janetxxx/sonic-swss that referenced this pull request Nov 10, 2025
* Remove nexthop member from nexthopgroup
on detecting portchannel down

* Code cleanup

* Fix spacing errors

* Create new Test
1. Add 4 PortChannels
2. Add to nexthop group

* Check for 3 NH group members
after bringing down a portchannel
jianyuewu pushed a commit to jianyuewu/sonic-swss that referenced this pull request Dec 24, 2025
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.

4 participants