All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [XM-TEST][PATCH] hvm network test fixes
@ 2006-02-01 13:32 Adam Wendt
  0 siblings, 0 replies; 7+ messages in thread
From: Adam Wendt @ 2006-02-01 13:32 UTC (permalink / raw)
  To: adam, xen-devel, Dan Smith

Ya I definatly brought lo up first.

Do you have a working 2.6 kernel + pcnet32/mii modules you could send me to test
with?

Adam Wendt
IPCoast, Inc.

On Wed, 01 Feb 2006 13:28 , Dan Smith <danms@us.ibm.com> sent:

>AQ> Hm, hping2 doesn't appear to work on my disk image:
>AQ> 
>AQ> @%@%> hping2 -c 2 127.0.0.1
>AQ> [open_sockpacket] socket(): Address family not supported by protocol
>AQ> [main] can't open packet socket
>
>It seems to work on my HVM box:
>
>  @%@%> hping2 -c 2 127.0.0.1
>  HPING 127.0.0.1 (lo 127.0.0.1): NO FLAGS are set, 40 headers + 0 data
>  bytes
>  len=40 ip=127.0.0.1 ttl=64 DF id=0 sport=0 flags=RA seq=0 win=0
>  rtt=0.0 ms
>  len=40 ip=127.0.0.1 ttl=64 DF id=1 sport=0 flags=RA seq=1 win=0
>  rtt=0.0 ms
>  
>  --- 127.0.0.1 hping statistic ---
>  2 packets tramitted, 2 packets received, 0% packet loss
>  round-trip min/avg/max = 0.0/0.0/0.0 ms
>
>Are you plumbing lo before attempting this?  By default, lo is down
>and has no IP.
>
>-- 
>Dan Smith
>IBM Linux Technology Center
>Open Hypervisor Team
>email: danms@us.ibm.com
>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [XM-TEST][PATCH] hvm network test fixes
  2006-02-01 12:41 Adam Wendt
  2006-02-01 20:52 ` Dan Smith
@ 2006-02-10  1:13 ` Ewan Mellor
  1 sibling, 0 replies; 7+ messages in thread
From: Ewan Mellor @ 2006-02-10  1:13 UTC (permalink / raw)
  To: Adam Wendt; +Cc: xen-devel

On Wed, Feb 01, 2006 at 12:41:10PM +0000, Adam Wendt wrote:

> The following patch allows the network tests to pass with hvm support enabled.
> 
> More specifically:
> 02_network_local_ping_pos.py
> REASON: ping loopback failed for size 65507. ping eth0 failed for size 65507.
> (but all other size pings work)
> 
> 05_network_dom0_ping_pos.py
> REASON: Ping to dom0 failed for size 65507.
> (but all other size pings work)
> 
> 11_network_domU_ping_pos.py
> passes 100% (even the large ping, i know the large ping is another bug but is it
> supposed to work or fail on this test?)

Applied, thank you.

Could you please include a Signed-off-by: line with your patches?

Thanks,

Ewan.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [XM-TEST][PATCH] hvm network test fixes
  2006-02-01 13:14 Adam Wendt
@ 2006-02-01 21:28 ` Dan Smith
  0 siblings, 0 replies; 7+ messages in thread
From: Dan Smith @ 2006-02-01 21:28 UTC (permalink / raw)
  To: adam; +Cc: xen-devel

AQ> Hm, hping2 doesn't appear to work on my disk image:
AQ> 
AQ> @%@%> hping2 -c 2 127.0.0.1
AQ> [open_sockpacket] socket(): Address family not supported by protocol
AQ> [main] can't open packet socket

It seems to work on my HVM box:

  @%@%> hping2 -c 2 127.0.0.1
  HPING 127.0.0.1 (lo 127.0.0.1): NO FLAGS are set, 40 headers + 0 data
  bytes
  len=40 ip=127.0.0.1 ttl=64 DF id=0 sport=0 flags=RA seq=0 win=0
  rtt=0.0 ms
  len=40 ip=127.0.0.1 ttl=64 DF id=1 sport=0 flags=RA seq=1 win=0
  rtt=0.0 ms
  
  --- 127.0.0.1 hping statistic ---
  2 packets tramitted, 2 packets received, 0% packet loss
  round-trip min/avg/max = 0.0/0.0/0.0 ms

Are you plumbing lo before attempting this?  By default, lo is down
and has no IP.

-- 
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms@us.ibm.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [XM-TEST][PATCH] hvm network test fixes
  2006-02-01 20:52 ` Dan Smith
