From nobody Mon Apr 29 10:24:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1596768832; cv=none; d=zohomail.com; s=zohoarc; b=Rvgj9k4AtsRRwjwLr+Cs5qq3V8q3TMsh8pLDZZZM9bXApKjT7spvXUVeLohAUl8GDa8HCAkJyYIr258FTUoN9TY/DKhWQhzIiN7i58l+JoYwNtSgLjtF+cNdmdLdPbsCVYvjna2W6ckNugk05gWNWLXfyp0JyQ4B1Mh88A0wcnE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596768832; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=oRyOxziEV6duFtgkGvyTdLwn8n6odoMVHTcQOM7LU40=; b=ilj75XYL2JCAvsKluVAFuqrxjjfj1rmTIQo7yNXc+hgZQgXIvrANHg+tM5+kBPulAtUyWKR/23PIc+b3404QJO7mKHIA5vytOWDtWSpPFLwb1lZf3Rgbdk+ja/3EbwiJuhpbmNygLnUAogIuuc00dwvYz3jabp2GypEJmJXQrVw= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1596768832088138.90823479391713; Thu, 6 Aug 2020 19:53:52 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-459-w71VlQCoMEGZ9iLXWUVR3g-1; Thu, 06 Aug 2020 22:53:49 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8FF53106B243; Fri, 7 Aug 2020 02:53:42 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E16DC5D9E7; Fri, 7 Aug 2020 02:53:41 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 445311809554; Fri, 7 Aug 2020 02:53:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0772rcu8013037 for ; Thu, 6 Aug 2020 22:53:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 17361F6CAF; Fri, 7 Aug 2020 02:53:38 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0FC9EF6CA2 for ; Fri, 7 Aug 2020 02:53:36 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EAA7E805C21 for ; Fri, 7 Aug 2020 02:53:35 +0000 (UTC) Received: from mail-qt1-f193.google.com (mail-qt1-f193.google.com [209.85.160.193]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-233-p6D2fUZjOw6KSib2mPIbEA-1; Thu, 06 Aug 2020 22:53:33 -0400 Received: by mail-qt1-f193.google.com with SMTP id c12so317359qtn.9 for ; Thu, 06 Aug 2020 19:53:33 -0700 (PDT) Received: from localhost (pool-72-92-80-32.phlapa.fios.verizon.net. [72.92.80.32]) by smtp.gmail.com with ESMTPSA id z67sm5694989qkb.27.2020.08.06.19.53.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Aug 2020 19:53:32 -0700 (PDT) X-MC-Unique: w71VlQCoMEGZ9iLXWUVR3g-1 X-MC-Unique: p6D2fUZjOw6KSib2mPIbEA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=oRyOxziEV6duFtgkGvyTdLwn8n6odoMVHTcQOM7LU40=; b=UhzmkbN72qSRHzzcvhJ5Abbv4jC0n09ftorpYiJIO0uarq0ST5Z7XMULgVepbyiuMB jJRkQJdt2x0kr8TMedvJ+GP8EjDvalvdICuQm6qv03GqTpIfVQUfBDzp38dkpxe1kqXP 334nqcJnh36528ryAWULL1LSKaxV+yRdIDQ4DdF82vl8+skwKU4Yb6Vt11AG+zCPueOy hJEe9dM5E6CfBKRfFn2r2S4MWtCWaNheJLb7Wng6vj0NjqIdZwMDvUql5rqD+PtmNvnR samNFwsmpHDAPQedcwCwSDDH7Wa+VqaOhLep5fTTgLs4BG4rSaN+qIzJT9fHZ1chd5dw Ct9A== X-Gm-Message-State: AOAM530i1w7BtaIUCpPk25ljb6f3UmbEfgYdJoL9rFZwxUIdu7u2aqQ5 K4ycoh103ANWEjdpqp8x4Og= X-Google-Smtp-Source: ABdhPJz0ExmmCbZIuoUL4q/AUybxBIVhoSe52HClfl47ux/npG61+XseMVewMs46l2WYnEv6FblCmg== X-Received: by 2002:aed:24f2:: with SMTP id u47mr12214262qtc.137.1596768813226; Thu, 06 Aug 2020 19:53:33 -0700 (PDT) From: Patrick Magauran To: patmagauran.i@gmail.com, libvir-list@redhat.com Subject: [libvirt PATCH] Adds e1000e/vmxnet3 Vnet_hdr suuport Date: Thu, 6 Aug 2020 22:53:32 -0400 Message-Id: <20200807025332.31851-1-patmagauran.j@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false; X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Patrick Magauran X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Libvirt bases its decision about whether to apply the vnet_hdr flag to the = tap interface on whether or not the selected model is VirtIO. Originally, V= irtIO was the only model to support the vnet_hdr in QEMU; however, the e100= 0e & vmxnet3 adapters also support it(seemingly from introduction based on = commits). This passes the whole packet to the host, reducing emulation over= head and improving performance. Signed-off-by: Patrick Magauran --- src/conf/domain_conf.c | 8 +++++++- src/conf/domain_conf.h | 1 + src/libvirt_private.syms | 1 + src/qemu/qemu_interface.c | 8 ++++---- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 69e0439e7e..cb184110f7 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -30981,7 +30981,13 @@ virDomainNetIsVirtioModel(const virDomainNetDef *n= et) net->model =3D=3D VIR_DOMAIN_NET_MODEL_VIRTIO_TRANSITIONAL || net->model =3D=3D VIR_DOMAIN_NET_MODEL_VIRTIO_NON_TRANSITIONAL= ); } - +bool +virDomainNetIsVnetCompatModel(const virDomainNetDef *net) +{ + return (virDomainNetIsVirtioModel(net) || + net->model =3D=3D VIR_DOMAIN_NET_MODEL_E1000E || + net->model =3D=3D VIR_DOMAIN_NET_MODEL_VMXNET3); +} =20 /* Return listens[i] from the appropriate union for the graphics * type, or NULL if this is an unsuitable type, or the index is out of diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 011bf66cb4..cbc46fdf78 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3371,6 +3371,7 @@ const char *virDomainNetGetModelString(const virDomai= nNetDef *net); int virDomainNetSetModelString(virDomainNetDefPtr et, const char *model); bool virDomainNetIsVirtioModel(const virDomainNetDef *net); +bool virDomainNetIsVnetCompatModel(const virDomainNetDef *net); int virDomainNetAppendIPAddress(virDomainNetDefPtr def, const char *address, int family, diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 01c2e710cd..2b64042dd2 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -525,6 +525,7 @@ virDomainNetGetActualVlan; virDomainNetGetModelString; virDomainNetInsert; virDomainNetIsVirtioModel; +virDomainNetIsVnetCompatModel; virDomainNetModelTypeFromString; virDomainNetModelTypeToString; virDomainNetNotifyActualDevice; diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c index ffec992596..8397ed8645 100644 --- a/src/qemu/qemu_interface.c +++ b/src/qemu/qemu_interface.c @@ -255,7 +255,7 @@ qemuInterfaceDirectConnect(virDomainDefPtr def, virQEMUDriverConfigPtr cfg =3D virQEMUDriverGetConfig(driver); unsigned int macvlan_create_flags =3D VIR_NETDEV_MACVLAN_CREATE_WITH_T= AP; =20 - if (virDomainNetIsVirtioModel(net)) + if (virDomainNetIsVnetCompatModel(net)) macvlan_create_flags |=3D VIR_NETDEV_MACVLAN_VNET_HDR; =20 if (virNetDevMacVLanCreateWithVPortProfile(net->ifname, @@ -417,7 +417,7 @@ qemuInterfaceEthernetConnect(virDomainDefPtr def, } } =20 - if (virDomainNetIsVirtioModel(net)) + if (virDomainNetIsVnetCompatModel(net)) tap_create_flags |=3D VIR_NETDEV_TAP_CREATE_VNET_HDR; =20 if (net->managed_tap =3D=3D VIR_TRISTATE_BOOL_NO) { @@ -436,7 +436,7 @@ qemuInterfaceEthernetConnect(virDomainDefPtr def, if (virNetDevMacVLanTapOpen(net->ifname, tapfd, tapfdSize) < 0) goto cleanup; if (virNetDevMacVLanTapSetup(tapfd, tapfdSize, - virDomainNetIsVirtioModel(net)) <= 0) { + virDomainNetIsVnetCompatModel(net= )) < 0) { goto cleanup; } } else { @@ -559,7 +559,7 @@ qemuInterfaceBridgeConnect(virDomainDefPtr def, template_ifname =3D true; } =20 - if (virDomainNetIsVirtioModel(net)) + if (virDomainNetIsVnetCompatModel(net)) tap_create_flags |=3D VIR_NETDEV_TAP_CREATE_VNET_HDR; =20 if (driver->privileged) { --=20 2.26.2