* [Qemu-devel] [PULL 1/4] tap: set vhostfd passed from qemu cli to non-blocking
2018-06-15 3:01 [Qemu-devel] [PULL 0/4] Net patches Jason Wang
@ 2018-06-15 3:01 ` Jason Wang
2018-06-15 3:01 ` [Qemu-devel] [PULL 2/4] net: Fix a potential segfault Jason Wang
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Jason Wang @ 2018-06-15 3:01 UTC (permalink / raw)
To: qemu-devel, peter.maydell
Cc: Brijesh Singh, qemu-stable, Michael S . Tsirkin, Jason Wang
From: Brijesh Singh <brijesh.singh@amd.com>
A guest boot hangs while probing the network interface when
iommu_platform=on is used.
The following qemu cli hangs without this patch:
# $QEMU \
-netdev tap,fd=3,id=hostnet0,vhost=on,vhostfd=4 3<>/dev/tap67 4<>/dev/host-net \
-device virtio-net-pci,netdev=hostnet0,id=net0,iommu_platform=on,disable-legacy=on \
...
Commit: c471ad0e9bd46 (vhost_net: device IOTLB support) took care of
setting vhostfd to non-blocking when QEMU opens /dev/host-net but if
the fd is passed from qemu cli then we need to ensure that fd is set
to non-blocking.
Fixes: c471ad0e9bd46 ("vhost_net: device IOTLB support")
Cc: qemu-stable@nongnu.org
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
net/tap.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/tap.c b/net/tap.c
index de05f20..2126f48 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -40,6 +40,7 @@
#include "qemu-common.h"
#include "qemu/cutils.h"
#include "qemu/error-report.h"
+#include "qemu/sockets.h"
#include "net/tap.h"
@@ -693,6 +694,7 @@ static void net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer,
}
return;
}
+ qemu_set_nonblock(vhostfd);
} else {
vhostfd = open("/dev/vhost-net", O_RDWR);
if (vhostfd < 0) {
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PULL 2/4] net: Fix a potential segfault
2018-06-15 3:01 [Qemu-devel] [PULL 0/4] Net patches Jason Wang
2018-06-15 3:01 ` [Qemu-devel] [PULL 1/4] tap: set vhostfd passed from qemu cli to non-blocking Jason Wang
@ 2018-06-15 3:01 ` Jason Wang
2018-06-15 3:01 ` [Qemu-devel] [PULL 3/4] e1000e: Do not auto-clear ICR bits which aren't set in EIAC Jason Wang
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Jason Wang @ 2018-06-15 3:01 UTC (permalink / raw)
To: qemu-devel, peter.maydell; +Cc: Lin Ma, qemu-stable, Jason Wang
From: Lin Ma <lma@suse.com>
If user forgets to provide any backend types for '-netdev' in qemu CLI,
It triggers seg fault.
e.g.
Expected:
$ qemu -netdev id=net0
qemu-system-x86_64: Parameter 'type' is missing
Actual:
$ qemu -netdev id=net0
Segmentation fault (core dumped)
Fixes: 547203ead4327 ("net: List available netdevs with "-netdev help")
Reviewed-by: Thomas Huth <thuth@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Lin Ma <lma@suse.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
net/net.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/net.c b/net/net.c
index efb9eaf..2a31339 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1093,7 +1093,9 @@ static int net_client_init(QemuOpts *opts, bool is_netdev, Error **errp)
int ret = -1;
Visitor *v = opts_visitor_new(opts);
- if (is_netdev && is_help_option(qemu_opt_get(opts, "type"))) {
+ const char *type = qemu_opt_get(opts, "type");
+
+ if (is_netdev && type && is_help_option(type)) {
show_netdevs();
exit(0);
} else {
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PULL 3/4] e1000e: Do not auto-clear ICR bits which aren't set in EIAC
2018-06-15 3:01 [Qemu-devel] [PULL 0/4] Net patches Jason Wang
2018-06-15 3:01 ` [Qemu-devel] [PULL 1/4] tap: set vhostfd passed from qemu cli to non-blocking Jason Wang
2018-06-15 3:01 ` [Qemu-devel] [PULL 2/4] net: Fix a potential segfault Jason Wang
@ 2018-06-15 3:01 ` Jason Wang
2018-06-15 3:01 ` [Qemu-devel] [PULL 4/4] vhost-user: delete net client if necessary Jason Wang
2018-06-15 11:49 ` [Qemu-devel] [PULL 0/4] Net patches Peter Maydell
4 siblings, 0 replies; 6+ messages in thread
From: Jason Wang @ 2018-06-15 3:01 UTC (permalink / raw)
To: qemu-devel, peter.maydell; +Cc: Jan Kiszka, Jason Wang
From: Jan Kiszka <jan.kiszka@siemens.com>
The spec does not justify clearing of any E1000_ICR_OTHER_CAUSES when
E1000_ICR_OTHER is set in EIAC. In fact, removing this code fixes the
issue the Linux driver runs into since 4aea7a5c5e94 ("e1000e: Avoid
receiver overrun interrupt bursts") and was worked around by
745d0bd3af99 ("e1000e: Remove Other from EIAC").
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
hw/net/e1000e_core.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c
index c93c466..9504891 100644
--- a/hw/net/e1000e_core.c
+++ b/hw/net/e1000e_core.c
@@ -2022,10 +2022,6 @@ e1000e_msix_notify_one(E1000ECore *core, uint32_t cause, uint32_t int_cfg)
effective_eiac = core->mac[EIAC] & cause;
- if (effective_eiac == E1000_ICR_OTHER) {
- effective_eiac |= E1000_ICR_OTHER_CAUSES;
- }
-
core->mac[ICR] &= ~effective_eiac;
if (!(core->mac[CTRL_EXT] & E1000_CTRL_EXT_IAME)) {
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PULL 4/4] vhost-user: delete net client if necessary
2018-06-15 3:01 [Qemu-devel] [PULL 0/4] Net patches Jason Wang
` (2 preceding siblings ...)
2018-06-15 3:01 ` [Qemu-devel] [PULL 3/4] e1000e: Do not auto-clear ICR bits which aren't set in EIAC Jason Wang
@ 2018-06-15 3:01 ` Jason Wang
2018-06-15 11:49 ` [Qemu-devel] [PULL 0/4] Net patches Peter Maydell
4 siblings, 0 replies; 6+ messages in thread
From: Jason Wang @ 2018-06-15 3:01 UTC (permalink / raw)
To: qemu-devel, peter.maydell; +Cc: linzhecheng, qemu-stable, Jason Wang
From: linzhecheng <linzhecheng@huawei.com>
As qemu_new_net_client create new ncs but error happens later,
ncs will be left in global net_clients list and we can't use them any
more, so we need to cleanup them.
Cc: qemu-stable@nongnu.org
Signed-off-by: linzhecheng <linzhecheng@huawei.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
net/vhost-user.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/vhost-user.c b/net/vhost-user.c
index 608b837..a39f9c9 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -345,6 +345,9 @@ err:
s->vhost_user = NULL;
}
}
+ if (nc0) {
+ qemu_del_net_client(nc0);
+ }
return -1;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PULL 0/4] Net patches
2018-06-15 3:01 [Qemu-devel] [PULL 0/4] Net patches Jason Wang
` (3 preceding siblings ...)
2018-06-15 3:01 ` [Qemu-devel] [PULL 4/4] vhost-user: delete net client if necessary Jason Wang
@ 2018-06-15 11:49 ` Peter Maydell
4 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2018-06-15 11:49 UTC (permalink / raw)
To: Jason Wang; +Cc: QEMU Developers
On 15 June 2018 at 04:01, Jason Wang <jasowang@redhat.com> wrote:
> The following changes since commit 409c241f887a38bb7a2ac12e34d3a8d73922a9a5:
>
> Merge remote-tracking branch 'remotes/kraxel/tags/ui-20180614-pull-request' into staging (2018-06-14 14:04:14 +0100)
>
> are available in the git repository at:
>
> https://github.com/jasowang/qemu.git tags/net-pull-request
>
> for you to fetch changes up to c67daf4a24442d1bb404a11a6a54dc45ea10f234:
>
> vhost-user: delete net client if necessary (2018-06-15 10:39:53 +0800)
>
> ----------------------------------------------------------------
>
> ----------------------------------------------------------------
Applied, thanks.
-- PMM
^ permalink raw reply [flat|nested] 6+ messages in thread