[PATCH 3/3] Set coalesce settings for domain interfaces

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 src/bhyve/bhyve_command.c   | 2 +-
 src/network/bridge_driver.c | 2 +-
 src/qemu/qemu_interface.c   | 2 +-
 src/uml/uml_conf.c          | 2 +-
 src/util/virnetdevtap.c     | 8 +++++++-
 src/util/virnetdevtap.h     | 2 ++
 tests/bhyvexml2argvmock.c   | 1 +
 7 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c
index e0528ed77a2c..e9c072b9f578 100644
--- a/src/bhyve/bhyve_command.c
+++ b/src/bhyve/bhyve_command.c
@@ -100,7 +100,7 @@ bhyveBuildNetArgStr(virConnectPtr conn,
                                            def->uuid, NULL, NULL, 0,
                                            virDomainNetGetActualVirtPortProfile(net),
                                            virDomainNetGetActualVlan(net),
-                                           0, NULL,
+                                           NULL, 0, NULL,
                                            VIR_NETDEV_TAP_CREATE_IFUP | VIR_NETDEV_TAP_CREATE_PERSIST) < 0) {
             goto cleanup;
         }
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 5ccd37a3213b..9517f97dfb40 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -2312,7 +2312,7 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr driver,
         if (virNetDevTapCreateInBridgePort(network->def->bridge,
                                            &macTapIfName, &network->def->mac,
                                            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_IFUP |
                                            VIR_NETDEV_TAP_CREATE_PERSIST) < 0) {
diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c
index c5dca60f1f65..2057ac9293f2 100644
--- a/src/qemu/qemu_interface.c
+++ b/src/qemu/qemu_interface.c
@@ -545,7 +545,7 @@ qemuInterfaceBridgeConnect(virDomainDefPtr def,
                                            def->uuid, tunpath, tapfd, *tapfdSize,
                                            virDomainNetGetActualVirtPortProfile(net),
                                            virDomainNetGetActualVlan(net),
-                                           net->mtu, mtu,
+                                           net->coalesce, net->mtu, mtu,
                                            tap_create_flags) < 0) {
             virDomainAuditNetDevice(def, net, tunpath, false);
             goto cleanup;
diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c
index 871653c5a64c..bdef78324385 100644
--- a/src/uml/uml_conf.c
+++ b/src/uml/uml_conf.c
@@ -125,7 +125,7 @@ umlConnectTapDevice(virDomainDefPtr vm,
                                        vm->uuid, net->backend.tap, &tapfd, 1,
                                        virDomainNetGetActualVirtPortProfile(net),
                                        virDomainNetGetActualVlan(net),
-                                       0, NULL,
+                                       NULL, 0, NULL,
                                        VIR_NETDEV_TAP_CREATE_IFUP |
                                        VIR_NETDEV_TAP_CREATE_PERSIST) < 0) {
         if (template_ifname)
diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c
index 02ef7fd24047..fe452943ab5e 100644
--- a/src/util/virnetdevtap.c
+++ b/src/util/virnetdevtap.c
@@ -584,6 +584,7 @@ virNetDevTapAttachBridge(const char *tapname,
  * @tapfd: array of file descriptor return value for the new tap device
  * @tapfdSize: number of file descriptors in @tapfd
  * @virtPortProfile: bridge/port specific configuration
+ * @coalesce: optional coalesce parameters
  * @mtu: requested MTU for port (or 0 for "default")
  * @actualMTU: MTU actually set for port (after accounting for bridge's MTU)
  * @flags: OR of virNetDevTapCreateFlags:
@@ -616,6 +617,7 @@ int virNetDevTapCreateInBridgePort(const char *brname,
                                    size_t tapfdSize,
                                    virNetDevVPortProfilePtr virtPortProfile,
                                    virNetDevVlanPtr virtVlan,
+                                   virNetDevCoalescePtr coalesce,
                                    unsigned int mtu,
                                    unsigned int *actualMTU,
                                    unsigned int flags)
@@ -654,13 +656,17 @@ int virNetDevTapCreateInBridgePort(const char *brname,
         goto error;

     if (virNetDevTapAttachBridge(*ifname, brname, macaddr, vmuuid,
-                                 virtPortProfile, virtVlan, mtu, actualMTU) < 0) {
+                                 virtPortProfile, virtVlan,
+                                 mtu, actualMTU) < 0) {
         goto error;
     }

     if (virNetDevSetOnline(*ifname, !!(flags & VIR_NETDEV_TAP_CREATE_IFUP)) < 0)
         goto error;

+    if (virNetDevSetCoalesce(*ifname, coalesce) < 0)
+        goto error;
+
     return 0;

  error:
diff --git a/src/util/virnetdevtap.h b/src/util/virnetdevtap.h
index 6bb3b8891c21..bd5ec14d448f 100644
--- a/src/util/virnetdevtap.h
+++ b/src/util/virnetdevtap.h
@@ -24,6 +24,7 @@
 # define __VIR_NETDEV_TAP_H__

 # include "internal.h"
+# include "virnetdev.h"
 # include "virnetdevvportprofile.h"
 # include "virnetdevvlan.h"

@@ -83,6 +84,7 @@ int virNetDevTapCreateInBridgePort(const char *brname,
                                    size_t tapfdSize,
                                    virNetDevVPortProfilePtr virtPortProfile,
                                    virNetDevVlanPtr virtVlan,
+                                   virNetDevCoalescePtr coalesce,
                                    unsigned int mtu,
                                    unsigned int *actualMTU,
                                    unsigned int flags)
diff --git a/tests/bhyvexml2argvmock.c b/tests/bhyvexml2argvmock.c
index fd714694f0bd..7afa0e34c43c 100644
--- a/tests/bhyvexml2argvmock.c
+++ b/tests/bhyvexml2argvmock.c
@@ -28,6 +28,7 @@ int virNetDevTapCreateInBridgePort(const char *brname ATTRIBUTE_UNUSED,
                                    size_t tapfdSize ATTRIBUTE_UNUSED,
                                    virNetDevVPortProfilePtr virtPortProfile ATTRIBUTE_UNUSED,
                                    virNetDevVlanPtr virtVlan ATTRIBUTE_UNUSED,
+                                   virNetDevCoalescePtr coalesce ATTRIBUTE_UNUSED,
                                    unsigned int mtu ATTRIBUTE_UNUSED,
                                    unsigned int *actualMTU ATTRIBUTE_UNUSED,
                                    unsigned int fakeflags ATTRIBUTE_UNUSED)
-- 
2.12.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux