[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 4/4] tools/hotplug: modify set_mtu() to inform the frontend via xenstore


  • To: Paul Durrant <paul@xxxxxxx>
  • From: Ian Jackson <ian.jackson@xxxxxxxxxx>
  • Date: Tue, 4 Aug 2020 12:13:48 +0100
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Paul Durrant <pdurrant@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Tue, 04 Aug 2020 11:13:58 +0000
  • Ironport-sdr: Mx05ncDJQ41Myh8L0mPSVtcZFHtur6JAz5rz5gOcM839mQEaGV9kzI/jqWkHVeBpcIxmb3nOIE PWzzACCoKIe73bkJUum2gpCZPstyGgX8o8/rQvfvB1nj6YRFEdqLgoP2TPYzXeSLztu3gzyIJx q7uAbySHiinEIpGdA9+xbXAGdPOozrlpUar5G3n77jx5QR3PsaJVAPW8AjEZ311FNaMeHYEXp0 O6731Il2MmXKIgoQuk8IMtnBWCSRTITlLlF+c6YDlQQalsNBqvu1g2AFIa+JwvLGWsqSZNc5tK ex0=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Paul Durrant writes ("[PATCH v2 4/4] tools/hotplug: modify set_mtu() to inform 
the frontend via xenstore"):
> From: Paul Durrant <pdurrant@xxxxxxxxxx>
> 
> 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 <pdurrant@xxxxxxxxxx>

Reviewed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>

> 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}

It's surprising to me that this code doesn't have the xenbus path
already in some variable.  But I guess from the fact that you've added
this code, that it doesn't.

Ian.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.