Skip to contentSkip to conversation

Exceed maximum number of ioemu's NIC for VNIF.

PATCH New Kasai Takanori 1 participant 1 message May 30, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Exceed maximum number of ioemu's NIC for VNIF.

Hi All,

We tested the PV driver on HVM domain. When ten vif was defined in configuration file for VNIF, the HVM domain was not able to be created.

----------------------------------------------------------

# grep vif RHEL5GA_test.conf
vif = [ 'mac=02:17:42:2f:01:11, bridge=xenbr0', 
       'mac=02:17:42:2f:03:11, bridge=xenbr2',
       'mac=02:17:42:2f:01:12, bridge=xenbr0', 
       'mac=02:17:42:2f:03:12, bridge=xenbr2', 
       'mac=02:17:42:2f:01:13, bridge=xenbr0', 
       'mac=02:17:42:2f:03:13, bridge=xenbr2',
       'mac=02:17:42:2f:01:14, bridge=xenbr0', 
       'mac=02:17:42:2f:03:14, bridge=xenbr2',
       'mac=02:17:42:2f:01:15, bridge=xenbr0', 
       'mac=02:17:42:2f:03:15, bridge=xenbr2' ]
# xm create -f RHEL5GA.conf
Using config file "./RHEL5GA.conf".
Started domain RHEL5GA
# xm list
Name             ID   Mem VCPUs      State   Time(s)
Domain-0          0  1024     4     r-----    291.1
RHEL5GA          10  2048     1     ------      0.0
# cat /var/log/xen/qemu-XXX.log
domid: 10
qemu: the number of cpus is 1
Too Many NICs
----------------------------------------------------------

The cause is to exceed the number of maximum in ioemu NIC.(MAX_NICS=8) However, VNIF can be used because of nine more expanding grant table.

We usually use and operate VNIF of ten or more. Even if the maximum number of ioemu NICs is exceeded when VNIF is used, the HVM domain should be able to be created.

It was corrected that ioemu disregarded it when the maximum number of NIC was exceeded. It has been confirmed that the problem solves by this patch.

Best Regards,

--
Takanori Kasai

# HG changeset patch
# User [email protected]
# Date 1180525386 -32400
# Node ID f62da1e67aa00e9c50368240a3b692b659d4fd97 # Parent c1681085bf42c8fa639774ac91f3ca8fd2b127a0 Exceed maximum number of ioemu's NIC for VNIF.

tools/ioemu/vl.c +24 -23
diff -r c1681085bf42 -r f62da1e67aa0 tools/ioemu/vl.c
@@ -3963,30 +3963,31 @@ static int net_client_init(const char *s
         NICInfo *nd;
         uint8_t *macaddr;
 
-        if (nb_nics >= MAX_NICS) {
+        if (nb_nics < MAX_NICS) {
+            nd = &nd_table[nb_nics];
+            macaddr = nd->macaddr;
+            macaddr[0] = 0x52;
+            macaddr[1] = 0x54;
+            macaddr[2] = 0x00;
+            macaddr[3] = 0x12;
+            macaddr[4] = 0x34;
+            macaddr[5] = 0x56 + nb_nics;
+
+            if (get_param_value(buf, sizeof(buf), "macaddr", p)) {
+                if (parse_macaddr(macaddr, buf) < 0) {
+                    fprintf(stderr, "invalid syntax for ethernet address\n");
+                    return -1;
+                }
+            }
+            if (get_param_value(buf, sizeof(buf), "model", p)) {
+                nd->model = strdup(buf);
+            }
+            nd->vlan = vlan;
+            nb_nics++;
+        }
+	else {
             fprintf(stderr, "Too Many NICs\n");
-            return -1;
-        }
-        nd = &nd_table[nb_nics];
-        macaddr = nd->macaddr;
-        macaddr[0] = 0x52;
-        macaddr[1] = 0x54;
-        macaddr[2] = 0x00;
-        macaddr[3] = 0x12;
-        macaddr[4] = 0x34;
-        macaddr[5] = 0x56 + nb_nics;
-
-        if (get_param_value(buf, sizeof(buf), "macaddr", p)) {
-            if (parse_macaddr(macaddr, buf) < 0) {
-                fprintf(stderr, "invalid syntax for ethernet address\n");
-                return -1;
-            }
-        }
-        if (get_param_value(buf, sizeof(buf), "model", p)) {
-            nd->model = strdup(buf);
-        }
-        nd->vlan = vlan;
-        nb_nics++;
+	}
         ret = 0;
     } else
     if (!strcmp(device, "none")) {

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel