/tools/testing/selftests/bpf/prog_tests/ |
D | xdp_metadata.c | 37 struct xsk { struct 47 static int open_xsk(int ifindex, struct xsk *xsk) in open_xsk() argument 66 xsk->umem_area = mmap(NULL, UMEM_SIZE, PROT_READ | PROT_WRITE, mmap_flags, -1, 0); in open_xsk() 67 if (!ASSERT_NEQ(xsk->umem_area, MAP_FAILED, "mmap")) in open_xsk() 70 ret = xsk_umem__create(&xsk->umem, in open_xsk() 71 xsk->umem_area, UMEM_SIZE, in open_xsk() 72 &xsk->fill, in open_xsk() 73 &xsk->comp, in open_xsk() 78 ret = xsk_socket__create(&xsk->socket, ifindex, QUEUE_ID, in open_xsk() 79 xsk->umem, in open_xsk() [all …]
|
/tools/testing/selftests/bpf/ |
D | xdp_hw_metadata.c | 39 struct xsk { struct 50 struct xsk *rx_xsk; argument 57 static int open_xsk(int ifindex, struct xsk *xsk, __u32 queue_id) in open_xsk() argument 76 xsk->umem_area = mmap(NULL, UMEM_SIZE, PROT_READ | PROT_WRITE, mmap_flags, -1, 0); in open_xsk() 77 if (xsk->umem_area == MAP_FAILED) in open_xsk() 80 ret = xsk_umem__create(&xsk->umem, in open_xsk() 81 xsk->umem_area, UMEM_SIZE, in open_xsk() 82 &xsk->fill, in open_xsk() 83 &xsk->comp, in open_xsk() 88 ret = xsk_socket__create(&xsk->socket, ifindex, queue_id, in open_xsk() [all …]
|
D | xsk.c | 97 int xsk_socket__fd(const struct xsk_socket *xsk) in xsk_socket__fd() argument 99 return xsk ? xsk->fd : -EINVAL; in xsk_socket__fd() 445 int xsk_update_xskmap(struct bpf_map *map, struct xsk_socket *xsk) in xsk_update_xskmap() argument 451 sock_fd = xsk_socket__fd(xsk); in xsk_update_xskmap() 500 static struct xsk_ctx *xsk_create_ctx(struct xsk_socket *xsk, in xsk_create_ctx() argument 514 err = xsk_create_umem_rings(umem, xsk->fd, fill, comp); in xsk_create_ctx() 549 struct xsk_socket *xsk; in xsk_socket__create_shared() local 558 xsk = calloc(1, sizeof(*xsk)); in xsk_socket__create_shared() 559 if (!xsk) in xsk_socket__create_shared() 562 err = xsk_set_xdp_socket_config(&xsk->config, usr_config); in xsk_socket__create_shared() [all …]
|
D | xskxceiver.c | 225 static void enable_busy_poll(struct xsk_socket_info *xsk) in enable_busy_poll() argument 230 if (setsockopt(xsk_socket__fd(xsk->xsk), SOL_SOCKET, SO_PREFER_BUSY_POLL, in enable_busy_poll() 235 if (setsockopt(xsk_socket__fd(xsk->xsk), SOL_SOCKET, SO_BUSY_POLL, in enable_busy_poll() 240 if (setsockopt(xsk_socket__fd(xsk->xsk), SOL_SOCKET, SO_BUSY_POLL_BUDGET, in enable_busy_poll() 245 static int __xsk_configure_socket(struct xsk_socket_info *xsk, struct xsk_umem_info *umem, in __xsk_configure_socket() argument 252 xsk->umem = umem; in __xsk_configure_socket() 253 cfg.rx_size = xsk->rxqsize; in __xsk_configure_socket() 261 txr = ifobject->tx_on ? &xsk->tx : NULL; in __xsk_configure_socket() 262 rxr = ifobject->rx_on ? &xsk->rx : NULL; in __xsk_configure_socket() 263 return xsk_socket__create(&xsk->xsk, ifobject->ifindex, 0, umem->umem, rxr, txr, &cfg); in __xsk_configure_socket() [all …]
|
D | xsk.h | 188 int xsk_socket__fd(const struct xsk_socket *xsk); 207 int xsk_update_xskmap(struct bpf_map *map, struct xsk_socket *xsk); 223 int xsk_socket__create(struct xsk_socket **xsk, 240 void xsk_socket__delete(struct xsk_socket *xsk);
|
D | xskxceiver.h | 120 struct xsk_socket *xsk; member 147 struct xsk_socket_info *xsk; member
|
D | Makefile | 272 $(OUTPUT)/xsk.o: $(BPFOBJ) 584 cap_helpers.c test_loader.c xsk.c disasm.c \ 643 $(OUTPUT)/xskxceiver: xskxceiver.c xskxceiver.h $(OUTPUT)/xsk.o $(OUTPUT)/xsk_xdp_progs.skel.h $(BP… 647 $(OUTPUT)/xdp_hw_metadata: xdp_hw_metadata.c $(OUTPUT)/network_helpers.o $(OUTPUT)/xsk.o $(OUTPUT)/…
|
/tools/testing/selftests/bpf/progs/ |
D | xsk_xdp_progs.c | 13 } xsk SEC(".maps"); 20 return bpf_redirect_map(&xsk, 0, XDP_DROP); in xsk_def_prog() 29 return bpf_redirect_map(&xsk, 0, XDP_DROP); in xsk_xdp_drop() 52 return bpf_redirect_map(&xsk, 0, XDP_DROP); in xsk_xdp_populate_metadata()
|
D | xdp_metadata.c | 13 } xsk SEC(".maps"); 61 return bpf_redirect_map(&xsk, ctx->rx_queue_index, XDP_PASS); in rx()
|
D | xdp_hw_metadata.c | 13 } xsk SEC(".maps"); 90 return bpf_redirect_map(&xsk, ctx->rx_queue_index, XDP_PASS); in rx()
|