From nobody Sun May 5 23:04:01 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=1610644626; cv=none; d=zohomail.com; s=zohoarc; b=R9c26SSBkehUXPGrGYLaGu+YHBNasABFwrl+vyfScyO8dJxFItNFNftWwWJjoPFR5krBzT9fUPtJVdjWG+3e+WWGFU8jqkh7aeqDqcNpYpZWyWuox/HK43iH51qKgm5EV0AXE/20/WgsKXBzSk+HnEZQ1WGugqucuegWYnCOgoU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610644626; 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=aSoVYVua0RI29xpUzQN7flaXGh7oQuqqAYZVpKeIjdw=; b=G6D5E11DTPJFSk112A5/wX6/S//6h7JgAneR1bNuvctWLnFxSt1zKn+67So4hpTdy/wX6ZOF6ZCuUVYieQ6VDrrNhT9LIm2NwxzNG8fkYW8MVHmeW18DKjOjqodyc1GGpvaB9BrP8SZ0ZqH/OcuBD6OtX41DjM9DgMPowbEdHA8= 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 1610644626191885.5131456855897; Thu, 14 Jan 2021 09:17:06 -0800 (PST) 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-253-jnxT9ZsBMsmaWEE4GW1M_Q-1; Thu, 14 Jan 2021 12:17:02 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6DD6E802B40; Thu, 14 Jan 2021 17:16:56 +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 4267E10023B9; Thu, 14 Jan 2021 17:16:56 +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 C750A180954D; Thu, 14 Jan 2021 17:16:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 10EHGsLV012431 for ; Thu, 14 Jan 2021 12:16:54 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0E24F6F965; Thu, 14 Jan 2021 17:16:54 +0000 (UTC) Received: from vhost2.laine.org (ovpn-114-25.phx2.redhat.com [10.3.114.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id CBE866E407 for ; Thu, 14 Jan 2021 17:16:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610644625; 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=aSoVYVua0RI29xpUzQN7flaXGh7oQuqqAYZVpKeIjdw=; b=S8hJSvkwMrdlElR98VLmY7Bn1XpPzMPhDjwYLa0oGEeGTuTbR/0xlf43uywJL5zQBmxl+u 2rHPhGjINAdBjjjFAxCb3olQNM0hGoI6ekH6fW5R4N/M0pzLG3vDS0p/jKBg8GD5x/6j0V BpQBWkLMqVmPIGtUTdnhCHq/1eK7Syc= X-MC-Unique: jnxT9ZsBMsmaWEE4GW1M_Q-1 From: Laine Stump To: libvir-list@redhat.com Subject: [PATCH] network: explicitly set the MTU of the bridge device. Date: Thu, 14 Jan 2021 12:16:49 -0500 Message-Id: <20210114171649.118057-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.22 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 X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" In the past, the MTU of libvirt virtual network bridge devices was implicitly set by setting the MTU of the "dummy tap device" (which was being added in order to force a particular MAC address from the bridge). But the dummy tap device was removed in commit ee6c936fbb (libvirt-6.8.0), and so the mtu setting in the network is ignored. The solution is, of course, to explicitly set the bridge device MTU when it is created. Note that any guest interface with a larger MTU that is attached will cause the bridge to (temporarily) assume the larger MTU, but it will revert to the bridge's own MTU when that device is deleted (this is not due to anything libvirt does; it's just how Linux host bridges work). Resolves: https://bugzilla.redhat.com/1913561 Signed-off-by: Laine Stump ee6c936fbbo-set-mtu Signed-off-by: Laine Stump Reviewed-by: J=C3=A1n Tomko --- src/network/bridge_driver.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index b7c604eaea..519a473995 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -2336,6 +2336,9 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr d= river, =20 /* Set bridge options */ =20 + if (def->mtu && virNetDevSetMTU(def->bridge, def->mtu) < 0) + goto error; + /* delay is configured in seconds, but virNetDevBridgeSetSTPDelay * expects milliseconds */ --=20 2.29.2