From: "Zhang, Chen" <chen.zhang@intel.com>
To: Lukas Straub <lukasstraub2@web.de>, qemu-devel <qemu-devel@nongnu.org>
Cc: Jason Wang <jasowang@redhat.com>, Li Zhijian <lizhijian@cn.fujitsu.com>
Subject: RE: [PATCH 2/2] net/colo-compare.c: Optimize removal of secondary packet
Date: Mon, 16 Nov 2020 07:31:35 +0000 [thread overview]
Message-ID: <6c2b63ca96aa420195415028c6b7b40d@intel.com> (raw)
In-Reply-To: <fa4d5eb0bb2ea3f247af5bb7792499cf9cd56a14.1605438886.git.lukasstraub2@web.de>
> -----Original Message-----
> From: Lukas Straub <lukasstraub2@web.de>
> Sent: Sunday, November 15, 2020 7:19 PM
> To: qemu-devel <qemu-devel@nongnu.org>
> Cc: Zhang, Chen <chen.zhang@intel.com>; Li Zhijian
> <lizhijian@cn.fujitsu.com>; Jason Wang <jasowang@redhat.com>
> Subject: [PATCH 2/2] net/colo-compare.c: Optimize removal of secondary
> packet
>
> 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>
Reviewed-by: Zhang Chen <chen.zhang@intel.com>
Thanks
Chen
> ---
> 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
> eed0fbb27b..4e2af8ff00 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.20.1
next prev parent reply other threads:[~2020-11-16 7:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-15 11:18 [PATCH 0/2] colo-compare: Fix memory leak for non-tcp packet Lukas Straub
2020-11-15 11:19 ` [PATCH 1/2] net/colo-compare.c: " Lukas Straub
2020-11-16 7:31 ` Zhang, Chen
2020-11-15 11:19 ` [PATCH 2/2] net/colo-compare.c: Optimize removal of secondary packet Lukas Straub
2020-11-16 7:31 ` Zhang, Chen [this message]
2020-11-16 7:32 ` [PATCH 0/2] colo-compare: Fix memory leak for non-tcp packet Zhang, Chen
2021-03-17 21:23 ` Lukas Straub
2021-03-18 1:22 ` Zhang, Chen
2021-03-18 2:41 ` Jason Wang
2021-03-18 3:26 ` Zhang, Chen
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=6c2b63ca96aa420195415028c6b7b40d@intel.com \
--to=chen.zhang@intel.com \
--cc=jasowang@redhat.com \
--cc=lizhijian@cn.fujitsu.com \
--cc=lukasstraub2@web.de \
--cc=qemu-devel@nongnu.org \
/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).