diff options
Diffstat (limited to 'udp.c')
| -rw-r--r-- | udp.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -224,20 +224,25 @@ static void udp_iov_init_one(const struct ctx *c, size_t i) struct iovec *siov = &udp_iov_recv[i]; struct iovec *tiov = udp_l2_iov[i]; + *siov = IOV_OF_LVALUE(payload->data); + mh->msg_iov = siov; + mh->msg_iovlen = 1; + + /* The L2 buffers are only used by the tap datapath: skip them in + * --splice-only mode so that their pages are never faulted in. + */ + if (c->splice_only) + return; + *meta = (struct udp_meta_t) { .ip4h = L2_BUF_IP4_INIT(IPPROTO_UDP), .ip6h = L2_BUF_IP6_INIT(IPPROTO_UDP), }; - *siov = IOV_OF_LVALUE(payload->data); - tiov[UDP_IOV_ETH] = IOV_OF_LVALUE(udp_eth_hdr[i]); tiov[UDP_IOV_TAP] = tap_hdr_iov(c, &meta->taph); tiov[UDP_IOV_PAYLOAD].iov_base = payload; tiov[UDP_IOV_ETH_PAD].iov_base = eth_pad; - - mh->msg_iov = siov; - mh->msg_iovlen = 1; } /** |
