Skip to content

[201911] Avoid adding loopback interface (ip link add) when setting nat zone on loopback interface#1434

Merged
arlakshm merged 1 commit intosonic-net:201911from
AkhileshSamineni:skip_loopback_add_201911
Sep 17, 2020
Merged

[201911] Avoid adding loopback interface (ip link add) when setting nat zone on loopback interface#1434
arlakshm merged 1 commit intosonic-net:201911from
AkhileshSamineni:skip_loopback_add_201911

Conversation

@AkhileshSamineni
Copy link
Contributor

This is a clone for the PR #1411

Issue (#1311) :

Add Loopback interface to NAT zone 1
sudo config nat add interface Loopback0 -nat_zone 1

Seeing below error logs when NAT zone for Loopback changed to 1.

Apr 21 11:44:33.805637 cab18-3-dut INFO swss#supervisord: intfmgrd RTNETLINK answers: File exists
Apr 21 11:44:33.805637 cab18-3-dut ERR swss#intfmgrd: :- exec: /sbin/ip link add Loopback0 mtu 65536 type dummy && /sbin/ip link set Loopback0 up: Success
Apr 21 11:44:33.805637 cab18-3-dut ERR swss#intfmgrd: :- addLoopbackIntf: Command '/sbin/ip link add Loopback0 mtu 65536 type dummy && /sbin/ip link set Loopback0 up' failed with rc 512

Root cause for logs:

Whenever the ip address is assigned to Loopback1 using below command, "ip link" gets added for Loopback1 like shown below
config interface ip add Loopback1 20.20.20.20/32

82: Loopback1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/ether 86:68:3c:f4:25:b7 brd ff:ff:ff:ff:ff:ff

Then when setting the nat zone for the Loopback1 interface to 1, it tries to add "ip link" for Loopback1 again and leads to syslog errors.

Note : These syslog errors for Loopback will seen for all fields like vrf_name, mac_addr, admin_status, proxy_arp, errors are not specific to nat_zone field. Fields are https://github.com/Azure/sonic-swss/blob/master/cfgmgr/intfmgr.cpp#L383

Fix:

Added a set container to hold the Loopback string whenever loopback interface is created and using it to avoid the "addLoopbackIntf" call for the fields setting like nat_zone.

Signed-off-by: Akhilesh Samineni [email protected]

…n loopback interface

Signed-off-by: Akhilesh Samineni <[email protected]>
@arlakshm arlakshm merged commit 40ff871 into sonic-net:201911 Sep 17, 2020
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
#### What I did

Refactor psuutil to use sonic-platform package in lieu of old, deprecated platform plugins.

The psuutil utility is still useful, as psushow only reads and displays PSU data from State DB. However, this utility provides us the ability to read directly from the PSUs which is helpful for debugging.

#### How I did it

- Complete refactor to use sonic-platform package
- Add more output columns to display (Model, Serial, Voltage, Current, Power)
- Bump version to 2.0
- Add basic unit tests
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.

2 participants