diff --git a/lib/libxdp/tests/test_xsk_non_privileged.c b/lib/libxdp/tests/test_xsk_non_privileged.c index c4cc27b5..04301135 100644 --- a/lib/libxdp/tests/test_xsk_non_privileged.c +++ b/lib/libxdp/tests/test_xsk_non_privileged.c @@ -123,46 +123,6 @@ static struct xsk_umem *create_umem_non_privileged(int sock_fd) return umem; } -/* Should use this to replace create_umem_non_privileged() once - * xsk_umem__create() and xsk_umem__create_with_fd() are deprecated. - */ -static struct xsk_umem *create_umem_non_privileged_by_opts(int sock_fd) -{ - struct xsk_ring_cons cq; - struct xsk_ring_prod fq; - struct xsk_umem *umem; - void *b; - - if (posix_memalign(&b, getpagesize(), UMEM_SIZE)) { - perror("posix_memalign failed"); - exit(EXIT_FAILURE); - } - - /* Opts initialized with fd unset */ - DECLARE_LIBXDP_OPTS(xsk_umem_opts, opts, - .size = UMEM_SIZE, - .fill_size = XSK_RING_PROD__DEFAULT_NUM_DESCS, - .comp_size = XSK_RING_CONS__DEFAULT_NUM_DESCS, - .frame_size = XSK_UMEM__DEFAULT_FRAME_SIZE, - ); - /* This variant requires CAP_NET_RAW, so should fail. */ - umem = xsk_umem__create_opts(b, &fq, &cq, &opts); - if (umem) { - perror("xsk_umem__create_opts succeeded"); - exit(EXIT_FAILURE); - } - - /* This variant shouldn't need any capabilities, so should pass. */ - opts.fd = sock_fd; - umem = xsk_umem__create_opts(b, &fq, &cq, &opts); - if (!umem) { - perror("xsk_umem__create_opts failed"); - exit(EXIT_FAILURE); - } - - return umem; -} - static struct xsk_socket *create_xsk_non_privileged(const char *ifname, struct xsk_umem *umem, int queue_id)