From nobody Thu Apr 25 22:08:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1596138569; cv=none; d=zohomail.com; s=zohoarc; b=QFzMi37Rggrd95dPL+ZPUPRw2Q9uem+k/OTExBow56DM2fq2Kukqxn50DPW44xUSH65fJPHpsSD/V3CNj2t1EDn+C4Dv4xYHxW7bezhIey2ESfUd6uIbc+EC0wXO3t0CZ/eYbGB7mazufZkbhPB5WqKg7KO/9lymQsjnlAZ4yFg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596138569; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=fEecjANlWh3hBTz/ieGtixPqvrZoBJyua6jWfk3Vf10=; b=c2BslXOQmtY8Jz3ey8pl7JrE3qZmlcsSHg9Hh9KyegkSl+4SHf1r4BsEkojJ3ERY02AjwzDwWclh6LTOTU4N/zOxNEgCvaLMJIfpVnHm0hTDmwt8XBeMqUn7oPgvU/PXBhSuRp48s8wh99VBWG75kuC9XsppOQFc5xn3geWvbgg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 15961385690821018.8619703879942; Thu, 30 Jul 2020 12:49:29 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1EYB-0003rq-DB; Thu, 30 Jul 2020 19:49:11 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1EY9-0003pM-PR for xen-devel@lists.xenproject.org; Thu, 30 Jul 2020 19:49:09 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id b7d6e534-d29d-11ea-ab18-12813bfff9fa; Thu, 30 Jul 2020 19:49:02 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1EY1-0001Kr-Vg; Thu, 30 Jul 2020 19:49:01 +0000 Received: from host86-143-223-30.range86-143.btcentralplus.com ([86.143.223.30] helo=u2f063a87eabd5f.home) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k1EY1-0004CS-Mi; Thu, 30 Jul 2020 19:49:01 +0000 X-Inumbo-ID: b7d6e534-d29d-11ea-ab18-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=fEecjANlWh3hBTz/ieGtixPqvrZoBJyua6jWfk3Vf10=; b=G5Qsw7KVQaPGTbUXp7+U+YIsx1 icyS+WhS4A2kpWgA4LgOE29z4wLfrYOYNjehteBqZridgptx9qrXC5I2caHh7i88uZRfiAUdH7iJm bwY7HtldogY8HtDfNy8jLXwkVOcwvSwxR0ee6PiLh4UBr8RdPRNcR9Wtii8NPZMgZ/co=; From: Paul Durrant To: xen-devel@lists.xenproject.org Subject: [PATCH 1/4] tools/hotplug: add remove_from_bridge() and improve debug output Date: Thu, 30 Jul 2020 20:48:55 +0100 Message-Id: <20200730194858.28523-2-paul@xen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200730194858.28523-1-paul@xen.org> References: <20200730194858.28523-1-paul@xen.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Paul Durrant , Ian Jackson , Wei Liu Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Paul Durrant This patch adds a remove_from_bridge() function into xen-network-common.sh to partner with the existing add_to_bridge() function. The code in add_to_bridge() is also slightly re-arranged to avoid duplication calls of 'ip link'. Both add_to_bridge() and remove_from_bridge() will check if their bridge manipulation operations are necessary and emit a log message if they are no= t. NOTE: A call to remove_from_bridge() will be added by a subsequent patch. Signed-off-by: Paul Durrant --- Cc: Ian Jackson Cc: Wei Liu --- tools/hotplug/Linux/xen-network-common.sh | 37 ++++++++++++++++++----- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/tools/hotplug/Linux/xen-network-common.sh b/tools/hotplug/Linu= x/xen-network-common.sh index 8dd3a62068..37e71cfa9c 100644 --- a/tools/hotplug/Linux/xen-network-common.sh +++ b/tools/hotplug/Linux/xen-network-common.sh @@ -126,19 +126,40 @@ add_to_bridge () { local bridge=3D$1 local dev=3D$2 =20 - # Don't add $dev to $bridge if it's already on a bridge. - if [ -e "/sys/class/net/${bridge}/brif/${dev}" ]; then - ip link set dev ${dev} up || true - return - fi - if which brctl >&/dev/null; then - brctl addif ${bridge} ${dev} + # Don't add $dev to $bridge if it's already on the bridge. + if [ ! -e "/sys/class/net/${bridge}/brif/${dev}" ]; then + log debug "adding $dev to bridge $bridge" + if which brctl >&/dev/null; then + brctl addif ${bridge} ${dev} + else + ip link set ${dev} master ${bridge} + fi else - ip link set ${dev} master ${bridge} + log debug "$dev already on bridge $bridge" fi + ip link set dev ${dev} up } =20 +remove_from_bridge () { + local bridge=3D$1 + local dev=3D$2 + + ip link set dev ${dev} down || : + + # Don't remove $dev from $bridge if it's not on the bridge. + if [ -e "/sys/class/net/${bridge}/brif/${dev}" ]; then + log debug "removing $dev from bridge $bridge" + if which brctl >&/dev/null; then + brctl delif ${bridge} ${dev} + else + ip link set ${dev} nomaster + fi + else + log debug "$dev not on bridge $bridge" + fi +} + # Usage: set_mtu bridge dev set_mtu () { local bridge=3D$1 --=20 2.20.1 From nobody Thu Apr 25 22:08:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1596138564; cv=none; d=zohomail.com; s=zohoarc; b=isJKHJ6jvGGvc4q1PtXrJF5ePe9ItIrQS7dJyIAiYnWyBevJqBF54M4lvmDmpofgzsY267eEEcKjsl8hlaLhke/5sxSbe71CO0RNExjDYIi9OGvuwwY/IAFzOH69q/spgqTuUSEHJC6VOhiqKHeEDLAWcfv5VBInOzIWPZjywjo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596138564; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kR8KOrJwsxDE/ONPFOt3nY9mFnEziImu/LnFUCfqeYk=; b=SRfmRDU7fQb0PSjAZ82yrsS29kAVLQJx9qRVhtxwAO9ClqHJcBH4cpYq8f0CxAzoszxXLr0P+aSNZ/YYQvioAt6gL60fYlHZnnjYg93EfF+dXvsuKpeWqxMe+YAw0Hp/VFUe3LyfDqVpXn/MiKDQLDynYlVMPI0L5q4miDkcJYM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1596138564807916.2931459438954; Thu, 30 Jul 2020 12:49:24 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1EY8-0003qJ-0Q; Thu, 30 Jul 2020 19:49:08 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1EY7-0003p9-2y for xen-devel@lists.xenproject.org; Thu, 30 Jul 2020 19:49:07 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id b84e38be-d29d-11ea-8dc5-bc764e2007e4; Thu, 30 Jul 2020 19:49:03 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1EY2-0001Kv-LW; Thu, 30 Jul 2020 19:49:02 +0000 Received: from host86-143-223-30.range86-143.btcentralplus.com ([86.143.223.30] helo=u2f063a87eabd5f.home) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k1EY2-0004CS-EG; Thu, 30 Jul 2020 19:49:02 +0000 X-Inumbo-ID: b84e38be-d29d-11ea-8dc5-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=kR8KOrJwsxDE/ONPFOt3nY9mFnEziImu/LnFUCfqeYk=; b=jNw6wNDiG67DDYLFxqmgL6wTMu uk20JibukfLKx343xnmcK4QeGDATQ3ngudLzGnF5ViL43KWpTfALxK/MlWmsnWZSR7CYFli64kgAW MY+qrPNP1eEbIvYlT2svb1yASIIsi+q9Xo0Rt+iIK1/NIe1K2tzAlbTr4dlM/94sP7cU=; From: Paul Durrant To: xen-devel@lists.xenproject.org Subject: [PATCH 2/4] tools/hotplug: combine add/online and remove/offline in vif-bridge... Date: Thu, 30 Jul 2020 20:48:56 +0100 Message-Id: <20200730194858.28523-3-paul@xen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200730194858.28523-1-paul@xen.org> References: <20200730194858.28523-1-paul@xen.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Paul Durrant , Ian Jackson , Wei Liu Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Paul Durrant ... as they are in vif-route. The script is invoked with online/offline for vifs and add/remove for taps. The operations that are necessary, however, are the same in both cases. This patch therefore combines the cases. The open-coded bridge removal code is also replaced with call to remove_from_bridge(). Signed-off-by: Paul Durrant --- Cc: Ian Jackson Cc: Wei Liu --- tools/hotplug/Linux/vif-bridge | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/tools/hotplug/Linux/vif-bridge b/tools/hotplug/Linux/vif-bridge index e722090ca8..e1d7c49788 100644 --- a/tools/hotplug/Linux/vif-bridge +++ b/tools/hotplug/Linux/vif-bridge @@ -77,25 +77,17 @@ then fi =20 case "$command" in + add) + ;& online) setup_virtual_bridge_port "$dev" set_mtu "$bridge" "$dev" add_to_bridge "$bridge" "$dev" ;; - + remove) + ;& offline) - if which brctl >&/dev/null; then - do_without_error brctl delif "$bridge" "$dev" - else - do_without_error ip link set "$dev" nomaster - fi - do_without_error ifconfig "$dev" down - ;; - - add) - setup_virtual_bridge_port "$dev" - set_mtu "$bridge" "$dev" - add_to_bridge "$bridge" "$dev" + remove_from_bridge "$bridge" "$dev" ;; esac =20 --=20 2.20.1 From nobody Thu Apr 25 22:08:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1596138563; cv=none; d=zohomail.com; s=zohoarc; b=OWG1+FnIrrjp7K1f32QolL8jFa3V8KJQQUOehD9+zF1W5Alx4CvMG29iiMnXHEGDDOclHbwnMLJPmpyqPAr9lromzQCGTgB2umaHYWk7ipA2NLwY6Urbs4H7R+TvIpNhhWOTWiH0HQdXZITjq/GXfuDYyajlGKKgywSYgSqgqvI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596138563; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=8UnD14dYKCdyYi6YratGsYxZMEOmXUkZTQOXSnNy2ec=; b=VPWQ53Mw69Op7h/xsGGTsmA8g8GllFdo37KzGa8K/gZF/U353V8nk/zmBU5y/2KysOT5hanzv9sj5HxZGEYrZca2qlJtXEG00UMhENBRgrbP/r/2k+tTCi8kYnjs9a9gefImCHfdBQ9iYpuHLtorHzGu2XNFADKcf+vsZuwqOEo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1596138563826502.19021643301176; Thu, 30 Jul 2020 12:49:23 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1EY5-0003pV-Ok; Thu, 30 Jul 2020 19:49:05 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1EY4-0003pM-Qz for xen-devel@lists.xenproject.org; Thu, 30 Jul 2020 19:49:04 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id b8789c8a-d29d-11ea-ab18-12813bfff9fa; Thu, 30 Jul 2020 19:49:03 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1EY3-0001L1-9z; Thu, 30 Jul 2020 19:49:03 +0000 Received: from host86-143-223-30.range86-143.btcentralplus.com ([86.143.223.30] helo=u2f063a87eabd5f.home) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k1EY3-0004CS-2s; Thu, 30 Jul 2020 19:49:03 +0000 X-Inumbo-ID: b8789c8a-d29d-11ea-ab18-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=8UnD14dYKCdyYi6YratGsYxZMEOmXUkZTQOXSnNy2ec=; b=qM1rwFgsvkvmFrUxckN5wRBlEU QVo9/7xQDlBETj2ZmEZsV/Ic5WufQEBs9w+8R4Bbt9P7YB1vwzGubUznHt6Od+KtzNnj5PnaeTOrj m/tNYypKBGzS8akFZFj43vmBx7YehsJ0s1+PygG/KASXi980e4mTT4iEwORXYL4m+KqQ=; From: Paul Durrant To: xen-devel@lists.xenproject.org Subject: [PATCH 3/4] public/io/netif: specify MTU override node Date: Thu, 30 Jul 2020 20:48:57 +0100 Message-Id: <20200730194858.28523-4-paul@xen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200730194858.28523-1-paul@xen.org> References: <20200730194858.28523-1-paul@xen.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Paul Durrant Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Paul Durrant There is currently no documentation to state what MTU a frontend should adertise to its network stack. It has however long been assumed that the default value of 1500 is correct. This patch specifies a mechanism to allow the tools to set the MTU via a xenstore node in the frontend area and states that the absence of that node means the frontend should assume an MTU of 1500 octets. NOTE: The Windows PV frontend has used an MTU sampled from the xenstore node specified in this patch. Signed-off-by: Paul Durrant Reviewed-by: Juergen Gross --- Cc: Juergen Gross --- xen/include/public/io/netif.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h index 9fcf91a2fe..00dd258712 100644 --- a/xen/include/public/io/netif.h +++ b/xen/include/public/io/netif.h @@ -204,6 +204,18 @@ * present). */ =20 +/* + * MTU + * =3D=3D=3D + * + * The toolstack may set a value of MTU for the frontend by setting the + * /local/domain//device/vif//mtu node with the MTU value in + * octets. If this node is absent the frontend should assume an MTU value + * of 1500 octets. A frontend is also at liberty to ignore this value so + * it is only suitable for informing the frontend that a packet payload + * >1500 octets is permitted. + */ + /* * Hash types * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --=20 2.20.1 From nobody Thu Apr 25 22:08:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1596138567; cv=none; d=zohomail.com; s=zohoarc; b=cEmXzQ7o4XvW6SRkhmh4tHXgkvBnhrnzs6BWEDE3VCdu9btTZ041hpAbO7RKxtbH9h6BpAe/2bTwQNRjqGV3Wd0/SIQCJEFPVu1V7d5h43/s8i76jhAMUt/xtiOfIThNs0eSa+QhlGZ6iCeS6yRgJPxahlkVHcO24115vqOqyO8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596138567; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=TpRalkvkG38JtEdNhqPS3RNesiK5+8RoUBFVAeIBPhI=; b=GGzqUH7iGxtAVZ25U4uj+CtNjDAivP6HdeE6jfeK0GmJrISKiKpoS2+FQIqE8jR3hyi8PVGId0E6VER3jR73lOqSPS2exb4HD0Wgu3/cJW6NGVPCBjWcxKu3wlohY/Oa56ewONXddw2U43lCdtUlmA4DIomb9fbMNq3pCNfEifM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1596138567890807.1336503381673; Thu, 30 Jul 2020 12:49:27 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1EYD-0003t9-Lc; Thu, 30 Jul 2020 19:49:13 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1EYC-0003p9-39 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2020 19:49:12 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id b84e38bf-d29d-11ea-8dc5-bc764e2007e4; Thu, 30 Jul 2020 19:49:04 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1EY4-0001L6-2O; Thu, 30 Jul 2020 19:49:04 +0000 Received: from host86-143-223-30.range86-143.btcentralplus.com ([86.143.223.30] helo=u2f063a87eabd5f.home) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k1EY3-0004CS-Qi; Thu, 30 Jul 2020 19:49:04 +0000 X-Inumbo-ID: b84e38bf-d29d-11ea-8dc5-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=TpRalkvkG38JtEdNhqPS3RNesiK5+8RoUBFVAeIBPhI=; b=WxT0hE7RoSokynNV8k06V/6cIF S9AOZWhblGoHd0merPmft9QPFy+61K5AEobk0g62atYnIFOBmhuWDaKghbpAWAsDxsmfUkCvLBhVw yI/yopP+8i7mzveNfASh1hdVRPFI9Wk76GZspJrgeCe74/W/u9Z07YMDel06MBn3onCA=; From: Paul Durrant To: xen-devel@lists.xenproject.org Subject: [PATCH 4/4] tools/hotplug: modify set_mtu() to inform the frontend via xenstore Date: Thu, 30 Jul 2020 20:48:58 +0100 Message-Id: <20200730194858.28523-5-paul@xen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200730194858.28523-1-paul@xen.org> References: <20200730194858.28523-1-paul@xen.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Paul Durrant , Ian Jackson , Wei Liu Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Paul Durrant set_mtu() currently sets the backend vif MTU but does not inform the fronte= nd what it is. This patch adds code to write the MTU into a xenstore node. See netif.h for a specification of the node. NOTE: There is also a small modification replacing '$mtu' with '${mtu}' for style consistency. Signed-off-by: Paul Durrant --- Cc: Ian Jackson Cc: Wei Liu --- tools/hotplug/Linux/vif-bridge | 2 +- tools/hotplug/Linux/xen-network-common.sh | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/tools/hotplug/Linux/vif-bridge b/tools/hotplug/Linux/vif-bridge index e1d7c49788..b99cc82a21 100644 --- a/tools/hotplug/Linux/vif-bridge +++ b/tools/hotplug/Linux/vif-bridge @@ -81,7 +81,7 @@ case "$command" in ;& online) setup_virtual_bridge_port "$dev" - set_mtu "$bridge" "$dev" + set_mtu "$bridge" "$dev" "$type_if" add_to_bridge "$bridge" "$dev" ;; remove) diff --git a/tools/hotplug/Linux/xen-network-common.sh b/tools/hotplug/Linu= x/xen-network-common.sh index 37e71cfa9c..24fc42d9cf 100644 --- a/tools/hotplug/Linux/xen-network-common.sh +++ b/tools/hotplug/Linux/xen-network-common.sh @@ -164,9 +164,21 @@ remove_from_bridge () { set_mtu () { local bridge=3D$1 local dev=3D$2 + local type_if=3D$3 + mtu=3D"`ip link show dev ${bridge}| awk '/mtu/ { print $5 }'`" if [ -n "$mtu" ] && [ "$mtu" -gt 0 ] then - ip link set dev ${dev} mtu $mtu || : + ip link set dev ${dev} mtu ${mtu} || : + fi + + if [ ${type_if} =3D vif ] + then + dev_=3D${dev#vif} + domid=3D${dev_%.*} + devid=3D${dev_#*.} + + XENBUS_PATH=3D"/local/domain/$domid/device/vif/$devid" + xenstore_write "$XENBUS_PATH/mtu" ${mtu} fi } --=20 2.20.1