All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL V3 0/3] Net patches
@ 2016-11-15  7:43 Jason Wang
  2016-11-15  7:43 ` [Qemu-devel] [PULL V3 1/3] net: skip virtio-net config of deleted nic's peers Jason Wang
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jason Wang @ 2016-11-15  7:43 UTC (permalink / raw)
  To: peter.maydell, stefanha; +Cc: qemu-devel, 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

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(-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PULL V3 1/3] net: skip virtio-net config of deleted nic's peers
  2016-11-15  7:43 [Qemu-devel] [PULL V3 0/3] Net patches Jason Wang
@ 2016-11-15  7:43 ` Jason Wang
  2016-11-15  7:43 ` [Qemu-devel] [PULL V3 2/3] net: fix sending of data with -net socket, listen backend Jason Wang
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Jason Wang @ 2016-11-15  7:43 UTC (permalink / raw)
  To: peter.maydell, stefanha; +Cc: qemu-devel, Yuri Benditovich, Jason Wang

From: Yuri Benditovich <yuri.benditovich@daynix.com>

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.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/net/virtio-net.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 06bfe4b..77a4fae 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -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);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PULL V3 2/3] net: fix sending of data with -net socket, listen backend
  2016-11-15  7:43 [Qemu-devel] [PULL V3 0/3] Net patches Jason Wang
  2016-11-15  7:43 ` [Qemu-devel] [PULL V3 1/3] net: skip virtio-net config of deleted nic's peers Jason Wang
@ 2016-11-15  7:43 ` Jason Wang
  2016-11-15  7:43 ` [Qemu-devel] [PULL V3 3/3] docs: fix COLO architecture diagram Jason Wang
  2016-11-15 11:23 ` [Qemu-devel] [PULL V3 0/3] Net patches Stefan Hajnoczi
  3 siblings, 0 replies; 5+ messages in thread
From: Jason Wang @ 2016-11-15  7:43 UTC (permalink / raw)
  To: peter.maydell, stefanha; +Cc: qemu-devel, Daniel P. Berrange, Jason Wang

From: "Daniel P. Berrange" <berrange@redhat.com>

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

  commit 16a3df403b10c4ac347159e39005fd520b2648bb
  Author: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
  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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 net/net.c    | 5 ++---
 net/socket.c | 1 +
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/net.c b/net/net.c
index ec984bf..939fe31 100644
--- a/net/net.c
+++ b/net/net.c
@@ -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;
         }
diff --git a/net/socket.c b/net/socket.c
index 982c8de..fe3547b 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -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);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PULL V3 3/3] docs: fix COLO architecture diagram
  2016-11-15  7:43 [Qemu-devel] [PULL V3 0/3] Net patches Jason Wang
  2016-11-15  7:43 ` [Qemu-devel] [PULL V3 1/3] net: skip virtio-net config of deleted nic's peers Jason Wang
  2016-11-15  7:43 ` [Qemu-devel] [PULL V3 2/3] net: fix sending of data with -net socket, listen backend Jason Wang
@ 2016-11-15  7:43 ` Jason Wang
  2016-11-15 11:23 ` [Qemu-devel] [PULL V3 0/3] Net patches Stefan Hajnoczi
  3 siblings, 0 replies; 5+ messages in thread
From: Jason Wang @ 2016-11-15  7:43 UTC (permalink / raw)
  To: peter.maydell, stefanha; +Cc: qemu-devel, Zhang Chen, Jason Wang

From: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>

Fix COLO-Proxy part of COLO architecture diagram

Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
Reviewed-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 docs/COLO-FT.txt | 72 +++++++++++++++++++++++++++++---------------------------
 1 file changed, 37 insertions(+), 35 deletions(-)

diff --git a/docs/COLO-FT.txt b/docs/COLO-FT.txt
index 6282938..e289be2 100644
--- a/docs/COLO-FT.txt
+++ b/docs/COLO-FT.txt
@@ -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 ==
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PULL V3 0/3] Net patches
  2016-11-15  7:43 [Qemu-devel] [PULL V3 0/3] Net patches Jason Wang
                   ` (2 preceding siblings ...)
  2016-11-15  7:43 ` [Qemu-devel] [PULL V3 3/3] docs: fix COLO architecture diagram Jason Wang
@ 2016-11-15 11:23 ` Stefan Hajnoczi
  3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2016-11-15 11:23 UTC (permalink / raw)
  To: Jason Wang; +Cc: peter.maydell, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1439 bytes --]

On Tue, Nov 15, 2016 at 03:43:47PM +0800, Jason Wang wrote:
> 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(-)
> 

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

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-11-15 11:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-15  7:43 [Qemu-devel] [PULL V3 0/3] Net patches Jason Wang
2016-11-15  7:43 ` [Qemu-devel] [PULL V3 1/3] net: skip virtio-net config of deleted nic's peers Jason Wang
2016-11-15  7:43 ` [Qemu-devel] [PULL V3 2/3] net: fix sending of data with -net socket, listen backend Jason Wang
2016-11-15  7:43 ` [Qemu-devel] [PULL V3 3/3] docs: fix COLO architecture diagram Jason Wang
2016-11-15 11:23 ` [Qemu-devel] [PULL V3 0/3] Net patches Stefan Hajnoczi

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.