insque(ifm, ifq);
diddit:
- slirp->if_queued++;
-
if (so) {
/* Update *_queued */
so->so_queued++;
void if_start(Slirp *slirp)
{
uint64_t now = qemu_get_clock_ns(rt_clock);
- int requeued = 0;
bool from_batchq, next_from_batchq;
struct mbuf *ifm, *ifm_next, *ifqt;
while (ifm_next) {
/* check if we can really output */
if (!slirp_can_output(slirp->opaque)) {
- slirp->if_start_busy = false;
- return;
+ break;
}
ifm = ifm_next;
ifm_next = NULL;
}
- slirp->if_queued--;
-
/* Try to send packet unless it already expired */
if (ifm->expiration_date >= now && !if_encap(slirp, ifm)) {
/* Packet is delayed due to pending ARP resolution */
- requeued++;
continue;
}
m_free(ifm);
}
- slirp->if_queued = requeued;
-
slirp->if_start_busy = false;
}
}
}
- /*
- * See if we can start outputting
- */
- if (slirp->if_queued) {
- if_start(slirp);
- }
+ if_start(slirp);
}
/* clear global file descriptor sets.
int mbuf_alloced;
/* if states */
- int if_queued; /* number of packets queued so far */
struct mbuf if_fastq; /* fast queue (for interactive data) */
struct mbuf if_batchq; /* queue for non-interactive data */
struct mbuf *next_m; /* pointer to next mbuf to output */