]>
git.proxmox.com Git - ceph.git/blob - ceph/src/spdk/dpdk/examples/tep_termination/vxlan.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2015 Intel Corporation
11 #define PORT_MIN 49152
12 #define PORT_MAX 65535
13 #define PORT_RANGE ((PORT_MAX - PORT_MIN) + 1)
15 #define VXLAN_N_PORTS 2
16 #define VXLAN_HF_VNI 0x08000000
17 #define DEFAULT_VXLAN_PORT 4789
19 extern struct ipv4_hdr app_ip_hdr
[VXLAN_N_PORTS
];
20 extern struct ether_hdr app_l2_hdr
[VXLAN_N_PORTS
];
21 extern uint8_t tx_checksum
;
22 extern uint16_t tso_segsz
;
25 uint32_t vport_id
; /**< VirtIO port id */
26 uint32_t peer_ip
; /**< remote VTEP IP address */
27 struct ether_addr peer_mac
; /**< remote VTEP MAC address */
28 struct ether_addr vport_mac
; /**< VirtIO port MAC address */
29 } __rte_cache_aligned
;
32 uint16_t dst_port
; /**< VXLAN UDP destination port */
33 uint32_t port_ip
; /**< DPDK port IP address*/
34 uint32_t in_key
; /**< VLAN ID */
35 uint32_t out_key
; /**< VXLAN VNI */
36 struct vxlan_port port
[VXLAN_N_PORTS
]; /**< VXLAN configuration */
37 } __rte_cache_aligned
;
39 extern struct vxlan_conf vxdev
;
41 /* structure that caches offload info for the current packet */
42 union tunnel_offload_info
{
45 uint64_t l2_len
:7; /**< L2 (MAC) Header Length. */
46 uint64_t l3_len
:9; /**< L3 (IP) Header Length. */
47 uint64_t l4_len
:8; /**< L4 Header Length. */
48 uint64_t tso_segsz
:16; /**< TCP TSO segment size */
49 uint64_t outer_l2_len
:7; /**< outer L2 Header Length */
50 uint64_t outer_l3_len
:16; /**< outer L3 Header Length */
52 } __rte_cache_aligned
;
54 int decapsulation(struct rte_mbuf
*pkt
);
55 void encapsulation(struct rte_mbuf
*m
, uint8_t queue_id
);
57 #endif /* _VXLAN_H_ */