Skip to contentSkip to conversation

Net patches

GIT PULL Applied Jason Wang 2 participants 6 messages Jun 15, 2018 Networking

lore
Share & tools
lore

Jason Wang

author
#0 lore raw

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)

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

----------------------------------------------------------------
Brijesh Singh (1):
tap: set vhostfd passed from qemu cli to non-blocking

Jan Kiszka (1):
e1000e: Do not auto-clear ICR bits which aren't set in EIAC

Lin Ma (1):
net: Fix a potential segfault

linzhecheng (1):
vhost-user: delete net client if necessary

 hw/net/e1000e_core.c | 4 ----
 net/net.c            | 4 +++-
 net/tap.c            | 2 ++
 net/vhost-user.c     | 3 +++
 4 files changed, 8 insertions(+), 5 deletions(-)
author
#1 lore raw

[Qemu-devel] [PULL 1/4] tap: set vhostfd passed from qemu cli to non-blocking

From: Brijesh Singh <[email protected]>

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 Michael S. Tsirkin <[email protected]>
Cc Jason Wang <[email protected]>
---
 net/tap.c | 2 ++
 1 file changed, 2 insertions(+)
net/tap.c +2 -0
index de05f20..2126f48 100644
@@ -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) {
Signature · 1 line
2.7.4
author
#2 lore raw

[Qemu-devel] [PULL 2/4] net: Fix a potential segfault

In reply to Jason Wang

From: Lin Ma <[email protected]>

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")
---
 net/net.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
net/net.c +3 -1
index efb9eaf..2a31339 100644
@@ -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 {
Signature · 1 line
2.7.4
author
#3 lore raw

[Qemu-devel] [PULL 3/4] e1000e: Do not auto-clear ICR bits which aren't set in EIAC

In reply to Jason Wang

From: Jan Kiszka <[email protected]>

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").

---
 hw/net/e1000e_core.c | 4 ----
 1 file changed, 4 deletions(-)
hw/net/e1000e_core.c +0 -4
index c93c466..9504891 100644
@@ -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)) {
Signature · 1 line
2.7.4
author
#4 lore raw

[Qemu-devel] [PULL 4/4] vhost-user: delete net client if necessary

In reply to Jason Wang

From: linzhecheng <[email protected]>

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.

---
 net/vhost-user.c | 3 +++
 1 file changed, 3 insertions(+)
net/vhost-user.c +3 -0
index 608b837..a39f9c9 100644
@@ -345,6 +345,9 @@ err:
             s->vhost_user = NULL;
         }
     }
+    if (nc0) {
+        qemu_del_net_client(nc0);
+    }
 
     return -1;
 }
Signature · 1 line
2.7.4
#5 lore raw
In reply to Jason Wang
Quoted 8 lines · Jason Wang

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

Quoted 7 lines

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