socklen_t saddrlen;
struct quic_dgram *new_dgram;
unsigned char *dgram_buf;
+ int max_dgrams;
BUG_ON(!l);
buf = &rxbuf->buf;
+ max_dgrams = global.tune.maxpollevents;
+ start:
/* Try to reuse an existing dgram. Note that there is alway at
* least one datagram to pick, except the first time we enter
* this function for this <rxbuf> buffer.
b_del(buf, ret);
}
new_dgram = NULL;
+ if (--max_dgrams > 0)
+ goto start;
out:
pool_free(pool_head_quic_dgram, new_dgram);
MT_LIST_APPEND(&l->rx.rxbuf_list, &rxbuf->mt_list);
*/
static void qc_lstnr_pkt_rcv(unsigned char *buf, const unsigned char *end,
struct quic_rx_packet *pkt, int first_pkt,
- struct quic_dgram *dgram)
+ struct quic_dgram *dgram, struct list **tasklist_head)
{
unsigned char *beg, *payload;
struct quic_conn *qc, *qc_to_purge = NULL;
*/
conn_ctx = qc->xprt_ctx;
if (conn_ctx)
- tasklet_wakeup(conn_ctx->wait_event.tasklet);
+ *tasklist_head = tasklet_wakeup_after(*tasklist_head, conn_ctx->wait_event.tasklet);
drop_no_conn:
if (drop_no_conn)
struct quic_dghdlr *dghdlr = ctx;
struct quic_dgram *dgram;
int first_pkt = 1;
+ struct list *tasklist_head = NULL;
while ((dgram = MT_LIST_POP(&dghdlr->dgrams, typeof(dgram), mt_list))) {
pos = dgram->buf;
LIST_INIT(&pkt->qc_rx_pkt_list);
pkt->time_received = now_ms;
quic_rx_packet_refinc(pkt);
- qc_lstnr_pkt_rcv(pos, end, pkt, first_pkt, dgram);
+ qc_lstnr_pkt_rcv(pos, end, pkt, first_pkt, dgram, &tasklist_head);
first_pkt = 0;
pos += pkt->len;
quic_rx_packet_refdec(pkt);