From patchwork Mon Aug 3 12:49:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Durrant X-Patchwork-Id: 11697997 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C53BB912 for ; Mon, 3 Aug 2020 12:50:36 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A0BE620678 for ; Mon, 3 Aug 2020 12:50:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xen.org header.i=@xen.org header.b="HcGqnvkm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A0BE620678 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k2ZuQ-0001oi-2T; Mon, 03 Aug 2020 12:49:42 +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 1k2ZuO-0001oY-Mk for xen-devel@lists.xenproject.org; Mon, 03 Aug 2020 12:49:40 +0000 X-Inumbo-ID: cb1d6432-d587-11ea-af2b-12813bfff9fa Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id cb1d6432-d587-11ea-af2b-12813bfff9fa; Mon, 03 Aug 2020 12:49:39 +0000 (UTC) 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=HcGqnvkm6tlHw+zgLd1/kNuEYB SI5YhlrENiOZLAl0wm0EdzhX20S1VZ6gneUaKlARLRWqKGPwR+O1EyytYJsk7B4B/k72q6HWW4Kwl p4ziJymIfIxP8eBjRnxqLZgmRsjlPmUeAIgof9xUH1woX0+s4wTwoGCsa+8ouZR9STsQ=; Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k2ZuN-0000xA-0f; Mon, 03 Aug 2020 12:49:39 +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 1k2ZuM-0002Mv-PT; Mon, 03 Aug 2020 12:49:38 +0000 From: Paul Durrant To: xen-devel@lists.xenproject.org Subject: [PATCH v2 4/4] tools/hotplug: modify set_mtu() to inform the frontend via xenstore Date: Mon, 3 Aug 2020 13:49:31 +0100 Message-Id: <20200803124931.2678-5-paul@xen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200803124931.2678-1-paul@xen.org> References: <20200803124931.2678-1-paul@xen.org> MIME-Version: 1.0 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" From: Paul Durrant set_mtu() currently sets the backend vif MTU but does not inform the frontend 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 Reviewed-by: Ian Jackson --- 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/Linux/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=$1 local dev=$2 + local type_if=$3 + mtu="`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} = vif ] + then + dev_=${dev#vif} + domid=${dev_%.*} + devid=${dev_#*.} + + XENBUS_PATH="/local/domain/$domid/device/vif/$devid" + xenstore_write "$XENBUS_PATH/mtu" ${mtu} fi }