On 11/16/2017 02:57 AM, Peter Maydell wrote:
On 14 November 2017 at 02:11, Jason Wang <jasow...@redhat.com> wrote:
From: Mao Zhongyi <maozy.f...@cn.fujitsu.com>
A package from pri_indev or sec_indev only belongs to a particular
Connection, so we only need to compare the package in the specified
Connection's primary_list and secondary_list, rather than for each
the whole Connection list to compare. This is time-consuming and
unnecessary.
Less checkpoint more efficiency.
Cc: Zhang Chen <zhangc...@gmail.com>
Cc: Li Zhijian <lizhij...@cn.fujitsu.com>
Cc: Jason Wang <jasow...@redhat.com>
Signed-off-by: Mao Zhongyi <maozy.f...@cn.fujitsu.com>
Signed-off-by: Jason Wang <jasow...@redhat.com>
---
net/colo-compare.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/net/colo-compare.c b/net/colo-compare.c
index 54b6347..5d2429b 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -136,7 +136,7 @@ static int colo_insert_packet(GQueue *queue, Packet *pkt)
* Return 0 on success, if return -1 means the pkt
* is unsupported(arp and ipv6) and will be sent later
*/
-static int packet_enqueue(CompareState *s, int mode)
+static int packet_enqueue(CompareState *s, int mode, Connection **con)
{
ConnectionKey key;
Packet *pkt = NULL;
@@ -179,6 +179,7 @@ static int packet_enqueue(CompareState *s, int mode)
"drop packet");
}
}
+ con = &conn;
return 0;
}
Hi, Peter
Coverity points out that this looks a bit fishy --
presumably you meant
*con = conn;
Well,I will fix it right away.
? The statement you have now doesn't do anything, since
'con' is unused after you change it.
It will be used in colo_compare_connection.
Thanks,
Mao