Skip to content
Discussion options

You must be logged in to vote

Here's what I ran, only change is looping for CQEs and doing the prep side in a more solid fashion. The latter may make a difference on your old liburing.

#include <arpa/inet.h>
#include <liburing.h>
#include <stdio.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>

#define BUF_BGID 0
#define N_BUFS 128
#define PAGESIZE 4096
#define BUFSIZE 8192
#define PORT 49000

int main(int argc, char *argv[])
{
    struct sockaddr_in addr;
    int sock_fd;
    char* bufs; // All bufs go here
    int i;

    struct io_uring ring;
    struct io_uring_buf_ring* br = NULL;
        struct io_uring_sqe *sqe;
        struct io_uring_cqe* cqe;

    …

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@mbr0wn
Comment options

@axboe
Comment options

Answer selected by mbr0wn
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants