NDN-DPDK
High-Speed Named Data Networking Forwarder
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
xdp-locator.h
Go to the documentation of this file.
1 #ifndef NDNDPDK_ETHFACE_XDP_LOCATOR_H
2 #define NDNDPDK_ETHFACE_XDP_LOCATOR_H
3 
6 #ifdef __BPF__
7 // disable asm instructions
8 #define RTE_FORCE_INTRINSICS
9 #endif
10 
11 #include "../core/common.h"
12 #include <rte_gtp.h>
13 
19 typedef struct EthXdpLocator {
20  union {
21  struct {
22  uint8_t vni[3];
23  uint8_t rsvd1;
24  uint8_t inner[2 * 6];
25  } vx;
26  struct {
27  uint32_t teid;
28  uint8_t qfi;
29  } gtp;
30  };
31  uint16_t vlan;
32  uint16_t udpSrc;
33  uint16_t udpDst;
34  uint8_t ether[2 * 6];
35  uint8_t ip[2 * 16];
37 
39 typedef struct EthXdpHdr {
40  uint64_t magic;
41  uint32_t fmv;
42  uint16_t hdrLen;
44 
46 typedef struct EthGtpHdr {
47  struct rte_gtp_hdr hdr;
48  struct rte_gtp_hdr_ext_word ext;
49  struct rte_gtp_psc_generic_hdr psc;
50  uint8_t next;
52 
53 enum {
56 };
57 
59 __attribute__((nonnull)) static __rte_always_inline bool
60 EthGtpHdr_IsUplink(const EthGtpHdr* gtp) {
61  return gtp->hdr.e == 1 && gtp->ext.next_ext == EthGtpExtTypePsc && gtp->psc.type == 1;
62 }
63 
64 #ifndef __BPF__
65 
66 typedef struct EthLocator EthLocator;
67 
69 __attribute__((nonnull)) void
71 
72 #endif // __BPF__
73 
74 #endif // NDNDPDK_ETHFACE_XDP_LOCATOR_H
struct vlanhdr __rte_packed
GTP-U header with PDU session container.
Definition: xdp-locator.h:46
struct rte_gtp_psc_generic_hdr psc
Definition: xdp-locator.h:49
struct rte_gtp_hdr_ext_word ext
Definition: xdp-locator.h:48
struct rte_gtp_hdr hdr
Definition: xdp-locator.h:47
uint8_t next
Definition: xdp-locator.h:50
EthFace address information.
Definition: locator.h:10
Overwritten header after matching in XDP program.
Definition: xdp-locator.h:39
uint64_t magic
UINT64_MAX.
Definition: xdp-locator.h:40
uint32_t fmv
face_map value
Definition: xdp-locator.h:41
uint16_t hdrLen
header length
Definition: xdp-locator.h:42
EthFace address matcher in XDP program.
Definition: xdp-locator.h:19
uint16_t udpDst
outer UDP destination port (big endian)
Definition: xdp-locator.h:33
struct EthXdpLocator::@35::@37 vx
uint16_t vlan
VLAN identifier (big endian)
Definition: xdp-locator.h:31
uint8_t ether[2 *6]
outer Ethernet destination and source
Definition: xdp-locator.h:34
uint8_t vni[3]
VXLAN Network Identifier (big endian)
Definition: xdp-locator.h:22
uint8_t ip[2 *16]
outer IPv4/IPv6 source and destination
Definition: xdp-locator.h:35
uint32_t teid
GTPv1U Tunnel Endpoint Identifier (big endian)
Definition: xdp-locator.h:27
struct EthXdpLocator::@35::@38 gtp
uint8_t qfi
GTPv1U QoS Flow Identifier.
Definition: xdp-locator.h:28
uint8_t inner[2 *6]
inner Ethernet destination and source
Definition: xdp-locator.h:24
uint8_t rsvd1
must be zero
Definition: xdp-locator.h:23
uint16_t udpSrc
outer UDP source port (big endian, 0 for VXLAN/GTP)
Definition: xdp-locator.h:32
struct EthXdpLocator EthXdpLocator
EthFace address matcher in XDP program.
struct EthGtpHdr EthGtpHdr
GTP-U header with PDU session container.
void EthXdpLocator_Prepare(EthXdpLocator *xl, const EthLocator *loc)
Prepare XDP locator from locator.
Definition: xdp-locator.c:7
struct EthXdpHdr EthXdpHdr
Overwritten header after matching in XDP program.
@ EthGtpExtTypePsc
Value of EthGtpHdr.ext.next_ext .
Definition: xdp-locator.h:55