qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 2/3] COLO-proxy: Add a tag to mark virtio-net packet


From: Zhang Chen
Subject: [Qemu-devel] [PATCH 2/3] COLO-proxy: Add a tag to mark virtio-net packet
Date: Thu, 16 Mar 2017 17:52:07 +0800

Add this tag that compare can recognize virtio-net packet.

Signed-off-by: Zhang Chen <address@hidden>
---
 net/colo.c | 6 ++++++
 net/colo.h | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/net/colo.c b/net/colo.c
index 060e822..d2b3683 100644
--- a/net/colo.c
+++ b/net/colo.c
@@ -79,6 +79,12 @@ int parse_packet_early(Packet *pkt, int offset)
     }
     pkt->transport_header = pkt->network_header + network_length;
 
+    if (offset == VIRTIO_NET_HEADER) {
+        pkt->is_virtio_net_pkt = true;
+    } else {
+        pkt->is_virtio_net_pkt = false;
+    }
+
     return 0;
 }
 
diff --git a/net/colo.h b/net/colo.h
index b713f87..535793d 100644
--- a/net/colo.h
+++ b/net/colo.h
@@ -46,6 +46,8 @@ typedef struct Packet {
     int size;
     /* Time of packet creation, in wall clock ms */
     int64_t creation_ms;
+    /* Mark this packet as a virtio net packet or not */
+    bool is_virtio_net_pkt;
 } Packet;
 
 typedef struct ConnectionKey {
-- 
2.7.4






reply via email to

[Prev in Thread] Current Thread [Next in Thread]