tap: Implement tap_send() "slow path" in terms of fast path
Most times we send frames to the guest it goes via tap_send_frames(). However "slow path" protocols - ARP, ICMP, ICMPv6, DHCP and DHCPv6 - go via tap_send(). As well as being a semantic duplication, tap_send() contains at least one serious problem: it doesn't properly handle short sends, which can be fatal on the qemu socket connection, since frame boundaries will get out of sync. Rewrite tap_send() to call tap_send_frames(). While we're there, rename it tap_send_single() for clarity. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:

committed by
Stefano Brivio

parent
1ebe787fe4
commit
4db947d17c
2
tap.h
2
tap.h
@@ -72,7 +72,7 @@ void tap_udp6_send(const struct ctx *c,
|
||||
void tap_icmp6_send(const struct ctx *c,
|
||||
const struct in6_addr *src, const struct in6_addr *dst,
|
||||
const void *in, size_t len);
|
||||
int tap_send(const struct ctx *c, const void *data, size_t len);
|
||||
void tap_send_single(const struct ctx *c, const void *data, size_t len);
|
||||
size_t tap_send_frames(const struct ctx *c, const struct iovec *iov,
|
||||
size_t bufs_per_frame, size_t nframes);
|
||||
void eth_update_mac(struct ethhdr *eh,
|
||||
|
Reference in New Issue
Block a user