diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2022-11-30 15:13:14 +1100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-12-06 07:41:56 +0100 |
commit | fc7f91e7099d0960e9a43fca7b1ae7e77958c8f1 (patch) | |
tree | 98cae187aa413e50eed9867035cab20f19d977d5 /test | |
parent | c52ca4aecfd87e7c412dc6f47e4671880ffae389 (diff) | |
download | passt-fc7f91e7099d0960e9a43fca7b1ae7e77958c8f1.tar passt-fc7f91e7099d0960e9a43fca7b1ae7e77958c8f1.tar.gz passt-fc7f91e7099d0960e9a43fca7b1ae7e77958c8f1.tar.bz2 passt-fc7f91e7099d0960e9a43fca7b1ae7e77958c8f1.tar.lz passt-fc7f91e7099d0960e9a43fca7b1ae7e77958c8f1.tar.xz passt-fc7f91e7099d0960e9a43fca7b1ae7e77958c8f1.tar.zst passt-fc7f91e7099d0960e9a43fca7b1ae7e77958c8f1.zip |
udp: Unify buffers for tap and splice paths
We maintain a set of buffers for UDP packets to be forwarded via the tap
interface in udp[46]_l2_buf. We then have a separate set of buffers for
packets to be "spliced" in udp_splice_buf[]. However, we only use one of
these at a time, so we can share the buffer space.
For the receiving splice packets we can not only re-use the data buffers
but also the udp[46]_l2_iov_sock and udp[46]_l2_mh_sock control structures.
For sending the splice packets we keep the same data buffers, but we need
specific control structures. We create udp[46]_iov_splice - we can't
reuse udp_l2_iov_sock[] because we need to write iov_len as we're writing
spliced packets, but the tap path expects iov_len to remain the same (it
only uses it for receive). Likewise we create udp[46]_mh_splice with the
mmsghdr structures for sending spliced packets. As well as needing to
reference different iovs, these need to all reference udp_splice_namebuf
instead of individual msg_name fields for each slot.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'test')
0 files changed, 0 insertions, 0 deletions