* [Qemu-devel] [PATCH] net: Allow specifying maximum number of network NICs during configure
@ 2015-06-20 11:26 Shmulik Ladkani
2015-06-22 12:13 ` Stefan Hajnoczi
0 siblings, 1 reply; 8+ messages in thread
From: Shmulik Ladkani @ 2015-06-20 11:26 UTC (permalink / raw
To: qemu-devel; +Cc: Jason Wang, idan.brown, Shmulik Ladkani, Stefan Hajnoczi
Currently, MAX_NICS is hardcoded as 8.
Add a configuration option '--net-max-nics' so one can override the
default.
Unless specified, default value is kept as 8.
Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com>
---
configure | 7 +++++++
include/net/net.h | 2 +-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index 222694f34d..ce859a1853 100755
--- a/configure
+++ b/configure
@@ -336,6 +336,7 @@ vhdx=""
quorum=""
numa=""
tcmalloc="no"
+net_max_nics="8"
# parse CC options first
for opt do
@@ -1147,6 +1148,8 @@ for opt do
;;
--enable-tcmalloc) tcmalloc="yes"
;;
+ --net-max-nics=*) net_max_nics="$optarg"
+ ;;
*)
echo "ERROR: unknown option $opt"
echo "Try '$0 --help' for more information"
@@ -1420,6 +1423,7 @@ Advanced options (experts only):
--enable-numa enable libnuma support
--disable-tcmalloc disable tcmalloc support
--enable-tcmalloc enable tcmalloc support
+ --net-max-nics=NUM maximum number of network NICs
NOTE: The object files are built at the place where configure is launched
EOF
@@ -4499,6 +4503,7 @@ echo "snappy support $snappy"
echo "bzip2 support $bzip2"
echo "NUMA host support $numa"
echo "tcmalloc support $tcmalloc"
+echo "maximum network nics $net_max_nics"
if test "$sdl_too_old" = "yes"; then
echo "-> Your SDL version is too old - please upgrade to have SDL support"
@@ -5011,6 +5016,8 @@ if test "$rdma" = "yes" ; then
echo "CONFIG_RDMA=y" >> $config_host_mak
fi
+echo "CONFIG_NET_MAX_NICS=$net_max_nics" >> $config_host_mak
+
# Hold two types of flag:
# CONFIG_THREAD_SETNAME_BYTHREAD - we've got a way of setting the name on
# a thread we have a handle to
diff --git a/include/net/net.h b/include/net/net.h
index 4306252b97..6be063f1dc 100644
--- a/include/net/net.h
+++ b/include/net/net.h
@@ -167,7 +167,7 @@ void hmp_info_network(Monitor *mon, const QDict *qdict);
/* NIC info */
-#define MAX_NICS 8
+#define MAX_NICS (CONFIG_NET_MAX_NICS)
struct NICInfo {
MACAddr macaddr;
--
1.9.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] net: Allow specifying maximum number of network NICs during configure
2015-06-20 11:26 [Qemu-devel] [PATCH] net: Allow specifying maximum number of network NICs during configure Shmulik Ladkani
@ 2015-06-22 12:13 ` Stefan Hajnoczi
2015-06-22 14:42 ` Shmulik Ladkani
2015-09-28 11:52 ` [Qemu-devel] Problems on vlan-based vnics! cauchy-love
0 siblings, 2 replies; 8+ messages in thread
From: Stefan Hajnoczi @ 2015-06-22 12:13 UTC (permalink / raw
To: Shmulik Ladkani
Cc: Jason Wang, idan.brown, qemu-devel, Stefan Hajnoczi,
Shmulik Ladkani
[-- Attachment #1: Type: text/plain, Size: 841 bytes --]
On Sat, Jun 20, 2015 at 02:26:29PM +0300, Shmulik Ladkani wrote:
> Currently, MAX_NICS is hardcoded as 8.
>
> Add a configuration option '--net-max-nics' so one can override the
> default.
> Unless specified, default value is kept as 8.
>
> Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com>
> ---
> configure | 7 +++++++
> include/net/net.h | 2 +-
> 2 files changed, 8 insertions(+), 1 deletion(-)
The -device e1000,netdev=tap0,id=e1000-nic0 syntax is preferred to -net
nic syntax and does not have the 8 NIC limit.
Please use the -device syntax instead of -net. Emulated NICs that
support virtio_net_hdr offload also perform better with the -device
syntax because -net nic does not allow virtio_net_hdr offloads.
If you think this patch should be merged, please explain the use case.
[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] net: Allow specifying maximum number of network NICs during configure
2015-06-22 12:13 ` Stefan Hajnoczi
@ 2015-06-22 14:42 ` Shmulik Ladkani
2015-09-28 11:52 ` [Qemu-devel] Problems on vlan-based vnics! cauchy-love
1 sibling, 0 replies; 8+ messages in thread
From: Shmulik Ladkani @ 2015-06-22 14:42 UTC (permalink / raw
To: Stefan Hajnoczi
Cc: Jason Wang, idan.brown, Shmulik Ladkani, Stefan Hajnoczi,
qemu-devel
Hi,
On Mon, 22 Jun 2015 13:13:20 +0100, stefanha@gmail.com wrote:
> The -device e1000,netdev=tap0,id=e1000-nic0 syntax is preferred to
> -net nic syntax and does not have the 8 NIC limit.
>
> Please use the -device syntax instead of -net.
Very well, thanks.
Shmulik
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Qemu-devel] Problems on vlan-based vnics!
2015-06-22 12:13 ` Stefan Hajnoczi
2015-06-22 14:42 ` Shmulik Ladkani
@ 2015-09-28 11:52 ` cauchy-love
2015-09-29 3:19 ` Jason Wang
1 sibling, 1 reply; 8+ messages in thread
From: cauchy-love @ 2015-09-28 11:52 UTC (permalink / raw
To: Stefan Hajnoczi
Cc: Jason Wang, idan.brown, qemu-devel, Shmulik Ladkani,
Stefan Hajnoczi, Shmulik Ladkani
hi stefan.
I have setup a VM on a server with two NICs (eth0 and eth1). eth0 is connected with vlan22 and eth1 is connected with vlan33. I then added eth0.22 to br2 and eth1.33 to br3. after that tap2 and tap3 were added to br2 and br3 respectively. When i start up the vm, the network connection is failed if tap2 and tap3 are allocated to this VM while it is ok if i only allocate one tap to this VM. It is shown that the packets were all routed to one NIC. So what is the problem?
yi
--
发自我的网易邮箱手机智能版
在 2015-06-22 20:13:20,"Stefan Hajnoczi" <stefanha@gmail.com> 写道:
>On Sat, Jun 20, 2015 at 02:26:29PM +0300, Shmulik Ladkani wrote:
>> Currently, MAX_NICS is hardcoded as 8.
>>
>> Add a configuration option '--net-max-nics' so one can override the
>> default.
>> Unless specified, default value is kept as 8.
>>
>> Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com>
>> ---
>> configure | 7 +++++++
>> include/net/net.h | 2 +-
>> 2 files changed, 8 insertions(+), 1 deletion(-)
>
>The -device e1000,netdev=tap0,id=e1000-nic0 syntax is preferred to -net
>nic syntax and does not have the 8 NIC limit.
>
>Please use the -device syntax instead of -net. Emulated NICs that
>support virtio_net_hdr offload also perform better with the -device
>syntax because -net nic does not allow virtio_net_hdr offloads.
>
>If you think this patch should be merged, please explain the use case.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] Problems on vlan-based vnics!
2015-09-28 11:52 ` [Qemu-devel] Problems on vlan-based vnics! cauchy-love
@ 2015-09-29 3:19 ` Jason Wang
2015-09-29 5:28 ` cauchy-love
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Jason Wang @ 2015-09-29 3:19 UTC (permalink / raw
To: cauchy-love, Stefan Hajnoczi
Cc: Shmulik Ladkani, idan.brown, Shmulik Ladkani, Stefan Hajnoczi,
qemu-devel
On 09/28/2015 07:52 PM, cauchy-love wrote:
> hi stefan.
> I have setup a VM on a server with two NICs (eth0 and eth1). eth0 is connected with vlan22 and eth1 is connected with vlan33. I then added eth0.22 to br2 and eth1.33 to br3. after that tap2 and tap3 were added to br2 and br3 respectively. When i start up the vm, the network connection is failed if tap2 and tap3 are allocated to this VM while it is ok if i only allocate one tap to this VM. It is shown that the packets were all routed to one NIC. So what is the problem?
> yi
>
Need more information. You qemu command line or libvirt xml. Versions of
qemu, host kernel and guest kernel. Is the issue only reproduced with
e1000 or others? Does it work if there's no vlan? And maybe you can try
qemu.git to see if it could be reproduced.
Thanks
>
>
> --
> 发自我的网易邮箱手机智能版
>
>
> 在 2015-06-22 20:13:20,"Stefan Hajnoczi" <stefanha@gmail.com> 写道:
>> On Sat, Jun 20, 2015 at 02:26:29PM +0300, Shmulik Ladkani wrote:
>>> Currently, MAX_NICS is hardcoded as 8.
>>>
>>> Add a configuration option '--net-max-nics' so one can override the
>>> default.
>>> Unless specified, default value is kept as 8.
>>>
>>> Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com>
>>> ---
>>> configure | 7 +++++++
>>> include/net/net.h | 2 +-
>>> 2 files changed, 8 insertions(+), 1 deletion(-)
>> The -device e1000,netdev=tap0,id=e1000-nic0 syntax is preferred to -net
>> nic syntax and does not have the 8 NIC limit.
>>
>> Please use the -device syntax instead of -net. Emulated NICs that
>> support virtio_net_hdr offload also perform better with the -device
>> syntax because -net nic does not allow virtio_net_hdr offloads.
>>
>> If you think this patch should be merged, please explain the use case.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] Problems on vlan-based vnics!
2015-09-29 3:19 ` Jason Wang
@ 2015-09-29 5:28 ` cauchy-love
2015-09-29 5:36 ` cauchy-love
2015-09-29 11:46 ` cauchy-love
2 siblings, 0 replies; 8+ messages in thread
From: cauchy-love @ 2015-09-29 5:28 UTC (permalink / raw
To: Jason Wang
Cc: Stefan Hajnoczi, idan.brown, qemu-devel, Shmulik Ladkani,
Stefan Hajnoczi, Shmulik Ladkani
Thanks for your reply. After testing, I found the network connection was failed even without vlan. If I started up two VMs, each of which has two VNICS(attached to br0 and br1), the network failed if br0 and br1 were on different VLans( belong to the same NIC) or on different NICs. I am using CENTOS 7.0 and QEMU2.3 as well as E1000. The command line is as following:
qemu -net nic, model=e1000,macaddr=xxxx -net bridge=br0, tap=tap11,scipt=no -net nic,model=e1000,macaddr=xxxx -net bridge=br1,tap=tap12,script=no -enable kvm
在 2015-09-29 11:19:41,"Jason Wang" <jasowang@redhat.com> 写道:
On 09/28/2015 07:52 PM, cauchy-love wrote:
> hi stefan.
> I have setup a VM on a server with two NICs (eth0 and eth1). eth0 is connected with vlan22 and eth1 is connected with vlan33. I then added eth0.22 to br2 and eth1.33 to br3. after that tap2 and tap3 were added to br2 and br3 respectively. When i start up the vm, the network connection is failed if tap2 and tap3 are allocated to this VM while it is ok if i only allocate one tap to this VM. It is shown that the packets were all routed to one NIC. So what is the problem?
> yi
>
Need more information. You qemu command line or libvirt xml. Versions of
qemu, host kernel and guest kernel. Is the issue only reproduced with
e1000 or others? Does it work if there's no vlan? And maybe you can try
qemu.git to see if it could be reproduced.
Thanks
>
>
> --
> 发自我的网易邮箱手机智能版
>
>
> 在 2015-06-22 20:13:20,"Stefan Hajnoczi" <stefanha@gmail.com> 写道:
>> On Sat, Jun 20, 2015 at 02:26:29PM +0300, Shmulik Ladkani wrote:
>>> Currently, MAX_NICS is hardcoded as 8.
>>>
>>> Add a configuration option '--net-max-nics' so one can override the
>>> default.
>>> Unless specified, default value is kept as 8.
>>>
>>> Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com>
>>> ---
>>> configure | 7 +++++++
>>> include/net/net.h | 2 +-
>>> 2 files changed, 8 insertions(+), 1 deletion(-)
>> The -device e1000,netdev=tap0,id=e1000-nic0 syntax is preferred to -net
>> nic syntax and does not have the 8 NIC limit.
>>
>> Please use the -device syntax instead of -net. Emulated NICs that
>> support virtio_net_hdr offload also perform better with the -device
>> syntax because -net nic does not allow virtio_net_hdr offloads.
>>
>> If you think this patch should be merged, please explain the use case.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] Problems on vlan-based vnics!
2015-09-29 3:19 ` Jason Wang
2015-09-29 5:28 ` cauchy-love
@ 2015-09-29 5:36 ` cauchy-love
2015-09-29 11:46 ` cauchy-love
2 siblings, 0 replies; 8+ messages in thread
From: cauchy-love @ 2015-09-29 5:36 UTC (permalink / raw
To: Jason Wang
Cc: Stefan Hajnoczi, idan.brown, qemu-devel, Shmulik Ladkani,
Stefan Hajnoczi, Shmulik Ladkani
BTW: Xen4.2 and later works quite well
在 2015-09-29 11:19:41,"Jason Wang" <jasowang@redhat.com> 写道:
On 09/28/2015 07:52 PM, cauchy-love wrote:
> hi stefan.
> I have setup a VM on a server with two NICs (eth0 and eth1). eth0 is connected with vlan22 and eth1 is connected with vlan33. I then added eth0.22 to br2 and eth1.33 to br3. after that tap2 and tap3 were added to br2 and br3 respectively. When i start up the vm, the network connection is failed if tap2 and tap3 are allocated to this VM while it is ok if i only allocate one tap to this VM. It is shown that the packets were all routed to one NIC. So what is the problem?
> yi
>
Need more information. You qemu command line or libvirt xml. Versions of
qemu, host kernel and guest kernel. Is the issue only reproduced with
e1000 or others? Does it work if there's no vlan? And maybe you can try
qemu.git to see if it could be reproduced.
Thanks
>
>
> --
> 发自我的网易邮箱手机智能版
>
>
> 在 2015-06-22 20:13:20,"Stefan Hajnoczi" <stefanha@gmail.com> 写道:
>> On Sat, Jun 20, 2015 at 02:26:29PM +0300, Shmulik Ladkani wrote:
>>> Currently, MAX_NICS is hardcoded as 8.
>>>
>>> Add a configuration option '--net-max-nics' so one can override the
>>> default.
>>> Unless specified, default value is kept as 8.
>>>
>>> Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com>
>>> ---
>>> configure | 7 +++++++
>>> include/net/net.h | 2 +-
>>> 2 files changed, 8 insertions(+), 1 deletion(-)
>> The -device e1000,netdev=tap0,id=e1000-nic0 syntax is preferred to -net
>> nic syntax and does not have the 8 NIC limit.
>>
>> Please use the -device syntax instead of -net. Emulated NICs that
>> support virtio_net_hdr offload also perform better with the -device
>> syntax because -net nic does not allow virtio_net_hdr offloads.
>>
>> If you think this patch should be merged, please explain the use case.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] Problems on vlan-based vnics!
2015-09-29 3:19 ` Jason Wang
2015-09-29 5:28 ` cauchy-love
2015-09-29 5:36 ` cauchy-love
@ 2015-09-29 11:46 ` cauchy-love
2 siblings, 0 replies; 8+ messages in thread
From: cauchy-love @ 2015-09-29 11:46 UTC (permalink / raw
To: Jason Wang
Cc: Stefan Hajnoczi, idan.brown, qemu-devel, Shmulik Ladkani,
Stefan Hajnoczi, Shmulik Ladkani
BTW: the virt-manager works well on the server. I don't know how to make the multiple NICs work using command line.
在 2015-09-29 11:19:41,"Jason Wang" <jasowang@redhat.com> 写道:
On 09/28/2015 07:52 PM, cauchy-love wrote:
> hi stefan.
> I have setup a VM on a server with two NICs (eth0 and eth1). eth0 is connected with vlan22 and eth1 is connected with vlan33. I then added eth0.22 to br2 and eth1.33 to br3. after that tap2 and tap3 were added to br2 and br3 respectively. When i start up the vm, the network connection is failed if tap2 and tap3 are allocated to this VM while it is ok if i only allocate one tap to this VM. It is shown that the packets were all routed to one NIC. So what is the problem?
> yi
>
Need more information. You qemu command line or libvirt xml. Versions of
qemu, host kernel and guest kernel. Is the issue only reproduced with
e1000 or others? Does it work if there's no vlan? And maybe you can try
qemu.git to see if it could be reproduced.
Thanks
>
>
> --
> 发自我的网易邮箱手机智能版
>
>
> 在 2015-06-22 20:13:20,"Stefan Hajnoczi" <stefanha@gmail.com> 写道:
>> On Sat, Jun 20, 2015 at 02:26:29PM +0300, Shmulik Ladkani wrote:
>>> Currently, MAX_NICS is hardcoded as 8.
>>>
>>> Add a configuration option '--net-max-nics' so one can override the
>>> default.
>>> Unless specified, default value is kept as 8.
>>>
>>> Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com>
>>> ---
>>> configure | 7 +++++++
>>> include/net/net.h | 2 +-
>>> 2 files changed, 8 insertions(+), 1 deletion(-)
>> The -device e1000,netdev=tap0,id=e1000-nic0 syntax is preferred to -net
>> nic syntax and does not have the 8 NIC limit.
>>
>> Please use the -device syntax instead of -net. Emulated NICs that
>> support virtio_net_hdr offload also perform better with the -device
>> syntax because -net nic does not allow virtio_net_hdr offloads.
>>
>> If you think this patch should be merged, please explain the use case.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-09-29 11:46 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-20 11:26 [Qemu-devel] [PATCH] net: Allow specifying maximum number of network NICs during configure Shmulik Ladkani
2015-06-22 12:13 ` Stefan Hajnoczi
2015-06-22 14:42 ` Shmulik Ladkani
2015-09-28 11:52 ` [Qemu-devel] Problems on vlan-based vnics! cauchy-love
2015-09-29 3:19 ` Jason Wang
2015-09-29 5:28 ` cauchy-love
2015-09-29 5:36 ` cauchy-love
2015-09-29 11:46 ` cauchy-love
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.