[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/17] Optimize seq_sorter function for colo-compare
From: |
Jason Wang |
Subject: |
[PULL 03/17] Optimize seq_sorter function for colo-compare |
Date: |
Wed, 11 Nov 2020 21:11:27 +0800 |
From: "Rao, Lei" <lei.rao@intel.com>
The seq of tcp has been filled in fill_pkt_tcp_info, it
can be used directly here.
Signed-off-by: Lei Rao <lei.rao@intel.com>
Signed-off-by: Zhang Chen <chen.zhang@intel.com>
Reviewed-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Reviewed-by: Zhang Chen <chen.zhang@intel.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
net/colo-compare.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/net/colo-compare.c b/net/colo-compare.c
index 3a45d64..a35c10f 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -194,13 +194,10 @@ static void
colo_compare_inconsistency_notify(CompareState *s)
}
}
+/* Use restricted to colo_insert_packet() */
static gint seq_sorter(Packet *a, Packet *b, gpointer data)
{
- struct tcp_hdr *atcp, *btcp;
-
- atcp = (struct tcp_hdr *)(a->transport_header);
- btcp = (struct tcp_hdr *)(b->transport_header);
- return ntohl(atcp->th_seq) - ntohl(btcp->th_seq);
+ return a->tcp_seq - b->tcp_seq;
}
static void fill_pkt_tcp_info(void *data, uint32_t *max_ack)
--
2.7.4
- [PULL 00/17] Net patches, Jason Wang, 2020/11/11
- [PULL 01/17] virtio-net: Set mac address to hardware if the peer is vdpa, Jason Wang, 2020/11/11
- [PULL 02/17] net/filter-rewriter: destroy g_hash_table in colo_rewriter_cleanup, Jason Wang, 2020/11/11
- [PULL 04/17] Reduce the time of checkpoint for COLO, Jason Wang, 2020/11/11
- [PULL 06/17] colo-compare: fix missing compare_seq initialization, Jason Wang, 2020/11/11
- [PULL 07/17] colo-compare: check mark in mutual exclusion, Jason Wang, 2020/11/11
- [PULL 03/17] Optimize seq_sorter function for colo-compare,
Jason Wang <=
- [PULL 05/17] Fix the qemu crash when guest shutdown in COLO mode, Jason Wang, 2020/11/11
- [PULL 08/17] net/colo-compare.c: Fix compare_timeout format issue, Jason Wang, 2020/11/11
- [PULL 09/17] net/colo-compare.c: Change the timer clock type, Jason Wang, 2020/11/11
- [PULL 10/17] net/colo-compare.c: Add secondary old packet detection, Jason Wang, 2020/11/11
- [PULL 11/17] net/colo-compare.c: Increase default queued packet scan frequency, Jason Wang, 2020/11/11
- [PULL 13/17] net/l2tpv3: Remove redundant check in net_init_l2tpv3(), Jason Wang, 2020/11/11
- [PULL 12/17] net: remove an assert call in eth_get_gso_type, Jason Wang, 2020/11/11
- [PULL 14/17] hw/net/can/ctucan: Don't allow guest to write off end of tx_buffer, Jason Wang, 2020/11/11
- [PULL 15/17] hw/net/can/ctucan: Avoid unused value in ctucan_send_ready_buffers(), Jason Wang, 2020/11/11
- [PULL 16/17] hw/net/can/ctucan_core: Handle big-endian hosts, Jason Wang, 2020/11/11