Add edt_pacer01 only containing dummy tc program.

Want to make sure make system works and I can test load this prog.

Signed-off-by: Jesper Dangaard Brouer <netoptimizer@brouer.com>
This commit is contained in:
Jesper Dangaard Brouer
2020-11-08 11:41:10 +01:00
committed by Jesper Dangaard Brouer
parent f4846b8297
commit 3ef00744da
2 changed files with 30 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
USER_TARGETS :=
BPF_TARGETS := pacer01
BPF_TARGETS := edt_pacer01
LIB_DIR = ../lib
@@ -14,7 +14,7 @@ include $(LIB_DIR)/common.mk
# creating maps
#
.PHONY: strip_tc_obj
strip_tc_obj: ${BPF_TARGETS :=.o}
strip_tc_obj: ${BPF_TARGETS:=.o}
$(Q) llvm-strip --no-strip-all --remove-section .BTF $?
all: strip_tc_obj

View File

@@ -0,0 +1,28 @@
#include <linux/bpf.h>
#include <bpf/bpf_helpers.h>
#include <xdp/parsing_helpers.h>
char _license[] SEC("license") = "GPL";
SEC("classifier") int tc_dummy(struct __sk_buff *skb)
{
volatile void *data, *data_end;
int ret = BPF_OK;
struct ethhdr *eth;
data = (void *)(long)skb->data;
data_end = (void *)(long)skb->data_end;
eth = (struct ethhdr *)data;
if (data + sizeof(*eth) > data_end)
return BPF_DROP;
/* Keep ARP resolution working */
if (eth->h_proto == bpf_htons(ETH_P_ARP)) {
ret = BPF_OK;
goto out;
}
out:
return ret;
}