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

Function recv_enobufs

examples/proxy.c:761–783  ·  view source on GitHub ↗

* We hit -ENOBUFS, which means that we ran out of buffers in our current * provided buffer group. This can happen if there's an imbalance between the * receives coming in and the sends being processed, particularly with multishot * receive as they can trigger very quickly. If this happens, defer arming a * new receive until we've replenished half of the buffer pool by processing * pending sen

Source from the content-addressed store, hash-verified

759 * pending sends.
760 */
761static void recv_enobufs(struct io_uring *ring, struct conn *c,
762 struct conn_dir *cd, int fd)
763{
764 vlog("%d: enobufs hit\n", c->tid);
765
766 cd->rcv_enobufs++;
767
768 /*
769 * If we're a sink, mark rcv as rearm. If we're not, then mark us as
770 * needing a rearm for receive and send. The completing send will
771 * kick the recv rearm.
772 */
773 if (!is_sink) {
774 int do_recv_arm = 1;
775
776 if (!cd->pending_send)
777 do_recv_arm = !prep_next_send(ring, c, cd, fd);
778 if (do_recv_arm)
779 __submit_receive(ring, c, &c->cd[0], c->in_fd);
780 } else {
781 __submit_receive(ring, c, &c->cd[0], c->in_fd);
782 }
783}
784
785/*
786 * Kill this socket - submit a shutdown and link a close to it. We don't

Callers 1

recv_errorFunction · 0.85

Calls 2

prep_next_sendFunction · 0.85
__submit_receiveFunction · 0.85

Tested by

no test coverage detected