Skip to contentSkip to conversation

increase MAX_NICS value

PATCH In review Alessandro Bono 3 participants 4 messages Jul 9, 2010 – Jul 12, 2010 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 increase MAX_NICS value

Hi all

max number of allowed nics per vm is hardcoded on net.h to 8. This value it's too low in situation with big network, increase to 24 this should be safe as mentioned on this thread
http://kerneltrap.org/mailarchive/linux-kvm/2009/1/29/4848304/thread

net.h 2010-07-09 17:30:48.842166029 +0200 renamed from net.h.old 2010-07-09 17:30:39.542170103 +0200 +1 -1
@@ -121,7 +121,7 @@
 
 /* NIC info */
 
-#define MAX_NICS 8
+#define MAX_NICS 24 
 
 struct NICInfo {
     uint8_t macaddr[6];
Signature · 2 lines
Cordiali Saluti
Alessandro Bono
#1 lore raw
Quoted 6 lines · Alessandro Bono

Hi all

max number of allowed nics per vm is hardcoded on net.h to 8. This value it's too low in situation with big network, increase to 24 this should be safe as mentioned on this thread
http://kerneltrap.org/mailarchive/linux-kvm/2009/1/29/4848304/thread

A better long term solution might be to convert it to QLIST or something instead of hardcoding the array size.

Quoted 14 lines
net.h 2010-07-09 17:30:48.842166029 +0200 renamed from net.h.old 2010-07-09 17:30:39.542170103 +0200 +1 -1
@@ -121,7 +121,7 @@
 
 /* NIC info */
 
-#define MAX_NICS 8
+#define MAX_NICS 24
 
 struct NICInfo {
     uint8_t macaddr[6];
#2 lore raw
Quoted 11 lines · Brian Jackson
Quoted 6 lines · Alessandro Bono

Hi all

max number of allowed nics per vm is hardcoded on net.h to 8. This value it's too low in situation with big network, increase to 24 this should be safe as mentioned on this thread
http://kerneltrap.org/mailarchive/linux-kvm/2009/1/29/4848304/thread

A better long term solution might be to convert it to QLIST or something instead of hardcoding the array size.

Sure my patch it's simply a better default value and solve the problem for big network. Obviously a dynamic structure it's best suited for this information

Quoted 16 lines
Quoted 16 lines
net.h 2010-07-09 17:30:48.842166029 +0200 renamed from net.h.old 2010-07-09 17:30:39.542170103 +0200 +1 -1
@@ -121,7 +121,7 @@
 
 /* NIC info */
 
-#define MAX_NICS 8
+#define MAX_NICS 24
 
 struct NICInfo {
     uint8_t macaddr[6];
Signature · 2 lines
Cordiali Saluti
Alessandro Bono
#3 lore raw
In reply to Alessandro Bono
Quoted 8 lines · Alessandro Bono

Hi all

max number of allowed nics per vm is hardcoded on net.h to 8. This value it's too low in situation with big network, increase to 24 this should be safe as mentioned on this thread
http://kerneltrap.org/mailarchive/linux-kvm/2009/1/29/4848304/thread

1. Doesn't this belong upstream? [email protected]

2. MAX_NICS applies only to -net nic. Use -device instead. See docs/qdev-device-use.txt