All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 0/3 staging: hv: fix oops in vmbus
@ 2009-10-28 22:23 Milan Dadok
  0 siblings, 0 replies; only message in thread
From: Milan Dadok @ 2009-10-28 22:23 UTC (permalink / raw)
  To: 'Greg Kroah-Hartman'
  Cc: linux-kernel, 'Hank Janssen', 'Haiyang Zhang'

Hello all,

I'm sending patches to make hv_netvsc working correclly.
After these code corrections I can confirm, that hv drivers are loading
without error and 
network interface seth0 is working (Gentoo Guest)

Tested
ping, ssh, wget  Ok
iperf -c  don't work - network is lock somehow, console is still working

These two patches are needed too.
Haiyang Zhang's patch from 2009-10-23 18:14:24 [PATCH] Staging: hv: Fix null
pointer error after vmbus loading
Hank Janssen's patch from  2009-10-16 20:11:36 [PATCH 1/1] Staging: hv: Fix
vmbus load hang caused by faulty data

For udev events I used next udev config files (published in Microsoft
Hyper-V Linux IC)

Milan

---
diff -uprN /etc.old/udev/rules.d/20_netvs.rules
/etc/udev/rules.d/20_netvs.rules
--- /etc.old/udev/rules.d/20_netvs.rules        1970-01-01
01:00:00.000000000 +0100
+++ /etc/udev/rules.d/20_netvs.rules    2009-10-20 08:58:54.000000000 +0200
@@ -0,0 +1,2 @@
+SUBSYSTEM=="net", ENV{INTERFACE}=="seth[0-9]*",
RUN+="/etc/vmbus/netvsc.uevent $env{ACTION} $env{INTERFACE}"
+
diff -uprN /etc.old/udev/rules.d/20_vmbus.rules
/etc/udev/rules.d/20_vmbus.rules
--- /etc.old/udev/rules.d/20_vmbus.rules        1970-01-01
01:00:00.000000000 +0100
+++ /etc/udev/rules.d/20_vmbus.rules    2009-10-20 08:59:14.000000000 +0200
@@ -0,0 +1 @@
+SUBSYSTEM=="vmbus", RUN+="/etc/vmbus/vmbus.uevent $env{ACTION}
$env{VMBUS_DEVICE_CLASS_GUID}"
diff -uprN /etc.old/vmbus/vmbus.uevent /etc/vmbus/vmbus.uevent
--- /etc.old/vmbus/vmbus.uevent 1970-01-01 01:00:00.000000000 +0100
+++ /etc/vmbus/vmbus.uevent     2009-10-28 00:08:24.000000000 +0100
@@ -0,0 +1,56 @@
+#!/bin/bash
+#
+# Copyright (c) 2009, Microsoft Corporation.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
with
+# this program; if not, write to the Free Software Foundation, Inc., 59
Temple
+# Place - Suite 330, Boston, MA 02111-1307 USA.
+#
+# Authors:
+#   Haiyang Zhang <haiyangz@microsoft.com>
+#   Hank Janssen  <hjanssen@microsoft.com>
+#
+
+NETWORK_CLASS_GUID="{f8615163-df3e-46c5-913ff2d2f965ed0e}"
+STORAGE_CLASS_GUID="{ba6163d9-04a1-4d29-b60572e2ffb1dc7f}"
+
+usage() {
+ echo "Usage:"
+ echo -e "\t<add|remove> <vmbus device class guid>"
+ exit
+}
+
+# make sure we have 2 args
+[ -n "$1" ] || usage
+[ -n "$2" ] || usage
+
+ACTION=$1
+VMBUS_DEVICE_CLASS_GUID=$2
+
+if [ $ACTION = "add" ]; then
+       echo -n "adding device $VMBUS_DEVICE_CLASS_GUID..."
+       if [ $VMBUS_DEVICE_CLASS_GUID = $NETWORK_CLASS_GUID ]; then
+               /sbin/modprobe hv_netvsc
+       elif [ $VMBUS_DEVICE_CLASS_GUID = $STORAGE_CLASS_GUID ]; then
+               /sbin/modprobe hv_storvsc
+       else
+               echo "vmbus.uevent: unknown class id -
$VMBUS_DEVICE_CLASS_GUID"
+       fi
+       echo "done"
+elif [ $ACTION = "remove" ]; then
+       echo -n "removing device $VMBUS_DEVICE_CLASS_GUID..."
+       # TODO: add rmmod
+       echo "done"
+else
+       echo "unknown action - $ACTION"
+fi
+
diff -uprN /etc.old/vmbus/netvsc.uevent /etc/vmbus/netvsc.uevent
--- /etc.old/vmbus/netvsc.uevent        1970-01-01 01:00:00.000000000 +0100
+++ /etc/vmbus/netvsc.uevent    2009-10-28 00:17:53.000000000 +0100
@@ -0,0 +1,67 @@
+#!/bin/bash
+#
+# Copyright (c) 2009, Microsoft Corporation.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
with
+# this program; if not, write to the Free Software Foundation, Inc., 59
Temple
+# Place - Suite 330, Boston, MA 02111-1307 USA.
+#
+# Authors:
+#   Haiyang Zhang <haiyangz@microsoft.com>
+#   Hank Janssen  <hjanssen@microsoft.com>
+#
+
+usage() {
+ echo "Usage:"
+ echo -e "\t<add> <interface>"
+ exit
+}
+
+# make sure we have 2 args
+[ -n "$1" ] || usage
+[ -n "$2" ] || usage
+
+ACTION=$1
+INTERFACE=$2
+
+INTERFACE_CONFIG_FILE=
+
+if [ -f /etc/redhat-release ]; then
+  INTERFACE_CONFIG_DIR=/etc/sysconfig/network-scripts
+elif [ -f /etc/SuSE-release ]; then
+  INTERFACE_CONFIG_DIR=/etc/sysconfig/network
+else
+  INTERFACE_CONFIG_DIR=/etc/sysconfig/network-scripts
+fi
+
+# On Sles, let yast autogenerates the ifcfg file.
+if [ -f /etc/redhat-release ]; then
+       if [[ $ACTION = "add" && $INTERFACE =~ 'seth[0-9]+' ]]; then
+         INTERFACE_CONFIG_FILE=$INTERFACE_CONFIG_DIR/ifcfg-$INTERFACE
+         if [ ! -f $INTERFACE_CONFIG_FILE ]; then
+                echo -n "adding interface configuration file -
$INTERFACE_CONFIG_FILE..."
+                echo "DEVICE=$INTERFACE" > $INTERFACE_CONFIG_FILE
+                echo "BOOTPROTO=dhcp" >> $INTERFACE_CONFIG_FILE
+                if [ -f /etc/redhat-release ]; then
+                  echo "ONBOOT=yes" >> $INTERFACE_CONFIG_FILE
+                elif [ -f /etc/SuSE-release ]; then
+                  echo "STARTMODE=auto" >> $INTERFACE_CONFIG_FILE
+                else
+                  echo "ONBOOT=yes" >> $INTERFACE_CONFIG_FILE
+                fi
+         fi
+         echo "done"
+       fi
+fi
+
---



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-10-28 22:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-28 22:23 [PATCH] 0/3 staging: hv: fix oops in vmbus Milan Dadok

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.