From: Ian Campbell Subject: Re: [PATCH 2/5] hotplug/linux: Add an option to disable acceleration on VIF Date: Thu, 15 May 2014 16:57:26 +0100 Message-ID: <1400169446.19926.45.camel@kazak.uk.xensource.com> References: <1400081005-23895-1-git-send-email-s.munaut@whatever-company.com> <1400081005-23895-3-git-send-email-s.munaut@whatever-company.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wky2E-00059R-8H for xen-devel@lists.xenproject.org; Thu, 15 May 2014 15:57:30 +0000 In-Reply-To: <1400081005-23895-3-git-send-email-s.munaut@whatever-company.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Sylvain Munaut Cc: xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On Wed, 2014-05-14 at 17:23 +0200, Sylvain Munaut wrote: > If a kernel driver in dom0 tries to access a network service > running in a domU, strange things happen if the acceleration > is not disabled. This offers an easy option to do it. By acceleration here you mean tx checksum offload I think? How does one go about arranging for this xenstore key to be set? The XCP vif script[0] handles a wide variety of keys via keys like ethtool-tx ethtool-rx etc. FWIW I think this could also be achieved locally with a script in /etc/xen/scripts/vif-post.d. [0] https://github.com/xapi-project/xen-api/blob/master/scripts/vif > This has been observed with a CEPH RBD kernel driver trying > to access cluster with some OSDs running as domUs. > > Signed-off-by: Sylvain Munaut > --- > tools/hotplug/Linux/vif-bridge | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/tools/hotplug/Linux/vif-bridge b/tools/hotplug/Linux/vif-bridge > index 87279df..e0aa55d 100644 > --- a/tools/hotplug/Linux/vif-bridge > +++ b/tools/hotplug/Linux/vif-bridge > @@ -35,6 +35,8 @@ dir=$(dirname "$0") > bridge=${bridge:-} > bridge=$(xenstore_read_default "$XENBUS_PATH/bridge" "$bridge") > > +accel=$(xenstore_read_default "$XENBUS_PATH/accel" "on") > + > if [ -z "$bridge" ] > then > bridge=$(brctl show | awk 'NR==2{print$1}') > @@ -82,6 +84,10 @@ case "$command" in > online) > setup_virtual_bridge_port "$dev" > set_mtu $bridge $dev > + if [ "${accel}" = "off" ] > + then > + ethtool -K "$dev" tx off 1>/dev/null 2>&1 > + fi > add_to_bridge "$bridge" "$dev" > ;; >