aboutgitcodebugslistschat
path: root/pcap.h
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2023-01-06 11:43:22 +1100
committerStefano Brivio <sbrivio@redhat.com>2023-01-23 18:55:04 +0100
commit54502cca7f7a89eadce92bb7a2b6ab61b878a5c6 (patch)
tree3e09bece41fd747c2c29f987b20f256ebc509c76 /pcap.h
parent2d553b587ada1f2d0d657e516f3d068efa4db074 (diff)
downloadpasst-54502cca7f7a89eadce92bb7a2b6ab61b878a5c6.tar
passt-54502cca7f7a89eadce92bb7a2b6ab61b878a5c6.tar.gz
passt-54502cca7f7a89eadce92bb7a2b6ab61b878a5c6.tar.bz2
passt-54502cca7f7a89eadce92bb7a2b6ab61b878a5c6.tar.lz
passt-54502cca7f7a89eadce92bb7a2b6ab61b878a5c6.tar.xz
passt-54502cca7f7a89eadce92bb7a2b6ab61b878a5c6.tar.zst
passt-54502cca7f7a89eadce92bb7a2b6ab61b878a5c6.zip
udp: Use tap_send_frames()
To send frames on the tap interface, the UDP uses a fairly complicated two level batching. First multiple frames are gathered into a single "message" for the qemu stream socket, then multiple messages are send with sendmmsg(). We now have tap_send_frames() which already deals with sending a number of frames, including batching and handling partial sends. Use that to considerably simplify things. This does make a couple of behavioural changes: * We used to split messages to keep them under 32kiB (except when a single frame was longer than that). The comments claim this is needed to stop qemu from closing the connection, but we don't have any equivalent logic for TCP. I wasn't able to reproduce the problem with this series, although it was apparently easy to reproduce earlier. My suspicion is that there was never an inherent need to keep messages small, however with larger messages (and default kernel buffer sizes) the chances of needing more than one resend for partial send()s is greatly increased. We used not to correctly handle that case of multiple resends, but now we do. * Previously when we got a partial send on UDP, we would resend the remainder of the entire "message", including multiple frames. The common code now only resends the remainder of a single frame, simply dropping any frames which weren't even partially sent. This is what TCP always did and is probably a better idea for UDP too. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'pcap.h')
-rw-r--r--pcap.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/pcap.h b/pcap.h
index eafc89b..c2af3cf 100644
--- a/pcap.h
+++ b/pcap.h
@@ -8,7 +8,6 @@
void pcap(const char *pkt, size_t len);
void pcap_multiple(const struct iovec *iov, unsigned int n, size_t offset);
-void pcapmm(const struct mmsghdr *mmh, unsigned int vlen);
void pcap_init(struct ctx *c);
#endif /* PCAP_H */