Skip to contentSkip to conversation

Net patches

GIT PULL Applied Jason Wang 2 participants 5 messages Nov 15, 2016

Subsystems (2)
lore
Share & tools
lore

Jason Wang

author
#0 lore raw

The following changes since commit 682df581c65ed2c1b9e77093e332214ecaa1ee93:

Merge remote-tracking branch 'jsnow/tags/ide-pull-request' into staging (2016-11-14 17:07:16 +0000)

are available in the git repository at:

https://github.com/jasowang/qemu.git tags/net-pull-request

for you to fetch changes up to a38299bf431a891c0a21a77199e7148c0983413e:

docs: fix COLO architecture diagram (2016-11-15 15:36:21 +0800)

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

Changes from V1:
- no change, V1 misses the list
Changes from V2:
- drop record/replay network support
- add a new patch that fixes the COLO proxy parts in the doc

----------------------------------------------------------------
Daniel P. Berrange (1):
net: fix sending of data with -net socket, listen backend

Yuri Benditovich (1):
net: skip virtio-net config of deleted nic's peers

Zhang Chen (1):
docs: fix COLO architecture diagram

 docs/COLO-FT.txt    | 72 +++++++++++++++++++++++++++--------------------------
 hw/net/virtio-net.c |  4 +++
 net/net.c           |  5 ++--
 net/socket.c        |  1 +
 4 files changed, 44 insertions(+), 38 deletions(-)
author
#1 lore raw

[Qemu-devel] [PULL V3 1/3] net: skip virtio-net config of deleted nic's peers

From: Yuri Benditovich <[email protected]>

https://bugzilla.redhat.com/show_bug.cgi?id=1373816
qemu core dump happens during repetitive unpug-plug with multiple queues and Windows RSS-capable guest. If back-end delete requested during virtio-net device initialization, driver still can try configure the device for multiple queues. The virtio-net device is expected to be removed as soon as the initialization is done.

---
 hw/net/virtio-net.c | 4 ++++
 1 file changed, 4 insertions(+)
hw/net/virtio-net.c +4 -0
index 06bfe4b..77a4fae 100644
@@ -508,6 +508,10 @@ static void virtio_net_set_queues(VirtIONet *n)
     int i;
     int r;
 
