Browse code

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 authored on 2017/07/29 05:18:49
Showing 3 changed files
... ...
@@ -63,6 +63,7 @@ func installCommonConfigFlags(conf *config.Config, flags *pflag.FlagSet) {
63 63
 	flags.StringVar(&conf.MetricsAddress, "metrics-addr", "", "Set default address and port to serve the metrics api on")
64 64
 
65 65
 	flags.StringVar(&conf.NodeGenericResources, "node-generic-resources", "", "user defined resources (e.g. fpga=2;gpu={UUID1,UUID2,UUID3})")
66
+	flags.IntVar(&conf.NetworkControlPlaneMTU, "network-control-plane-mtu", config.DefaultNetworkMtu, "Network Control plane MTU")
66 67
 
67 68
 	// "--deprecated-key-path" is to allow configuration of the key used
68 69
 	// for the daemon ID and the deprecated image signing. It was never
... ...
@@ -171,6 +171,8 @@ type CommonConfig struct {
171 171
 
172 172
 	// Exposed node Generic Resources
173 173
 	NodeGenericResources string `json:"node-generic-resources,omitempty"`
174
+	// NetworkControlPlaneMTU allows to specify the control plane MTU, this will allow to optimize the network use in some components
175
+	NetworkControlPlaneMTU int `json:"network-control-plane-mtu,omitempty"`
174 176
 }
175 177
 
176 178
 // IsValueSet returns true if a configuration value
... ...
@@ -1149,6 +1149,8 @@ func (daemon *Daemon) networkOptions(dconfig *config.Config, pg plugingetter.Plu
1149 1149
 		options = append(options, nwconfig.OptionPluginGetter(pg))
1150 1150
 	}
1151 1151
 
1152
+	options = append(options, nwconfig.OptionNetworkControlPlaneMTU(dconfig.NetworkControlPlaneMTU))
1153
+
1152 1154
 	return options, nil
1153 1155
 }
1154 1156