浏览代码

Allow to set the control plane MTU

Add daemon config to allow the user to specify the MTU of the control plane network.
The first user of this new parameter is actually libnetwork that can seed the
gossip with the proper MTU value allowing to pack multiple messages per UDP packet sent.
If the value is not specified or is lower than 1500 the logic will set it to the default.

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
Flavio Crisciani 8 年之前
父节点
当前提交
f9f25ca5e4
共有 3 个文件被更改,包括 5 次插入0 次删除
  1. 1 0
      cmd/dockerd/config.go
  2. 2 0
      daemon/config/config.go
  3. 2 0
      daemon/daemon.go

+ 1 - 0
cmd/dockerd/config.go

@@ -63,6 +63,7 @@ func installCommonConfigFlags(conf *config.Config, flags *pflag.FlagSet) {
 	flags.StringVar(&conf.MetricsAddress, "metrics-addr", "", "Set default address and port to serve the metrics api on")
 
 	flags.StringVar(&conf.NodeGenericResources, "node-generic-resources", "", "user defined resources (e.g. fpga=2;gpu={UUID1,UUID2,UUID3})")
+	flags.IntVar(&conf.NetworkControlPlaneMTU, "network-control-plane-mtu", config.DefaultNetworkMtu, "Network Control plane MTU")
 
 	// "--deprecated-key-path" is to allow configuration of the key used
 	// for the daemon ID and the deprecated image signing. It was never

+ 2 - 0
daemon/config/config.go

@@ -171,6 +171,8 @@ type CommonConfig struct {
 
 	// Exposed node Generic Resources
 	NodeGenericResources string `json:"node-generic-resources,omitempty"`
+	// NetworkControlPlaneMTU allows to specify the control plane MTU, this will allow to optimize the network use in some components
+	NetworkControlPlaneMTU int `json:"network-control-plane-mtu,omitempty"`
 }
 
 // IsValueSet returns true if a configuration value

+ 2 - 0
daemon/daemon.go

@@ -1149,6 +1149,8 @@ func (daemon *Daemon) networkOptions(dconfig *config.Config, pg plugingetter.Plu
 		options = append(options, nwconfig.OptionPluginGetter(pg))
 	}
 
+	options = append(options, nwconfig.OptionNetworkControlPlaneMTU(dconfig.NetworkControlPlaneMTU))
+
 	return options, nil
 }