Skip to content

[swss]: Reduce tunnel_packet_handler memory usage#9762

Merged
theasianpianist merged 2 commits intosonic-net:masterfrom
theasianpianist:tun-pkt-handler-fix
Feb 7, 2022
Merged

[swss]: Reduce tunnel_packet_handler memory usage#9762
theasianpianist merged 2 commits intosonic-net:masterfrom
theasianpianist:tun-pkt-handler-fix

Conversation

@theasianpianist
Copy link
Contributor

Signed-off-by: Lawrence Lee lawlee@microsoft.com

Why I did it

The tunnel packet handler gradually leaks memory

How I did it

  • Remove call to the link_lookup method from the Pyroute2 library
  • Use the store=0 argument for the Scapy sniffer

How to verify it

  • Run the packet handler and observe SWSS memory usage using docker stat

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106

Description for the changelog

A picture of a cute animal (not mandatory but encouraged)

Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
@prsunny
Copy link
Contributor

prsunny commented Jan 19, 2022

let's plan to add a sonic-mgmt test for this. Mainly since we are manipulating the netlink attribute and in case future kernel versions has any change, it would be easy to catch.

prsunny
prsunny previously approved these changes Jan 20, 2022
name was found
"""
Gets a mapping of interface kernel indices to portchannel interfaces
attr_list = msg['attrs']
Copy link
Contributor

Choose a reason for hiding this comment

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

will there be a case if attr_list is null?

Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
@theasianpianist theasianpianist merged commit eff80f7 into sonic-net:master Feb 7, 2022
qiluo-msft pushed a commit that referenced this pull request Feb 8, 2022
* Configure scapy to not store sniffed packets

Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
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.

3 participants