@ 2006-02-01 21:12   ` Nivedita Singhvi
  0 siblings, 0 replies; 7+ messages in thread
From: Nivedita Singhvi @ 2006-02-01 21:12 UTC (permalink / raw)
  To: Dan Smith; +Cc: xen-devel, adam

Dan Smith wrote:
> AW> the hvm image doesn't appear to have support for ping -f so I'll
> AW> need to find another solution, any ideas? 
> 
> We put hping is in the disk image for network testing, so perhaps it
> can be of use?  It looks like you can at least specify the interval
> between pings to be a small number of microseconds, with -i uX.
> 

Yep, that was one of the reasons for the hping inclusion..

thanks,
Nivedita

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [XM-TEST][PATCH] hvm network test fixes
  2006-02-01 12:41 Adam Wendt
@ 2006-02-01 20:52 ` Dan Smith
  2006-02-01 21:12   ` Nivedita Singhvi
  2006-02-10  1:13 ` Ewan Mellor
  1 sibling, 1 reply; 7+ messages in thread
From: Dan Smith @ 2006-02-01 20:52 UTC (permalink / raw)
  To: adam; +Cc: xen-devel


AW> the hvm image doesn't appear to have support for ping -f so I'll
AW> need to find another solution, any ideas? 

We put hping is in the disk image for network testing, so perhaps it
can be of use?  It looks like you can at least specify the interval
between pings to be a small number of microseconds, with -i uX.

