2017-05-31 19:46:14 -04:00
|
|
|
package overlay
|
|
|
|
|
|
|
|
import (
|
2018-03-22 18:30:14 -04:00
|
|
|
"strconv"
|
2017-05-31 19:46:14 -04:00
|
|
|
|
2021-04-05 20:24:47 -04:00
|
|
|
"github.com/docker/docker/libnetwork/osl/kernel"
|
2017-05-31 19:46:14 -04:00
|
|
|
)
|
|
|
|
|
2018-05-18 17:10:14 -04:00
|
|
|
var ovConfig = map[string]*kernel.OSValue{
|
2019-06-26 11:50:56 -04:00
|
|
|
"net.ipv4.neigh.default.gc_thresh1": {Value: "8192", CheckFn: checkHigher},
|
|
|
|
"net.ipv4.neigh.default.gc_thresh2": {Value: "49152", CheckFn: checkHigher},
|
|
|
|
"net.ipv4.neigh.default.gc_thresh3": {Value: "65536", CheckFn: checkHigher},
|
2018-03-22 18:30:14 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
func checkHigher(val1, val2 string) bool {
|
|
|
|
val1Int, _ := strconv.ParseInt(val1, 10, 32)
|
|
|
|
val2Int, _ := strconv.ParseInt(val2, 10, 32)
|
|
|
|
return val1Int < val2Int
|
2017-05-31 19:46:14 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
func applyOStweaks() {
|
2018-05-18 17:10:14 -04:00
|
|
|
kernel.ApplyOSTweaks(ovConfig)
|
2017-05-31 19:46:14 -04:00
|
|
|
}
|