* Setup an input and output buffer ring. */
| 451 | * Setup an input and output buffer ring. |
| 452 | */ |
| 453 | static int setup_buffer_rings(struct io_uring *ring, struct conn *c) |
| 454 | { |
| 455 | int ret; |
| 456 | |
| 457 | /* no locking needed on cur_bgid, parent serializes setup */ |
| 458 | c->in_br.bgid = cur_bgid++; |
| 459 | c->out_br.bgid = cur_bgid++; |
| 460 | c->out_br.br = NULL; |
| 461 | |
| 462 | ret = setup_recv_ring(ring, c); |
| 463 | if (ret) |
| 464 | return ret; |
| 465 | if (is_sink) |
| 466 | return 0; |
| 467 | if (snd_zc) { |
| 468 | ret = setup_send_zc(ring, c); |
| 469 | if (ret) |
| 470 | return ret; |
| 471 | } |
| 472 | if (send_ring) { |
| 473 | ret = setup_send_ring(ring, c); |
| 474 | if (ret) { |
| 475 | free_buffer_ring(ring, &c->in_br); |
| 476 | return ret; |
| 477 | } |
| 478 | } |
| 479 | |
| 480 | return 0; |
| 481 | } |
| 482 | |
| 483 | struct bucket_stat { |
| 484 | int nr_packets; |
no test coverage detected