|
|
3e5111 |
From 7fadd91380ce1000f3aa5b6e5c4b928f883fbb33 Mon Sep 17 00:00:00 2001
|
|
|
3e5111 |
Message-Id: <7fadd91380ce1000f3aa5b6e5c4b928f883fbb33@dist-git>
|
|
|
3e5111 |
From: Martin Kletzander <mkletzan@redhat.com>
|
|
|
3e5111 |
Date: Tue, 25 Apr 2017 13:41:17 +0200
|
|
|
3e5111 |
Subject: [PATCH] Set coalesce settings for domain interfaces
|
|
|
3e5111 |
|
|
|
3e5111 |
This patch makes use of the virNetDevSetCoalesce() function to make
|
|
|
3e5111 |
appropriate settings effective for devices that support them.
|
|
|
3e5111 |
|
|
|
3e5111 |
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1414627
|
|
|
3e5111 |
|
|
|
3e5111 |
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
|
|
|
3e5111 |
(cherry picked from commit fcef44728dff9cb708d00d17f5e0b44aa513f27b)
|
|
|
3e5111 |
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
|
|
|
3e5111 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
3e5111 |
---
|
|
|
3e5111 |
src/bhyve/bhyve_command.c | 2 +-
|
|
|
3e5111 |
src/network/bridge_driver.c | 2 +-
|
|
|
3e5111 |
src/qemu/qemu_interface.c | 2 +-
|
|
|
3e5111 |
src/uml/uml_conf.c | 2 +-
|
|
|
3e5111 |
src/util/virnetdevtap.c | 5 +++++
|
|
|
3e5111 |
src/util/virnetdevtap.h | 2 ++
|
|
|
3e5111 |
tests/bhyvexml2argvmock.c | 1 +
|
|
|
3e5111 |
7 files changed, 12 insertions(+), 4 deletions(-)
|
|
|
3e5111 |
|
|
|
3e5111 |
diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c
|
|
|
3e5111 |
index e0528ed77..e9c072b9f 100644
|
|
|
3e5111 |
--- a/src/bhyve/bhyve_command.c
|
|
|
3e5111 |
+++ b/src/bhyve/bhyve_command.c
|
|
|
3e5111 |
@@ -100,7 +100,7 @@ bhyveBuildNetArgStr(virConnectPtr conn,
|
|
|
3e5111 |
def->uuid, NULL, NULL, 0,
|
|
|
3e5111 |
virDomainNetGetActualVirtPortProfile(net),
|
|
|
3e5111 |
virDomainNetGetActualVlan(net),
|
|
|
3e5111 |
- 0, NULL,
|
|
|
3e5111 |
+ NULL, 0, NULL,
|
|
|
3e5111 |
VIR_NETDEV_TAP_CREATE_IFUP | VIR_NETDEV_TAP_CREATE_PERSIST) < 0) {
|
|
|
3e5111 |
goto cleanup;
|
|
|
3e5111 |
}
|
|
|
3e5111 |
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
|
|
|
3e5111 |
index 41bce794a..b0026ab17 100644
|
|
|
3e5111 |
--- a/src/network/bridge_driver.c
|
|
|
3e5111 |
+++ b/src/network/bridge_driver.c
|
|
|
3e5111 |
@@ -2315,7 +2315,7 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr driver,
|
|
|
3e5111 |
if (virNetDevTapCreateInBridgePort(network->def->bridge,
|
|
|
3e5111 |
&macTapIfName, &network->def->mac,
|
|
|
3e5111 |
NULL, NULL, &tapfd, 1, NULL, NULL,
|
|
|
3e5111 |
- network->def->mtu, NULL,
|
|
|
3e5111 |
+ NULL, network->def->mtu, NULL,
|
|
|
3e5111 |
VIR_NETDEV_TAP_CREATE_USE_MAC_FOR_BRIDGE |
|
|
|
3e5111 |
VIR_NETDEV_TAP_CREATE_IFUP |
|
|
|
3e5111 |
VIR_NETDEV_TAP_CREATE_PERSIST) < 0) {
|
|
|
3e5111 |
diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c
|
|
|
3e5111 |
index c5dca60f1..2057ac929 100644
|
|
|
3e5111 |
--- a/src/qemu/qemu_interface.c
|
|
|
3e5111 |
+++ b/src/qemu/qemu_interface.c
|
|
|
3e5111 |
@@ -545,7 +545,7 @@ qemuInterfaceBridgeConnect(virDomainDefPtr def,
|
|
|
3e5111 |
def->uuid, tunpath, tapfd, *tapfdSize,
|
|
|
3e5111 |
virDomainNetGetActualVirtPortProfile(net),
|
|
|
3e5111 |
virDomainNetGetActualVlan(net),
|
|
|
3e5111 |
- net->mtu, mtu,
|
|
|
3e5111 |
+ net->coalesce, net->mtu, mtu,
|
|
|
3e5111 |
tap_create_flags) < 0) {
|
|
|
3e5111 |
virDomainAuditNetDevice(def, net, tunpath, false);
|
|
|
3e5111 |
goto cleanup;
|
|
|
3e5111 |
diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c
|
|
|
3e5111 |
index 871653c5a..bdef78324 100644
|
|
|
3e5111 |
--- a/src/uml/uml_conf.c
|
|
|
3e5111 |
+++ b/src/uml/uml_conf.c
|
|
|
3e5111 |
@@ -125,7 +125,7 @@ umlConnectTapDevice(virDomainDefPtr vm,
|
|
|
3e5111 |
vm->uuid, net->backend.tap, &tapfd, 1,
|
|
|
3e5111 |
virDomainNetGetActualVirtPortProfile(net),
|
|
|
3e5111 |
virDomainNetGetActualVlan(net),
|
|
|
3e5111 |
- 0, NULL,
|
|
|
3e5111 |
+ NULL, 0, NULL,
|
|
|
3e5111 |
VIR_NETDEV_TAP_CREATE_IFUP |
|
|
|
3e5111 |
VIR_NETDEV_TAP_CREATE_PERSIST) < 0) {
|
|
|
3e5111 |
if (template_ifname)
|
|
|
3e5111 |
diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c
|
|
|
3e5111 |
index 93002b929..c8dacfe27 100644
|
|
|
3e5111 |
--- a/src/util/virnetdevtap.c
|
|
|
3e5111 |
+++ b/src/util/virnetdevtap.c
|
|
|
3e5111 |
@@ -584,6 +584,7 @@ virNetDevTapAttachBridge(const char *tapname,
|
|
|
3e5111 |
* @tapfd: array of file descriptor return value for the new tap device
|
|
|
3e5111 |
* @tapfdSize: number of file descriptors in @tapfd
|
|
|
3e5111 |
* @virtPortProfile: bridge/port specific configuration
|
|
|
3e5111 |
+ * @coalesce: optional coalesce parameters
|
|
|
3e5111 |
* @mtu: requested MTU for port (or 0 for "default")
|
|
|
3e5111 |
* @actualMTU: MTU actually set for port (after accounting for bridge's MTU)
|
|
|
3e5111 |
* @flags: OR of virNetDevTapCreateFlags:
|
|
|
3e5111 |
@@ -616,6 +617,7 @@ int virNetDevTapCreateInBridgePort(const char *brname,
|
|
|
3e5111 |
size_t tapfdSize,
|
|
|
3e5111 |
virNetDevVPortProfilePtr virtPortProfile,
|
|
|
3e5111 |
virNetDevVlanPtr virtVlan,
|
|
|
3e5111 |
+ virNetDevCoalescePtr coalesce,
|
|
|
3e5111 |
unsigned int mtu,
|
|
|
3e5111 |
unsigned int *actualMTU,
|
|
|
3e5111 |
unsigned int flags)
|
|
|
3e5111 |
@@ -661,6 +663,9 @@ int virNetDevTapCreateInBridgePort(const char *brname,
|
|
|
3e5111 |
if (virNetDevSetOnline(*ifname, !!(flags & VIR_NETDEV_TAP_CREATE_IFUP)) < 0)
|
|
|
3e5111 |
goto error;
|
|
|
3e5111 |
|
|
|
3e5111 |
+ if (virNetDevSetCoalesce(*ifname, coalesce) < 0)
|
|
|
3e5111 |
+ goto error;
|
|
|
3e5111 |
+
|
|
|
3e5111 |
return 0;
|
|
|
3e5111 |
|
|
|
3e5111 |
error:
|
|
|
3e5111 |
diff --git a/src/util/virnetdevtap.h b/src/util/virnetdevtap.h
|
|
|
3e5111 |
index 6bb3b8891..bd5ec14d4 100644
|
|
|
3e5111 |
--- a/src/util/virnetdevtap.h
|
|
|
3e5111 |
+++ b/src/util/virnetdevtap.h
|
|
|
3e5111 |
@@ -24,6 +24,7 @@
|
|
|
3e5111 |
# define __VIR_NETDEV_TAP_H__
|
|
|
3e5111 |
|
|
|
3e5111 |
# include "internal.h"
|
|
|
3e5111 |
+# include "virnetdev.h"
|
|
|
3e5111 |
# include "virnetdevvportprofile.h"
|
|
|
3e5111 |
# include "virnetdevvlan.h"
|
|
|
3e5111 |
|
|
|
3e5111 |
@@ -83,6 +84,7 @@ int virNetDevTapCreateInBridgePort(const char *brname,
|
|
|
3e5111 |
size_t tapfdSize,
|
|
|
3e5111 |
virNetDevVPortProfilePtr virtPortProfile,
|
|
|
3e5111 |
virNetDevVlanPtr virtVlan,
|
|
|
3e5111 |
+ virNetDevCoalescePtr coalesce,
|
|
|
3e5111 |
unsigned int mtu,
|
|
|
3e5111 |
unsigned int *actualMTU,
|
|
|
3e5111 |
unsigned int flags)
|
|
|
3e5111 |
diff --git a/tests/bhyvexml2argvmock.c b/tests/bhyvexml2argvmock.c
|
|
|
3e5111 |
index fd714694f..7afa0e34c 100644
|
|
|
3e5111 |
--- a/tests/bhyvexml2argvmock.c
|
|
|
3e5111 |
+++ b/tests/bhyvexml2argvmock.c
|
|
|
3e5111 |
@@ -28,6 +28,7 @@ int virNetDevTapCreateInBridgePort(const char *brname ATTRIBUTE_UNUSED,
|
|
|
3e5111 |
size_t tapfdSize ATTRIBUTE_UNUSED,
|
|
|
3e5111 |
virNetDevVPortProfilePtr virtPortProfile ATTRIBUTE_UNUSED,
|
|
|
3e5111 |
virNetDevVlanPtr virtVlan ATTRIBUTE_UNUSED,
|
|
|
3e5111 |
+ virNetDevCoalescePtr coalesce ATTRIBUTE_UNUSED,
|
|
|
3e5111 |
unsigned int mtu ATTRIBUTE_UNUSED,
|
|
|
3e5111 |
unsigned int *actualMTU ATTRIBUTE_UNUSED,
|
|
|
3e5111 |
unsigned int fakeflags ATTRIBUTE_UNUSED)
|
|
|
3e5111 |
--
|
|
|
3e5111 |
2.12.2
|
|
|
3e5111 |
|