MCPcopy Create free account
hub / github.com/axboe/liburing / setup_send_ring

Function setup_send_ring

examples/proxy.c:405–421  ·  view source on GitHub ↗

* If 'send_ring' is used and the kernel supports it, we can skip serializing * sends as the data will be ordered regardless. This reduces the send handling * complexity, as buffers can always be added to the outgoing ring and will be * processed in the order in which they were added. */

Source from the content-addressed store, hash-verified

403 * processed in the order in which they were added.
404 */
405static int setup_send_ring(struct io_uring *ring, struct conn *c)
406{
407 struct conn_buf_ring *cbr = &c->out_br;
408 int br_flags = 0;
409 int ret;
410
411 if (buf_ring_inc)
412 br_flags = IOU_PBUF_RING_INC;
413 cbr->br = io_uring_setup_buf_ring(ring, nr_bufs, cbr->bgid, br_flags, &ret);
414 if (!cbr->br) {
415 fprintf(stderr, "Buffer ring register failed %d\n", ret);
416 return 1;
417 }
418
419 printf("%d: send buffer ring bgid %d, bufs %d\n", c->tid, cbr->bgid, nr_bufs);
420 return 0;
421}
422
423static int setup_send_zc(struct io_uring *ring, struct conn *c)
424{

Callers 1

setup_buffer_ringsFunction · 0.85

Calls 1

io_uring_setup_buf_ringFunction · 0.85

Tested by

no test coverage detected