+    if (n->nic->peer_deleted) {
+        return;
+    }
+
     for (i = 0; i < n->max_queues; i++) {
         if (i < n->curr_queues) {
             r = peer_attach(n, i);
Signature · 1 line
2.7.4
author
#2 lore raw

[Qemu-devel] [PULL V3 2/3] net: fix sending of data with -net socket, listen backend

In reply to Jason Wang

From: "Daniel P. Berrange" <[email protected]>

The use of -net socket,listen was broken in the following commit

commit 16a3df403b10c4ac347159e39005fd520b2648bb
Author: Zhang Chen <[email protected]>
Date: Fri May 13 15:35:19 2016 +0800

net/net: Add SocketReadState for reuse codes

This function is from net/socket.c, move it to net.c and net.h. Add SocketReadState to make others reuse net_fill_rstate(). suggestion from jason.

This refactored the state out of NetSocketState into a separate SocketReadState. This refactoring requires that a callback is provided to be triggered upon completion of a packet receive from the guest.

The patch only registered this callback in the codepaths hit by -net socket,connect, not -net socket,listen. So as a result packets sent by the guest in the latter case get dropped on the floor.

This bug is hidden because net_fill_rstate() silently does nothing if the callback is not set.

This patch adds in the middle callback registration and also adds an assert so that QEMU aborts if there are any other codepaths hit which are missing the callback.

---
 net/net.c    | 5 ++---
 net/socket.c | 1 +
 2 files changed, 3 insertions(+), 3 deletions(-)
net/net.c +2 -3
index ec984bf..939fe31 100644
@@ -1653,9 +1653,8 @@ int net_fill_rstate(SocketReadState *rs, const uint8_t *buf, int size)
             if (rs->index >= rs->packet_len) {
                 rs->index = 0;
                 rs->state = 0;
-                if (rs->finalize) {
-                    rs->finalize(rs);
-                }
+                assert(rs->finalize);
+                rs->finalize(rs);
             }
             break;
         }
net/socket.c +1 -0
index 982c8de..fe3547b 100644
@@ -511,6 +511,7 @@ static int net_socket_listen_init(NetClientState *peer,
     s->fd = -1;
     s->listen_fd = ret;
     s->nc.link_down = true;
+    net_socket_rs_init(&s->rs, net_socket_rs_finalize);
 
     qemu_set_fd_handler(s->listen_fd, net_socket_accept, NULL, s);
     qapi_free_SocketAddress(saddr);
Signature · 1 line
2.7.4
author
#3 lore raw

[Qemu-devel] [PULL V3 3/3] docs: fix COLO architecture diagram

In reply to Jason Wang

From: Zhang Chen <[email protected]>

Fix COLO-Proxy part of COLO architecture diagram

---
 docs/COLO-FT.txt | 72 +++++++++++++++++++++++++++++---------------------------
 1 file changed, 37 insertions(+), 35 deletions(-)
docs/COLO-FT.txt +37 -35
index 6282938..e289be2 100644
@@ -41,41 +41,43 @@ identical responses to all client requests. Once the differences in the outputs
 are detected between the PVM and SVM, COLO withholds transmission of the
 outbound packets until it has successfully synchronized the PVM state to the SVM.
 
-   Primary Node                                                            Secondary Node
- +------------+  +-----------------------+       +------------------------+  +------------+
- |            |  |       HeartBeat       |<----->|       HeartBeat        |  |            |
- | Primary VM |  +-----------|-----------+       +-----------|------------+  |Secondary VM|
- |            |              |                               |               |            |
- |            |  +-----------|-----------+       +-----------|------------+  |            |
- |            |  |QEMU   +---v----+      |       |QEMU  +----v---+        |  |            |
- |            |  |       |Failover|      |       |      |Failover|        |  |            |
- |            |  |       +--------+      |       |      +--------+        |  |            |
- |            |  |   +---------------+   |       |   +---------------+    |  |            |
- |            |  |   | VM Checkpoint |-------------->| VM Checkpoint |    |  |            |
- |            |  |   +---------------+   |       |   +---------------+    |  |            |
- |            |  |                       |       |                        |  |            |
- |Requests<---------------------------^------------------------------------------>Requests|
- |Responses----------------------\ /--|--------------\  /------------------------Responses|
- |            |  |               | |  |  |       |   |  |                 |  |            |
- |            |  | +-----------+ | |  |  |       |   |  |  +------------+ |  |            |
- |            |  | | COLO disk | | |  |  |       |   |  |  | COLO disk  | |  |            |
- |            |  | |   Manager |-|-|--|--------------|--|->| Manager    | |  |            |
- |            |  | +|----------+ | |  |  |       |   |  |  +-----------|+ |  |            |
- |            |  |  |            | |  |  |       |   |  |              |  |  |            |
- +------------+  +--|------------|-|--|--+       +---|--|--------------|--+  +------------+
-                    |            | |  |              |  |              |
- +-------------+    | +----------v-v--|--+       +---|--v-----------+  |    +-------------+
- |  VM Monitor |    | |  COLO Proxy      |       |    COLO Proxy    |  |    | VM Monitor  |
- |             |    | |(compare packet)  |       | (adjust sequence)|  |    |             |
- +-------------+    | +----------|----^--+       +------------------+  |    +-------------+
-                    |            |    |                                |
- +------------------|------------|----|--+       +---------------------|------------------+
- |   Kernel         |            |    |  |       |   Kernel            |                  |
- +------------------|------------|----|--+       +---------------------|------------------+
-                    |            |    |                                |
-     +--------------v+  +--------v----|--+       +------------------+ +v-------------+
-     |   Storage     |  |External Network|       | External Network | |   Storage    |
-     +---------------+  +----------------+       +------------------+ +--------------+
+  Primary Node                                                            Secondary Node
++------------+  +-----------------------+       +------------------------+  +------------+
+|            |  |       HeartBeat       +<----->+       HeartBeat        |  |            |
+| Primary VM |  +-----------+-----------+       +-----------+------------+  |Secondary VM|
+|            |              |                               |               |            |
+|            |  +-----------|-----------+       +-----------|------------+  |            |
+|            |  |QEMU   +---v----+      |       |QEMU  +----v---+        |  |            |
+|            |  |       |Failover|      |       |      |Failover|        |  |            |
+|            |  |       +--------+      |       |      +--------+        |  |            |
+|            |  |   +---------------+   |       |   +---------------+    |  |            |
+|            |  |   | VM Checkpoint +-------------->+ VM Checkpoint |    |  |            |
+|            |  |   +---------------+   |       |   +---------------+    |  |            |
+|Requests<--------------------------\ /-----------------\ /--------------------->Requests|
+|            |  |                   ^ ^ |       |       | |              |  |            |
+|Responses+---------------------\ /-|-|------------\ /-------------------------+Responses|
+|            |  |               | | | | |       |  | |  | |              |  |            |
+|            |  | +-----------+ | | | | |       |  | |  | | +----------+ |  |            |
+|            |  | | COLO disk | | | | | |       |  | |  | | | COLO disk| |  |            |
+|            |  | |   Manager +---------------------------->| Manager  | |  |            |
+|            |  | ++----------+ v v | | |       |  | v  v | +---------++ |  |            |
+|            |  |  |+-----------+-+-+-++|       | ++-+--+-+---------+ |  |  |            |
+|            |  |  ||   COLO Proxy     ||       | |   COLO Proxy    | |  |  |            |
+|            |  |  || (compare packet  ||       | |(adjust sequence | |  |  |            |
+|            |  |  ||and mirror packet)||       | |    and ACK)     | |  |  |            |
+|            |  |  |+------------+---+-+|       | +-----------------+ |  |  |            |
++------------+  +-----------------------+       +------------------------+  +------------+
++------------+     |             |   |                                |     +------------+
+| VM Monitor |     |             |   |                                |     | VM Monitor |
++------------+     |             |   |                                |     +------------+
++---------------------------------------+       +----------------------------------------+
+|   Kernel         |             |   |  |       |   Kernel            |                  |
++---------------------------------------+       +----------------------------------------+
+                   |             |   |                                |
+    +--------------v+  +---------v---+--+       +------------------+ +v-------------+
+    |   Storage     |  |External Network|       | External Network | |   Storage    |
+    +---------------+  +----------------+       +------------------+ +--------------+
+
 
 == Components introduction ==
 
Signature · 1 line
2.7.4
#4 lore raw
In reply to Jason Wang
Quoted 27 lines · Jason Wang

The following changes since commit 682df581c65ed2c1b9e77093e332214ecaa1ee93:

Merge remote-tracking branch 'jsnow/tags/ide-pull-request' into staging (2016-11-14 17:07:16 +0000)

are available in the git repository at:

https://github.com/jasowang/qemu.git tags/net-pull-request

for you to fetch changes up to a38299bf431a891c0a21a77199e7148c0983413e:

docs: fix COLO architecture diagram (2016-11-15 15:36:21 +0800)

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

Changes from V1:
- no change, V1 misses the list
Changes from V2:
- drop record/replay network support
- add a new patch that fixes the COLO proxy parts in the doc

----------------------------------------------------------------
Daniel P. Berrange (1):
net: fix sending of data with -net socket, listen backend

Yuri Benditovich (1):
net: skip virtio-net config of deleted nic's peers

Quoted 9 lines

Zhang Chen (1):
docs: fix COLO architecture diagram

 docs/COLO-FT.txt    | 72 +++++++++++++++++++++++++++--------------------------
 hw/net/virtio-net.c |  4 +++
 net/net.c           |  5 ++--
 net/socket.c        |  1 +
 4 files changed, 44 insertions(+), 38 deletions(-)

Thanks, applied to my staging tree:
https://github.com/stefanha/qemu/commits/staging

Stefan