-- 
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms@us.ibm.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [XM-TEST][PATCH] hvm network test fixes
@ 2006-02-01 13:14 Adam Wendt
  2006-02-01 21:28 ` Dan Smith
  0 siblings, 1 reply; 7+ messages in thread
From: Adam Wendt @ 2006-02-01 13:14 UTC (permalink / raw)
  To: adam, xen-devel, Dan Smith

Hm, hping2 doesn't appear to work on my disk image:

@%@%> hping2 -c 2 127.0.0.1
[open_sockpacket] socket(): Address family not supported by protocol
[main] can't open packet socket

Maybe an issue with using the 2.4 kernel or something else?

Adam Wendt
IPCoast, Inc.

On Wed, 01 Feb 2006 12:52 , Dan Smith <danms@us.ibm.com> sent:

>
>AW> the hvm image doesn't appear to have support for ping -f so I'll
>AW> need to find another solution, any ideas? 
>
>We put hping is in the disk image for network testing, so perhaps it
>can be of use?  It looks like you can at least specify the interval
>between pings to be a small number of microseconds, with -i uX.
>
>-- 
>Dan Smith
>IBM Linux Technology Center
>Open Hypervisor Team
>email: danms@us.ibm.com
>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [XM-TEST][PATCH] hvm network test fixes
@ 2006-02-01 12:41 Adam Wendt
  2006-02-01 20:52 ` Dan Smith
  2006-02-10  1:13 ` Ewan Mellor
  0 siblings, 2 replies; 7+ messages in thread
From: Adam Wendt @ 2006-02-01 12:41 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 961 bytes --]

The following patch allows the network tests to pass with hvm support enabled.

More specifically:
02_network_local_ping_pos.py
REASON: ping loopback failed for size 65507. ping eth0 failed for size 65507.
(but all other size pings work)

05_network_dom0_ping_pos.py
REASON: Ping to dom0 failed for size 65507.
(but all other size pings work)

11_network_domU_ping_pos.py
passes 100% (even the large ping, i know the large ping is another bug but is it
supposed to work or fail on this test?)

Let me know if there's anything I should change in the patch, my next step is to
try to build some network tests that put a little strain on the network, the hvm
image doesn't appear to have support for ping -f so I'll need to find another
solution, any ideas? (Yes I can probably ping -f from outside the domain at it,
but would be nice to have something to test the other direction, or even ssh to
test that data isn't being corrupted.)

Adam Wendt
IPCoast, Inc.



[-- Attachment #2: xmtestnetworkhvm.patch --]
[-- Type: application/octet-stream, Size: 4382 bytes --]

# HG changeset patch
# User adam@ipcoast.com
# Node ID 20630fa9c577af094375463c991d06313b2fa97a
# Parent  0c94043f5c5b845a2b0731c444aec09ef7a901f4
Fix xm-test network tests to work with hvm support enabled.

diff -r 0c94043f5c5b -r 20630fa9c577 tools/xm-test/lib/XmTestLib/Network.py
--- a/tools/xm-test/lib/XmTestLib/Network.py	Wed Feb  1 15:28:50 2006
+++ b/tools/xm-test/lib/XmTestLib/Network.py	Wed Feb  1 20:28:32 2006
@@ -25,6 +25,7 @@
 
 from Test import *
 from Xm import *
+from config import *
 
 class NetworkError(Exception):
     def __init__(self, msg):
@@ -36,6 +37,9 @@
 def undo_dom0_alias(eth, ip):
     traceCommand("ip addr del " + ip + " dev " + eth)
 
+def net_from_ip(ip):
+    return ip[:ip.rfind(".")] + ".0/24"
+    
 class XmNetwork:
 
     def __init__(self):
@@ -56,14 +60,21 @@
         domnum = int(dom[len("dom"):])
         return "169.254."+ str(ethnum+153) + "." + str(domnum+10)
 
-    def ip(self, dom, interface, todomname=None, toeth=None):
+    def ip(self, dom, interface, todomname=None, toeth=None, bridge=None):
         newip = self.calc_ip_address(dom, interface)
 
         # If the testcase is going to talk to dom0, we need to add an 
         # IP address in the proper subnet
         if dom == "dom0":
-            # The domain's vif is a convenient place to add to
-            vifname = "vif" + str(domid(todomname)) + "." + toeth[3:]
+	    if ENABLE_HVM_SUPPORT:
+	        # HVM uses ioemu which uses a bridge
+		if not bridge:
+		    SKIP("no bridge supplied")
+		else:
+		    vifname = bridge
+	    else:
+                # The domain's vif is a convenient place to add to
+                vifname = "vif" + str(domid(todomname)) + "." + toeth[3:]
 
             # register the exit handler FIRST, just in case
             atexit.register(undo_dom0_alias, vifname, newip)
@@ -73,6 +84,15 @@
                                               " dev " + vifname)
             if status:
                 SKIP("\"ip addr add\" failed")
+
+	    if ENABLE_HVM_SUPPORT:
+	        # We need to add a route to the bridge device
+		network = net_from_ip(newip)
+		status, output = traceCommand("ip route add " + network + " dev " + vifname + " scope link")
+
+                if status:
+		    SKIP("\"ip route add\" failed")
+
         return newip
 
     def mask(self, dom, interface):
diff -r 0c94043f5c5b -r 20630fa9c577 tools/xm-test/tests/network/02_network_local_ping_pos.py
--- a/tools/xm-test/tests/network/02_network_local_ping_pos.py	Wed Feb  1 15:28:50 2006
+++ b/tools/xm-test/tests/network/02_network_local_ping_pos.py	Wed Feb  1 20:28:32 2006
@@ -28,7 +28,11 @@
 mask = Net.mask("dom1", "eth0")
 
 # Fire up a guest domain w/1 nic
-config = {"vif" : ['ip=%s' % ip]}
+if ENABLE_HVM_SUPPORT:
+    config = {"vif" : ['type=ioemu']}
+else:
+    config = {"vif" : ['ip=%s' % ip ]}
+
 domain = XmTestDomain(extraConfig=config)
 try:
     domain.start()
diff -r 0c94043f5c5b -r 20630fa9c577 tools/xm-test/tests/network/05_network_dom0_ping_pos.py
--- a/tools/xm-test/tests/network/05_network_dom0_ping_pos.py	Wed Feb  1 15:28:50 2006
+++ b/tools/xm-test/tests/network/05_network_dom0_ping_pos.py	Wed Feb  1 20:28:32 2006
@@ -31,7 +31,13 @@
         FAIL(str(e))
 
 # Fire up a guest domain w/1 nic
-config = {"vif"  : ["ip=%s" % ip]}
+if ENABLE_HVM_SUPPORT:
+    brg = "xenbr0"
+    config = {"vif" : ['type=ioemu, bridge=%s' % brg]}
+else:
+    config = {"vif" : ['ip=%s' % ip ]}
+    brg = None
+
 domain = XmTestDomain(extraConfig=config)
 try:
     domain.start()
@@ -52,7 +58,7 @@
 
 try:
     # Add a suitable dom0 IP address 
-    dom0ip = Net.ip("dom0", "eth0", todomname=domain.getName(), toeth="eth0")
+    dom0ip = Net.ip("dom0", "eth0", todomname=domain.getName(), toeth="eth0", bridge=brg)
 except NetworkError, e:
         FAIL(str(e))
 
diff -r 0c94043f5c5b -r 20630fa9c577 tools/xm-test/tests/network/11_network_domU_ping_pos.py
--- a/tools/xm-test/tests/network/11_network_domU_ping_pos.py	Wed Feb  1 15:28:50 2006
+++ b/tools/xm-test/tests/network/11_network_domU_ping_pos.py	Wed Feb  1 20:28:32 2006
@@ -18,7 +18,11 @@
 from XmTestLib import *
 
 def netDomain(ip):
-    config = {"vif"  : ["ip=%s" % ip]}
+    if ENABLE_HVM_SUPPORT:
+        config = {"vif" : ['type=ioemu']}
+    else:
+        config = {"vif" : ['ip=%s' % ip ]}
+
     dom = XmTestDomain(extraConfig=config)
     try:
         dom.start()

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-02-10  1:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-01 13:32 [XM-TEST][PATCH] hvm network test fixes Adam Wendt
  -- strict thread matches above, loose matches on Subject: below --
2006-02-01 13:14 Adam Wendt
2006-02-01 21:28 ` Dan Smith
2006-02-01 12:41 Adam Wendt
2006-02-01 20:52 ` Dan Smith
2006-02-01 21:12   ` Nivedita Singhvi
2006-02-10  1:13 ` Ewan Mellor

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.