aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2021-04-30 17:50:29 -0700
committerDamjan Marion <dmarion@me.com>2021-05-03 08:08:39 +0000
commit757f470aefea09fda41df9cfa713ed16a9b67452 (patch)
treed3c552209f3dfe107b6d610298acb86d1f208338 /src/plugins
parent88dd3cf6033b336ff5635189464cd82e8047732d (diff)
quic: improve udp dgram write
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2992c66d11fe6adc96b525b0fde533e5ff58d7e4
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/quic/quic.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/plugins/quic/quic.c b/src/plugins/quic/quic.c
index 4a2020ca0e1..0cd2800728a 100644
--- a/src/plugins/quic/quic.c
+++ b/src/plugins/quic/quic.c
@@ -683,19 +683,16 @@ quic_send_datagram (session_t *udp_session, struct iovec *packet,
QUIC_ASSERT (dest->sa.sa_family == AF_INET6);
struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *) &dest->sa;
hdr.rmt_port = sa6->sin6_port;
- clib_memcpy (&hdr.rmt_ip.ip6, &sa6->sin6_addr, 16);
+ clib_memcpy_fast (&hdr.rmt_ip.ip6, &sa6->sin6_addr, 16);
}
- ret = svm_fifo_enqueue (f, sizeof (hdr), (u8 *) & hdr);
- if (ret != sizeof (hdr))
- {
- QUIC_ERR ("Not enough space to enqueue header");
- return QUIC_ERROR_FULL_FIFO;
- }
- ret = svm_fifo_enqueue (f, len, packet->iov_base);
- if (ret != len)
+ svm_fifo_seg_t segs[2] = { { (u8 *) &hdr, sizeof (hdr) },
+ { packet->iov_base, len } };
+
+ ret = svm_fifo_enqueue_segments (f, segs, 2, 0 /* allow partial */);
+ if (PREDICT_FALSE (ret < 0))
{
- QUIC_ERR ("Not enough space to enqueue payload");
+ QUIC_ERR ("Not enough space to enqueue dgram");
return QUIC_ERROR_FULL_FIFO;
}