aboutsummaryrefslogtreecommitdiffstats
path: root/resources/api
AgeCommit message (Collapse)AuthorFilesLines
2020-03-03Update CRC values for 1908_1Vratko Polak1-22/+20
We did not have crc job for 1908. Now we want one, so this squashes the neglected CRC updates. - The last patch set with wrong CRC values. Change-Id: I9730d7c3953e87a4845aaecde8fd93a3be34bce3 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2019-08-07CSIT-1473: Migrate Tap library from VAT to PAPIJan Gelety1-0/+4
Change-Id: Ibf4a4839c2e8b799b03eebd9dffae891d8f00dd4 Signed-off-by: Jan Gelety <jgelety@cisco.com>
2019-08-07Expand comment on API covering triggersVratko Polak1-1/+4
GBP tests were added, they are only covered by 2n perf test. Several tags used in the tag expression to proof against future suites. Change-Id: I9facd8c72b41284b6b838e99ce9d38047aa68f40 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2019-08-06Add: Dot1Q + L2BD + GBPPeter Mikus1-0/+14
Change-Id: I0050f715011ecfa92b3ee88b301809a56abb7946 Signed-off-by: Peter Mikus <pmikus@cisco.com>
2019-08-05Fix CRCs, bump stable VPP versionVratko Polak1-0/+185
+ Migrate the data to a separate yaml file. + Improve some argument names. + Unify handling of unicode (to always utf-8 encode to str). Change-Id: Id0622b24202be796c1cd33ad52c3b8dca81cff50 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
its affiliates. */ #include <linux/bpf.h> #include <linux/in.h> #include <linux/if_ether.h> #include <linux/ip.h> #include <linux/udp.h> #include <bpf/bpf_helpers.h> /* * when compiled, debug print can be viewed with eg. * sudo cat /sys/kernel/debug/tracing/trace_pipe */ #ifdef DEBUG #define s__(n) # n #define s_(n) s__(n) #define x_(fmt) __FILE__ ":" s_(__LINE__) ": " fmt "\n" #define DEBUG_PRINT_(fmt, ...) do { \ const char fmt__[] = fmt; \ bpf_trace_printk(fmt__, sizeof(fmt), ## __VA_ARGS__); } while(0) #define DEBUG_PRINT(fmt, ...) DEBUG_PRINT_ (x_(fmt), ## __VA_ARGS__) #else /* DEBUG */ #define DEBUG_PRINT(fmt, ...) #endif /* DEBUG */ #define ntohs(x) __constant_ntohs(x) SEC("maps") struct bpf_map_def xsks_map = { .type = BPF_MAP_TYPE_XSKMAP, .key_size = sizeof(int), .value_size = sizeof(int), .max_entries = 64, /* max 64 queues per device */ }; SEC("xdp_sock") int xdp_sock_prog(struct xdp_md *ctx) { const void *data = (void *)(long)ctx->data; const void *data_end = (void *)(long)ctx->data_end; DEBUG_PRINT("rx %ld bytes packet", (long)data_end - (long)data); /* smallest packet we are interesting in is ip-ip */ if (data + sizeof(struct ethhdr) + 2 * sizeof(struct iphdr) > data_end) { DEBUG_PRINT("packet too small"); return XDP_PASS; } const struct ethhdr *eth = data; if (eth->h_proto != ntohs(ETH_P_IP)) { DEBUG_PRINT("unsupported eth proto %x", (int)eth->h_proto); return XDP_PASS; } const struct iphdr *ip = (void *)(eth + 1); switch (ip->protocol) { case IPPROTO_UDP: { const struct udphdr *udp = (void *)(ip + 1); if (udp->dest != ntohs(4789)) { /* VxLAN dest port */ DEBUG_PRINT("unsupported udp dst port %x", (int)udp->dest); return XDP_PASS; } } case IPPROTO_IPIP: case IPPROTO_ESP: break; default: DEBUG_PRINT("unsupported ip proto %x", (int)ip->protocol); return XDP_PASS; } int qid = ctx->rx_queue_index; if (!bpf_map_lookup_elem(&xsks_map, &qid)) { DEBUG_PRINT("no socket found"); return XDP_PASS; } DEBUG_PRINT("going to socket %d", qid); return bpf_redirect_map(&xsks_map, qid, 0); } /* actually Dual GPLv2/Apache2, but GPLv2 as far as kernel is concerned */ SEC("license") char _license[] = "GPL";