xdping.c (c95baf12f5077419db01313ab61c2aac007d40cd) xdping.c (8fffa0e3451abdd84e4b4e427f7e66040eb24f43)
1// SPDX-License-Identifier: GPL-2.0
2/* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. */
3
4#include <linux/bpf.h>
5#include <linux/if_link.h>
6#include <arpa/inet.h>
7#include <assert.h>
8#include <errno.h>

--- 164 unchanged lines hidden (view full) ---

173
174 snprintf(filename, sizeof(filename), "%s_kern.o", argv[0]);
175
176 if (bpf_prog_load(filename, BPF_PROG_TYPE_XDP, &obj, &prog_fd)) {
177 fprintf(stderr, "load of %s failed\n", filename);
178 return 1;
179 }
180
1// SPDX-License-Identifier: GPL-2.0
2/* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. */
3
4#include <linux/bpf.h>
5#include <linux/if_link.h>
6#include <arpa/inet.h>
7#include <assert.h>
8#include <errno.h>

--- 164 unchanged lines hidden (view full) ---

173
174 snprintf(filename, sizeof(filename), "%s_kern.o", argv[0]);
175
176 if (bpf_prog_load(filename, BPF_PROG_TYPE_XDP, &obj, &prog_fd)) {
177 fprintf(stderr, "load of %s failed\n", filename);
178 return 1;
179 }
180
181 main_prog = bpf_object__find_program_by_title(obj,
182 server ? "xdpserver" :
183 "xdpclient");
181 main_prog = bpf_object__find_program_by_name(obj,
182 server ? "xdping_server" : "xdping_client");
184 if (main_prog)
185 prog_fd = bpf_program__fd(main_prog);
186 if (!main_prog || prog_fd < 0) {
187 fprintf(stderr, "could not find xdping program");
188 return 1;
189 }
190
191 map = bpf_map__next(NULL, obj);

--- 67 unchanged lines hidden ---
183 if (main_prog)
184 prog_fd = bpf_program__fd(main_prog);
185 if (!main_prog || prog_fd < 0) {
186 fprintf(stderr, "could not find xdping program");
187 return 1;
188 }
189
190 map = bpf_map__next(NULL, obj);

--- 67 unchanged lines hidden ---