]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkd: tap add support for vnet_hdr
authorSusant Sahani <ssahani@gmail.com>
Tue, 14 Jul 2015 08:25:52 +0000 (13:55 +0530)
committerSusant Sahani <susant@redhat.com>
Tue, 14 Jul 2015 08:40:56 +0000 (14:10 +0530)
 This patch adds support to configure IFF_VNET_HDR flag
for a tap device. It allows whether sending and receiving
large pass larger (GSO) packets. This greatly increases the
achievable throughput.

src/network/networkd-netdev-gperf.gperf
src/network/networkd-netdev-tuntap.c
src/network/networkd-netdev-tuntap.h

index 66ed2e013cde1f0c4c1243bf19ccbdc5c6ea613b..010c106610f4ea581478f524b3771bca848dfb66 100644 (file)
@@ -59,6 +59,7 @@ Tun.Group,                   config_parse_string,                0,
 Tap.OneQueue,                config_parse_bool,                  0,                             offsetof(TunTap, one_queue)
 Tap.MultiQueue,              config_parse_bool,                  0,                             offsetof(TunTap, multi_queue)
 Tap.PacketInfo,              config_parse_bool,                  0,                             offsetof(TunTap, packet_info)
+Tap.VnetHeader,              config_parse_bool,                  0,                             offsetof(TunTap, vnet_hdr)
 Tap.User,                    config_parse_string,                0,                             offsetof(TunTap, user_name)
 Tap.Group,                   config_parse_string,                0,                             offsetof(TunTap, group_name)
 Bond.Mode,                   config_parse_bond_mode,             0,                             offsetof(Bond, mode)
index 378312f09181328170c75c867908dbf78ac85f3c..ba84e802fc015e4304eb35f4f925097b7dacf57e 100644 (file)
@@ -51,6 +51,9 @@ static int netdev_fill_tuntap_message(NetDev *netdev, struct ifreq *ifr) {
         if (t->multi_queue)
                 ifr->ifr_flags |= IFF_MULTI_QUEUE;
 
+        if (t->vnet_hdr)
+                ifr->ifr_flags |= IFF_VNET_HDR;
+
         strncpy(ifr->ifr_name, netdev->ifname, IFNAMSIZ-1);
 
         return 0;
index b804875bbb9b39ea6b8932f6a6801683b8d080a0..29f8bb0ea5013a4de549c3861ae6ac9c43c033dc 100644 (file)
@@ -33,6 +33,7 @@ struct TunTap {
         bool one_queue;
         bool multi_queue;
         bool packet_info;
+        bool vnet_hdr;
 };
 
 extern const NetDevVTable tun_vtable;