* Iterate buffers from '*bid' and with a total size of 'bytes' and add them * back to our receive ring so they can be reused for new receives. */
| 917 | * back to our receive ring so they can be reused for new receives. |
| 918 | */ |
| 919 | static int replenish_buffers(struct conn *c, int *bid, int bytes) |
| 920 | { |
| 921 | struct conn_buf_ring *cbr = &c->in_br; |
| 922 | int nr_packets = 0; |
| 923 | |
| 924 | while (bytes) { |
| 925 | int this_len = replenish_buffer(cbr, *bid, nr_packets); |
| 926 | |
| 927 | if (this_len > bytes) |
| 928 | this_len = bytes; |
| 929 | bytes -= this_len; |
| 930 | |
| 931 | *bid = (*bid + 1) & (nr_bufs - 1); |
| 932 | nr_packets++; |
| 933 | } |
| 934 | |
| 935 | io_uring_buf_ring_advance(cbr->br, nr_packets); |
| 936 | return nr_packets; |
| 937 | } |
| 938 | |
| 939 | static void free_mvec(struct msg_vec *mvec) |
| 940 | { |
no test coverage detected