From nobody Mon May 20 00:56:22 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; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600939826; cv=none; d=zohomail.com; s=zohoarc; b=DgK47plAkRM/jZu/YKYU5CNZkyF3xP0pgNcl077+tpCAsXCNI4FmWrTlg0RdO+9sFXyB260asYII51783LXX76bpUj5sylya0LmcIBZeK3pQZww2oDtznyAMCjOcwTX9cWYeYEdj+46KWiu6sbyaRpuMq0PQEU3pTHKy8rAgQ9Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600939826; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=TFz9fALb26orsD2D4MNroWsRm8mxpNb8K9jtjcTTiTU=; b=nHNQGhtEneki6mydjdwIGlVPJhodOPsOJjdFRIc+jLgOHtekOiipTKzYKv8LN1rJ5WptCUOvVQVoK9Zu30W9+eo9RPADyPBzyl+3ZRmHflCRog+kuCUxoUp9he6KY/rfhIF4tGrwWUFrPRzevEX3ebB0r4EmbK2IjCt8P9jjfcw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass 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 1600939826420934.9614637960229; Thu, 24 Sep 2020 02:30:26 -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-265-yJOwh07rPJqsi5fdNUl3bA-1; Thu, 24 Sep 2020 05:30:22 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DE65F1084CA2; Thu, 24 Sep 2020 09:30:16 +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 5BF9419652; Thu, 24 Sep 2020 09:30:15 +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 98CAB181A86E; Thu, 24 Sep 2020 09:30:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08O9Tw4e023202 for ; Thu, 24 Sep 2020 05:29:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id C08B860C04; Thu, 24 Sep 2020 09:29:58 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-25.ams2.redhat.com [10.36.115.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id D44BE60E1C; Thu, 24 Sep 2020 09:29:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600939825; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=TFz9fALb26orsD2D4MNroWsRm8mxpNb8K9jtjcTTiTU=; b=e8h0t+wcN5H/hGkRvqXOQf6DCJMi8Q3GhFZ9ICcZbyLs6B0ZhIz3TIxbaCTTqMy1oGPL1x aJWohIAbtzOooAb7d983NCvTbfYBoTrxDJoG1jpbnX5y6jBivtJ6St5vSw9a6wlB5X3dVx 47+E+Zuzw7IkYdYN0l8COi+HvcB7Auw= X-MC-Unique: yJOwh07rPJqsi5fdNUl3bA-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [PATCH] util: stop probing for IFF_VNET_HDR Date: Thu, 24 Sep 2020 10:29:52 +0100 Message-Id: <20200924092952.2100454-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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.84 on 10.5.11.23 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) This flag was added by Linux with: commit f43798c27684ab925adde7d8acc34c78c6e50df8 Author: Rusty Russell Date: Thu Jul 3 03:48:02 2008 -0700 tun: Allow GSO using virtio_net_hdr so we can assume all Linux distros we support have this flag available and thus the compile time check is sufficient. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: J=C3=A1n Tomko --- src/util/virnetdevtap.c | 63 +---------------------------------------- 1 file changed, 1 insertion(+), 62 deletions(-) diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c index cbce5c71b7..77c4d1c52c 100644 --- a/src/util/virnetdevtap.c +++ b/src/util/virnetdevtap.c @@ -183,66 +183,6 @@ virNetDevTapGetRealDeviceName(char *ifname G_GNUC_UNUS= ED) } =20 =20 -/** - * virNetDevProbeVnetHdr: - * @tapfd: a tun/tap file descriptor - * - * Check whether it is safe to enable the IFF_VNET_HDR flag on the - * tap interface. - * - * Setting IFF_VNET_HDR enables QEMU's virtio_net driver to allow - * guests to pass larger (GSO) packets, with partial checksums, to - * the host. This greatly increases the achievable throughput. - * - * It is only useful to enable this when we're setting up a virtio - * interface. And it is only *safe* to enable it when we know for - * sure that a) qemu has support for IFF_VNET_HDR and b) the running - * kernel implements the TUNGETIFF ioctl(), which qemu needs to query - * the supplied tapfd. - * - * Returns 1 if VnetHdr is supported, 0 if not supported - */ -#ifdef IFF_VNET_HDR -static int -virNetDevProbeVnetHdr(int tapfd) -{ -# if defined(IFF_VNET_HDR) && defined(TUNGETFEATURES) && defined(TUNGETIFF) - unsigned int features; - struct ifreq dummy; - - if (ioctl(tapfd, TUNGETFEATURES, &features) !=3D 0) { - VIR_INFO("Not enabling IFF_VNET_HDR; " - "TUNGETFEATURES ioctl() not implemented"); - return 0; - } - - if (!(features & IFF_VNET_HDR)) { - VIR_INFO("Not enabling IFF_VNET_HDR; " - "TUNGETFEATURES ioctl() reports no IFF_VNET_HDR"); - return 0; - } - - /* The kernel will always return -1 at this point. - * If TUNGETIFF is not implemented then errno =3D=3D EBADFD. - */ - if (ioctl(tapfd, TUNGETIFF, &dummy) !=3D -1 || errno !=3D EBADFD) { - VIR_INFO("Not enabling IFF_VNET_HDR; " - "TUNGETIFF ioctl() not implemented"); - return 0; - } - - VIR_INFO("Enabling IFF_VNET_HDR"); - - return 1; -# else - (void) tapfd; - VIR_INFO("Not enabling IFF_VNET_HDR; disabled at build time"); - return 0; -# endif -} -#endif - - #ifdef TUNSETIFF /** * virNetDevTapGenerateName: @@ -363,8 +303,7 @@ int virNetDevTapCreate(char **ifname, } =20 # ifdef IFF_VNET_HDR - if ((flags & VIR_NETDEV_TAP_CREATE_VNET_HDR) && - virNetDevProbeVnetHdr(fd)) + if (flags & VIR_NETDEV_TAP_CREATE_VNET_HDR) ifr.ifr_flags |=3D IFF_VNET_HDR; # endif =20 --=20 2.26.2