mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
Set coalesce settings for domain interfaces
This patch makes use of the virNetDevSetCoalesce() function to make appropriate settings effective for devices that support them. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1414627 Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
523c996062
commit
fcef44728d
@ -100,7 +100,7 @@ bhyveBuildNetArgStr(virConnectPtr conn,
|
|||||||
def->uuid, NULL, NULL, 0,
|
def->uuid, NULL, NULL, 0,
|
||||||
virDomainNetGetActualVirtPortProfile(net),
|
virDomainNetGetActualVirtPortProfile(net),
|
||||||
virDomainNetGetActualVlan(net),
|
virDomainNetGetActualVlan(net),
|
||||||
0, NULL,
|
NULL, 0, NULL,
|
||||||
VIR_NETDEV_TAP_CREATE_IFUP | VIR_NETDEV_TAP_CREATE_PERSIST) < 0) {
|
VIR_NETDEV_TAP_CREATE_IFUP | VIR_NETDEV_TAP_CREATE_PERSIST) < 0) {
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
@ -2311,7 +2311,7 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr driver,
|
|||||||
if (virNetDevTapCreateInBridgePort(network->def->bridge,
|
if (virNetDevTapCreateInBridgePort(network->def->bridge,
|
||||||
&macTapIfName, &network->def->mac,
|
&macTapIfName, &network->def->mac,
|
||||||
NULL, NULL, &tapfd, 1, NULL, NULL,
|
NULL, NULL, &tapfd, 1, NULL, NULL,
|
||||||
network->def->mtu, NULL,
|
NULL, network->def->mtu, NULL,
|
||||||
VIR_NETDEV_TAP_CREATE_USE_MAC_FOR_BRIDGE |
|
VIR_NETDEV_TAP_CREATE_USE_MAC_FOR_BRIDGE |
|
||||||
VIR_NETDEV_TAP_CREATE_IFUP |
|
VIR_NETDEV_TAP_CREATE_IFUP |
|
||||||
VIR_NETDEV_TAP_CREATE_PERSIST) < 0) {
|
VIR_NETDEV_TAP_CREATE_PERSIST) < 0) {
|
||||||
|
@ -545,7 +545,7 @@ qemuInterfaceBridgeConnect(virDomainDefPtr def,
|
|||||||
def->uuid, tunpath, tapfd, *tapfdSize,
|
def->uuid, tunpath, tapfd, *tapfdSize,
|
||||||
virDomainNetGetActualVirtPortProfile(net),
|
virDomainNetGetActualVirtPortProfile(net),
|
||||||
virDomainNetGetActualVlan(net),
|
virDomainNetGetActualVlan(net),
|
||||||
net->mtu, mtu,
|
net->coalesce, net->mtu, mtu,
|
||||||
tap_create_flags) < 0) {
|
tap_create_flags) < 0) {
|
||||||
virDomainAuditNetDevice(def, net, tunpath, false);
|
virDomainAuditNetDevice(def, net, tunpath, false);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
@ -125,7 +125,7 @@ umlConnectTapDevice(virDomainDefPtr vm,
|
|||||||
vm->uuid, net->backend.tap, &tapfd, 1,
|
vm->uuid, net->backend.tap, &tapfd, 1,
|
||||||
virDomainNetGetActualVirtPortProfile(net),
|
virDomainNetGetActualVirtPortProfile(net),
|
||||||
virDomainNetGetActualVlan(net),
|
virDomainNetGetActualVlan(net),
|
||||||
0, NULL,
|
NULL, 0, NULL,
|
||||||
VIR_NETDEV_TAP_CREATE_IFUP |
|
VIR_NETDEV_TAP_CREATE_IFUP |
|
||||||
VIR_NETDEV_TAP_CREATE_PERSIST) < 0) {
|
VIR_NETDEV_TAP_CREATE_PERSIST) < 0) {
|
||||||
if (template_ifname)
|
if (template_ifname)
|
||||||
|
@ -584,6 +584,7 @@ virNetDevTapAttachBridge(const char *tapname,
|
|||||||
* @tapfd: array of file descriptor return value for the new tap device
|
* @tapfd: array of file descriptor return value for the new tap device
|
||||||
* @tapfdSize: number of file descriptors in @tapfd
|
* @tapfdSize: number of file descriptors in @tapfd
|
||||||
* @virtPortProfile: bridge/port specific configuration
|
* @virtPortProfile: bridge/port specific configuration
|
||||||
|
* @coalesce: optional coalesce parameters
|
||||||
* @mtu: requested MTU for port (or 0 for "default")
|
* @mtu: requested MTU for port (or 0 for "default")
|
||||||
* @actualMTU: MTU actually set for port (after accounting for bridge's MTU)
|
* @actualMTU: MTU actually set for port (after accounting for bridge's MTU)
|
||||||
* @flags: OR of virNetDevTapCreateFlags:
|
* @flags: OR of virNetDevTapCreateFlags:
|
||||||
@ -616,6 +617,7 @@ int virNetDevTapCreateInBridgePort(const char *brname,
|
|||||||
size_t tapfdSize,
|
size_t tapfdSize,
|
||||||
virNetDevVPortProfilePtr virtPortProfile,
|
virNetDevVPortProfilePtr virtPortProfile,
|
||||||
virNetDevVlanPtr virtVlan,
|
virNetDevVlanPtr virtVlan,
|
||||||
|
virNetDevCoalescePtr coalesce,
|
||||||
unsigned int mtu,
|
unsigned int mtu,
|
||||||
unsigned int *actualMTU,
|
unsigned int *actualMTU,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
@ -661,6 +663,9 @@ int virNetDevTapCreateInBridgePort(const char *brname,
|
|||||||
if (virNetDevSetOnline(*ifname, !!(flags & VIR_NETDEV_TAP_CREATE_IFUP)) < 0)
|
if (virNetDevSetOnline(*ifname, !!(flags & VIR_NETDEV_TAP_CREATE_IFUP)) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
if (virNetDevSetCoalesce(*ifname, coalesce) < 0)
|
||||||
|
goto error;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
# define __VIR_NETDEV_TAP_H__
|
# define __VIR_NETDEV_TAP_H__
|
||||||
|
|
||||||
# include "internal.h"
|
# include "internal.h"
|
||||||
|
# include "virnetdev.h"
|
||||||
# include "virnetdevvportprofile.h"
|
# include "virnetdevvportprofile.h"
|
||||||
# include "virnetdevvlan.h"
|
# include "virnetdevvlan.h"
|
||||||
|
|
||||||
@ -83,6 +84,7 @@ int virNetDevTapCreateInBridgePort(const char *brname,
|
|||||||
size_t tapfdSize,
|
size_t tapfdSize,
|
||||||
virNetDevVPortProfilePtr virtPortProfile,
|
virNetDevVPortProfilePtr virtPortProfile,
|
||||||
virNetDevVlanPtr virtVlan,
|
virNetDevVlanPtr virtVlan,
|
||||||
|
virNetDevCoalescePtr coalesce,
|
||||||
unsigned int mtu,
|
unsigned int mtu,
|
||||||
unsigned int *actualMTU,
|
unsigned int *actualMTU,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
|
@ -28,6 +28,7 @@ int virNetDevTapCreateInBridgePort(const char *brname ATTRIBUTE_UNUSED,
|
|||||||
size_t tapfdSize ATTRIBUTE_UNUSED,
|
size_t tapfdSize ATTRIBUTE_UNUSED,
|
||||||
virNetDevVPortProfilePtr virtPortProfile ATTRIBUTE_UNUSED,
|
virNetDevVPortProfilePtr virtPortProfile ATTRIBUTE_UNUSED,
|
||||||
virNetDevVlanPtr virtVlan ATTRIBUTE_UNUSED,
|
virNetDevVlanPtr virtVlan ATTRIBUTE_UNUSED,
|
||||||
|
virNetDevCoalescePtr coalesce ATTRIBUTE_UNUSED,
|
||||||
unsigned int mtu ATTRIBUTE_UNUSED,
|
unsigned int mtu ATTRIBUTE_UNUSED,
|
||||||
unsigned int *actualMTU ATTRIBUTE_UNUSED,
|
unsigned int *actualMTU ATTRIBUTE_UNUSED,
|
||||||
unsigned int fakeflags ATTRIBUTE_UNUSED)
|
unsigned int fakeflags ATTRIBUTE_UNUSED)
|
||||||
|
Loading…
Reference in New Issue
Block a user