Skip to content

Commit

Permalink
libxdp: Use previous xsk_configure_umem() in test
Browse files Browse the repository at this point in the history
Signed-off-by: Muyang Tian <[email protected]>
  • Loading branch information
tacslon committed Nov 18, 2024
1 parent 287dc5d commit d167634
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/libxdp/tests/test_xsk_refcnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,16 @@ static struct xsk_socket_info *xsks[MAX_NUM_QUEUES];
static struct xsk_umem_info *xsk_configure_umem(void *buffer, u64 size)
{
struct xsk_umem_info *umem;
int ret;

umem = calloc(1, sizeof(*umem));
if (!umem)
exit(EXIT_FAILURE);

DECLARE_LIBXDP_OPTS(xsk_umem_opts, opts,
.size = size,
);
umem->umem = xsk_umem__create_opts(buffer, &umem->fq, &umem->cq, &opts);
if (!umem->umem)
exit(errno);
ret = xsk_umem__create(&umem->umem, buffer, size, &umem->fq, &umem->cq,
NULL);
if (ret)
exit(ret);

umem->buffer = buffer;
return umem;
Expand Down

0 comments on commit d167634

Please sign in to comment.