gc_thresh values update to support higher scale for arp and nd entries #6192
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
- Why I did it
When sending a lot of ARP/ND requests in a burst, ARP entries are getting purged from the kernel while the later set of ARP entries was still getting added.
The sequence of add/remove is in such a way that we were never able to cross ~2400 entries .
- How I did it
In the kernel ARP module the following attributes govern how many ARP entries are key in the Kernel ARP cache
gc_thresh1
The minimum number of entries to keep in the ARP cache. The garbage collector will not run if there are fewer than this number of entries in the cache. Defaults to 128.
gc_thresh2
The soft maximum number of entries to keep in the ARP cache. The garbage collector will allow the number of entries to exceed this for 5 seconds before collection will be performed. Defaults to 512.
gc_thresh3
The hard maximum number of entries to keep in the ARP cache. The garbage collector will always run if there are more than this number of entries in the cache. Defaults to 1024.
To increase the number of ARP/ND entries these attributes will be changed to following values for IPv4 and IPv6
net.ipv4.neigh.default.gc_thresh1=16000
net.ipv4.neigh.default.gc_thresh2=32000
net.ipv4.neigh.default.gc_thresh3=48000
net.ipv6.neigh.default.gc_thresh1=8000
net.ipv6.neigh.default.gc_thresh2=16000
net.ipv6.neigh.default.gc_thresh3=32000
- How to verify it
Verification Tests done :
Arp
root@sonic:# sudo cat /proc/sys/net/ipv4/neigh/default/gc_thresh1
32000
root@sonic:# sudo cat /proc/sys/net/ipv4/neigh/default/gc_thresh2
48000
root@sonic:# sudo cat /proc/sys/net/ipv4/neigh/default/gc_thresh3
64000
root@sonic:#
root@sonic:# ip -4 neigh show | wc -l
32011
root@sonic:#
root@sonic:# show arp | grep Total
Total number of entries 32000
root@sonic:#
ND
root@sonic:# sudo cat /proc/sys/net/ipv6/neigh/default/gc_thresh1
16000
root@sonic:# sudo cat /proc/sys/net/ipv6/neigh/default/gc_thresh2
32000
root@sonic:# sudo cat /proc/sys/net/ipv6/neigh/default/gc_thresh3
48000
root@sonic:#
root@sonic:# ip -6 neigh show | wc -l
16076
root@sonic:#
root@sonic:# show ndp | grep Total
Total number of entries 16007
root@sonic:#
- Description for the changelog
Update of gc_thresh value to support 32k arp and 16k ND entries