From: Zhang Chen <chen.zhang@intel.com>
To: Jason Wang <jasowang@redhat.com>, qemu-dev <qemu-devel@nongnu.org>
Cc: Zhang Chen <chen.zhang@intel.com>,
Lukas Straub <lukasstraub2@web.de>,
Zhang Chen <zhangckid@gmail.com>
Subject: [PULL 2/2] net/colo-compare.c: Optimize removal of secondary packet
Date: Thu, 18 Mar 2021 12:11:52 +0800 [thread overview]
Message-ID: <20210318041152.59367-3-chen.zhang@intel.com> (raw)
In-Reply-To: <20210318041152.59367-1-chen.zhang@intel.com>
From: Lukas Straub <lukasstraub2@web.de>
g_queue_remove needs to look up the list entry first, but we
already have it as result and can remove it directly with
g_queue_delete_link.
Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Signed-off-by: Zhang Chen <chen.zhang@intel.com>
Reviewed-by: Zhang Chen <chen.zhang@intel.com>
---
net/colo-compare.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/colo-compare.c b/net/colo-compare.c
index 2e819ffedb..9d1ad99941 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -691,7 +691,7 @@ static void colo_compare_packet(CompareState *s, Connection *conn,
if (result) {
colo_release_primary_pkt(s, pkt);
packet_destroy(result->data, NULL);
- g_queue_remove(&conn->secondary_list, result->data);
+ g_queue_delete_link(&conn->secondary_list, result);
} else {
/*
* If one packet arrive late, the secondary_list or
--
2.25.1
next prev parent reply other threads:[~2021-03-18 4:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-18 4:11 [PULL 0/2] 2021-03-18 COLO proxy patches Zhang Chen
2021-03-18 4:11 ` [PULL 1/2] net/colo-compare.c: Fix memory leak for non-tcp packet Zhang Chen
2021-03-18 4:11 ` Zhang Chen [this message]
2021-03-19 7:00 ` [PULL 0/2] 2021-03-18 COLO proxy patches Jason Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210318041152.59367-3-chen.zhang@intel.com \
--to=chen.zhang@intel.com \
--cc=jasowang@redhat.com \
--cc=lukasstraub2@web.de \
--cc=qemu-devel@nongnu.org \
--cc=zhangckid@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).