* 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. */
| 403 | * processed in the order in which they were added. |
| 404 | */ |
| 405 | static 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 | |
| 423 | static int setup_send_zc(struct io_uring *ring, struct conn *c) |
| 424 | { |
no test coverage detected