summaryrefslogtreecommitdiff
path: root/service/include
diff options
context:
space:
mode:
author童宗振 <[email protected]>2024-08-06 02:13:16 +0000
committer童宗振 <[email protected]>2024-08-06 02:13:16 +0000
commite279579397030323cb451cba23660ac823b3fab0 (patch)
tree3687f0df72b291dbed01bb7e26d5cb3c6d8d5a10 /service/include
parentcb4c34cf1904910b622b36454f378630e11731b3 (diff)
Build in aarch64
Diffstat (limited to 'service/include')
-rw-r--r--service/include/sc_node_common.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/service/include/sc_node_common.h b/service/include/sc_node_common.h
index 7e672d1..13c234b 100644
--- a/service/include/sc_node_common.h
+++ b/service/include/sc_node_common.h
@@ -64,6 +64,7 @@ struct mr_generic_ip_hdr
void forwarder_table_insert(uint16_t sid, uint16_t type);
+#if defined(__x86_64__)
static inline void swap_mac_addr(struct rte_ether_hdr * eth_hdr)
{
/* swap eth_hdr */
@@ -72,6 +73,15 @@ static inline void swap_mac_addr(struct rte_ether_hdr * eth_hdr)
mac_addr = _mm_shuffle_epi8(mac_addr, mac_shfl_msk);
_mm_storeu_si128((__m128i *)eth_hdr, mac_addr);
}
+#elif defined(__aarch64__)
+static inline void swap_mac_addr(struct rte_ether_hdr * eth_hdr)
+{
+ struct rte_ether_addr tmp_addr;
+ rte_ether_addr_copy(&eth_hdr->dst_addr, &tmp_addr);
+ rte_ether_addr_copy(&eth_hdr->src_addr, &eth_hdr->dst_addr);
+ rte_ether_addr_copy(&tmp_addr, &eth_hdr->src_addr);
+}
+#endif
static inline int mr_is_local_addr_for_trunk(struct mr_dev_desc * dev_desc, uint16_t vlan_id,
struct mr_generic_ip_hdr * ip_hdr)