Skip to content

Commit

Permalink
Remove test codes to retry CI
Browse files Browse the repository at this point in the history
Signed-off-by: Muyang Tian <[email protected]>
  • Loading branch information
tacslon committed Nov 21, 2024
1 parent 3316ca8 commit d94c844
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions lib/libxdp/tests/test_xsk_non_privileged.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d94c844

Please sign in to comment.