aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAloys Augustin <aloaugus@cisco.com>2019-12-20 13:14:00 +0100
committerDave Wallace <dwallacelf@gmail.com>2020-01-06 14:11:55 +0000
commit7abab303670022693e8b5226805c85e03c344362 (patch)
treec1b202b94c9b0a48fc313f61c1ac95300ddf08a6
parent94501c49a4574adb6323815317ec188ef5934cc1 (diff)
quic: call quic_send_packets only once per ctx
This prevents unnecessary calls to quic_send_packets. Type: fix Change-Id: I7abe509aa8b7b9d5a01c9876046cf0f4507a79cf Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
-rw-r--r--src/plugins/quic/quic.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/plugins/quic/quic.c b/src/plugins/quic/quic.c
index dc3b1d4038e..fd848b07331 100644
--- a/src/plugins/quic/quic.c
+++ b/src/plugins/quic/quic.c
@@ -2153,7 +2153,7 @@ static int
quic_udp_session_rx_callback (session_t * udp_session)
{
/* Read data from UDP rx_fifo and pass it to the quicly conn. */
- quic_ctx_t *ctx = NULL;
+ quic_ctx_t *ctx = NULL, *prev_ctx = NULL;
svm_fifo_t *f = udp_session->rx_fifo;
u32 max_deq;
u64 udp_session_handle = session_handle (udp_session);
@@ -2234,8 +2234,10 @@ rx_start:
break;
}
}
+ ctx = prev_ctx = NULL;
for (i = 0; i < max_packets; i++)
{
+ prev_ctx = ctx;
switch (packets_ctx[i].ptype)
{
case QUIC_PACKET_TYPE_RECEIVE:
@@ -2250,9 +2252,11 @@ rx_start:
packets_ctx[i].thread_index);
break;
default:
- continue;
+ continue; /* this exits the for loop since other packet types are
+ necessarily the last in the batch */
}
- quic_send_packets (ctx);
+ if (ctx != prev_ctx)
+ quic_send_packets (ctx);
}
udp_session = session_get_from_handle (udp_session_handle); /* session alloc might have happened */