From 7755b72b475fdb5fbd75f51cfb8dfd4a49b70852 Mon Sep 17 00:00:00 2001
From: hantwofish <hankangkang5@huawei.com>
Date: Mon, 24 Jun 2024 15:26:31 +0800
Subject: [PATCH] solve complie err in 20.03 RTE_ETHER_ADDR_PRT_FMT
 RTE_ETHER_ADDR_BYTES are defined in dpdk 21.11

---
 src/lstack/include/lstack_virtio.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/lstack/include/lstack_virtio.h b/src/lstack/include/lstack_virtio.h
index 5e001ca..d40c754 100644
--- a/src/lstack/include/lstack_virtio.h
+++ b/src/lstack/include/lstack_virtio.h
@@ -15,6 +15,21 @@
 #include <stdint.h>
 
 #define VIRTIO_MAX_QUEUE_NUM 8
+
+// RTE_ETHER_ADDR_PRT_FMT RTE_ETHER_ADDR_BYTES are defined in dpdk 21.11
+#ifndef RTE_ETHER_ADDR_PRT_FMT
+#define RTE_ETHER_ADDR_PRT_FMT     "%02X:%02X:%02X:%02X:%02X:%02X"
+#endif
+
+#ifndef RTE_ETHER_ADDR_BYTES
+#define RTE_ETHER_ADDR_BYTES(mac_addrs) ((mac_addrs)->addr_bytes[0]), \
+                                        ((mac_addrs)->addr_bytes[1]), \
+                                        ((mac_addrs)->addr_bytes[2]), \
+                                        ((mac_addrs)->addr_bytes[3]), \
+                                        ((mac_addrs)->addr_bytes[4]), \
+                                        ((mac_addrs)->addr_bytes[5])
+#endif
+
 struct virtio_instance {
     uint16_t lstack_port_id;
     uint16_t virtio_port_id;
-- 
2.33.0

