From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=bRcLlX57; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id 87DB95A026D for ; Tue, 16 Jun 2026 14:51:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781614301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cdqmO9tZX14A18iwPjYEiiGL1CC5+H4a3naeDFyL6sw=; b=bRcLlX57Vp988oRoGQUn56UDk9t5lcJxBu9YXpvJexYjyE9v25/d3BAUbnGoehyLr0Y+/S esH2lmy1sisf0870Nwf4FTmTKU/iilIHSv0v0ELFLbD2U6CsmTabLmmLGMXCe6zaiqNuBK myQy4X1Um425mMcnRml+yedTotu4kyQ= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-368-a0Z12v1UN6uE7Zq1Sr8ahg-1; Tue, 16 Jun 2026 08:51:40 -0400 X-MC-Unique: a0Z12v1UN6uE7Zq1Sr8ahg-1 X-Mimecast-MFC-AGG-ID: a0Z12v1UN6uE7Zq1Sr8ahg_1781614299 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 203D219560B1 for ; Tue, 16 Jun 2026 12:51:39 +0000 (UTC) Received: from lenovo-t14s.redhat.corp (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4A8621800595; Tue, 16 Jun 2026 12:51:38 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH v5 04/12] tap: Thread queue pair through all remaining tap paths Date: Tue, 16 Jun 2026 14:51:22 +0200 Message-ID: <20260616125130.1324274-5-lvivier@redhat.com> In-Reply-To: <20260616125130.1324274-1-lvivier@redhat.com> References: <20260616125130.1324274-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: IdNK_j6MXYaAnQ5jrcykpLZ6waJAh4SEkqH_3AUIdI0_1781614299 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true Message-ID-Hash: KNDLFVVQT74XN7OK4PK6HATGLVJ22TQU X-Message-ID-Hash: KNDLFVVQT74XN7OK4PK6HATGLVJ22TQU X-MailFrom: lvivier@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Laurent Vivier X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The previous commit threaded queue pair through vu_send_single(). Extend this to every other tap entry point: tap_send_single(), receive handlers (tap_add_packet, tap_handler, tap4/6_handler), send helpers (tap_udp4/6_send, tap_icmp4/6_send), and connection setup (tap_listen_handler, tap_start_connection). All callers pass QPAIR_DEFAULT except vu_handle_tx(), which derives the queue pair from the virtqueue index with QPAIR_FROM_QUEUE(). The parameter is plumbed but not yet consumed. Subsequent patches will use it to direct traffic to the correct queue pair. No functional change. Signed-off-by: Laurent Vivier --- arp.c | 6 ++-- dhcp.c | 3 +- dhcpv6.c | 4 +-- icmp.c | 6 ++-- ndp.c | 2 +- passt.c | 2 +- tap.c | 79 +++++++++++++++++++++++++++++++++-------------------- tap.h | 21 +++++++------- tcp.c | 2 +- udp.c | 4 +-- vu_common.c | 5 ++-- 11 files changed, 80 insertions(+), 54 deletions(-) diff --git a/arp.c b/arp.c index bb042e9585a3..e97c4de86a99 100644 --- a/arp.c +++ b/arp.c @@ -112,7 +112,7 @@ int arp(const struct ctx *c, struct iov_tail *data) memcpy(resp.am.tha, am->sha, sizeof(resp.am.tha)); memcpy(resp.am.tip, am->sip, sizeof(resp.am.tip)); - tap_send_single(c, &resp, sizeof(resp)); + tap_send_single(c, QPAIR_DEFAULT, &resp, sizeof(resp)); return 1; } @@ -148,7 +148,7 @@ void arp_send_init_req(const struct ctx *c) memcpy(req.am.tip, &c->ip4.addr, sizeof(req.am.tip)); debug("Sending initial ARP request for guest MAC address"); - tap_send_single(c, &req, sizeof(req)); + tap_send_single(c, QPAIR_DEFAULT, &req, sizeof(req)); } /** @@ -202,5 +202,5 @@ void arp_announce(const struct ctx *c, struct in_addr *ip, eth_ntop(mac, mac_str, sizeof(mac_str)); debug("ARP announcement for %s / %s", ip_str, mac_str); - tap_send_single(c, &msg, sizeof(msg)); + tap_send_single(c, QPAIR_DEFAULT, &msg, sizeof(msg)); } diff --git a/dhcp.c b/dhcp.c index 1ff8cba9f93d..e652659138b8 100644 --- a/dhcp.c +++ b/dhcp.c @@ -473,7 +473,8 @@ int dhcp(const struct ctx *c, struct iov_tail *data) else dst = c->ip4.addr; - tap_udp4_send(c, c->ip4.our_tap_addr, 67, dst, 68, &reply, dlen); + tap_udp4_send(c, QPAIR_DEFAULT, c->ip4.our_tap_addr, 67, dst, 68, + &reply, dlen); return 1; } diff --git a/dhcpv6.c b/dhcpv6.c index 97c04e2cb846..f4ebeccf912c 100644 --- a/dhcpv6.c +++ b/dhcpv6.c @@ -405,7 +405,7 @@ static void dhcpv6_send_ia_notonlink(struct ctx *c, resp_not_on_link.hdr.xid = xid; - tap_udp6_send(c, src, 547, tap_ip6_daddr(c, src), 546, + tap_udp6_send(c, QPAIR_DEFAULT, src, 547, tap_ip6_daddr(c, src), 546, xid, &resp_not_on_link, n); } @@ -680,7 +680,7 @@ int dhcpv6(struct ctx *c, struct iov_tail *data, resp.hdr.xid = mh->xid; - tap_udp6_send(c, src, 547, tap_ip6_daddr(c, src), 546, + tap_udp6_send(c, QPAIR_DEFAULT, src, 547, tap_ip6_daddr(c, src), 546, mh->xid, &resp, n); c->ip6.addr_seen = c->ip6.addr; diff --git a/icmp.c b/icmp.c index 18b6106a393e..3705f5ce0c9b 100644 --- a/icmp.c +++ b/icmp.c @@ -132,12 +132,14 @@ void icmp_sock_handler(const struct ctx *c, union epoll_ref ref) const struct in_addr *daddr = inany_v4(&ini->eaddr); assert(saddr && daddr); /* Must have IPv4 addresses */ - tap_icmp4_send(c, *saddr, *daddr, buf, pingf->f.tap_omac, n); + tap_icmp4_send(c, QPAIR_DEFAULT, *saddr, *daddr, buf, + pingf->f.tap_omac, n); } else if (pingf->f.type == FLOW_PING6) { const struct in6_addr *saddr = &ini->oaddr.a6; const struct in6_addr *daddr = &ini->eaddr.a6; - tap_icmp6_send(c, saddr, daddr, buf, pingf->f.tap_omac, n); + tap_icmp6_send(c, QPAIR_DEFAULT, saddr, daddr, buf, + pingf->f.tap_omac, n); } return; diff --git a/ndp.c b/ndp.c index 1f2bcb0cc7ea..6269cb38d93f 100644 --- a/ndp.c +++ b/ndp.c @@ -184,7 +184,7 @@ static void ndp_send(const struct ctx *c, const struct in6_addr *dst, { const struct in6_addr *src = &c->ip6.our_tap_ll; - tap_icmp6_send(c, src, dst, buf, c->our_tap_mac, l4len); + tap_icmp6_send(c, QPAIR_DEFAULT, src, dst, buf, c->our_tap_mac, l4len); } /** diff --git a/passt.c b/passt.c index 06f9ddb9b459..71eb4f0192e2 100644 --- a/passt.c +++ b/passt.c @@ -242,7 +242,7 @@ static void passt_worker(void *opaque, int nfds, struct epoll_event *events) tap_handler_passt(c, eventmask, &now); break; case EPOLL_TYPE_TAP_LISTEN: - tap_listen_handler(c, eventmask); + tap_listen_handler(c, QPAIR_DEFAULT, eventmask); break; case EPOLL_TYPE_NSQUIT_INOTIFY: pasta_netns_quit_inotify_handler(c, ref.fd); diff --git a/tap.c b/tap.c index a5d22088424f..521ccd6d47e7 100644 --- a/tap.c +++ b/tap.c @@ -124,10 +124,12 @@ unsigned long tap_l2_max_len(const struct ctx *c) /** * tap_send_single() - Send a single frame * @c: Execution context + * @qpair: Queue pair on which to send the frame * @data: Packet buffer * @l2len: Total L2 packet length */ -void tap_send_single(const struct ctx *c, const void *data, size_t l2len) +void tap_send_single(const struct ctx *c, unsigned int qpair, const void *data, + size_t l2len) { uint8_t padded[ETH_ZLEN] = { 0 }; struct iovec iov[2]; @@ -155,7 +157,7 @@ void tap_send_single(const struct ctx *c, const void *data, size_t l2len) tap_send_frames(c, iov, iovcnt, 1); break; case MODE_VU: - vu_send_single(c, QPAIR_DEFAULT, data, l2len); + vu_send_single(c, qpair, data, l2len); break; } } @@ -258,6 +260,7 @@ void *tap_push_uh4(struct udphdr *uh, struct in_addr src, in_port_t sport, /** * tap_udp4_send() - Send UDP over IPv4 packet * @c: Execution context + * @qpair: Queue pair on which to send packet * @src: IPv4 source address * @sport: UDP source port * @dst: IPv4 destination address @@ -265,8 +268,8 @@ void *tap_push_uh4(struct udphdr *uh, struct in_addr src, in_port_t sport, * @in: UDP payload contents (not including UDP header) * @dlen: UDP payload length (not including UDP header) */ -void tap_udp4_send(const struct ctx *c, struct in_addr src, in_port_t sport, - struct in_addr dst, in_port_t dport, +void tap_udp4_send(const struct ctx *c, unsigned int qpair, struct in_addr src, + in_port_t sport, struct in_addr dst, in_port_t dport, const void *in, size_t dlen) { size_t l4len = dlen + sizeof(struct udphdr); @@ -276,20 +279,22 @@ void tap_udp4_send(const struct ctx *c, struct in_addr src, in_port_t sport, char *data = tap_push_uh4(uh, src, sport, dst, dport, in, dlen); memcpy(data, in, dlen); - tap_send_single(c, buf, dlen + (data - buf)); + tap_send_single(c, qpair, buf, dlen + (data - buf)); } /** * tap_icmp4_send() - Send ICMPv4 packet * @c: Execution context + * @qpair: Queue pair on which to send packet * @src: IPv4 source address * @dst: IPv4 destination address * @in: ICMP packet, including ICMP header * @src_mac: MAC address to be used as source for message * @l4len: ICMP packet length, including ICMP header */ -void tap_icmp4_send(const struct ctx *c, struct in_addr src, struct in_addr dst, - const void *in, const void *src_mac, size_t l4len) +void tap_icmp4_send(const struct ctx *c, unsigned int qpair, struct in_addr src, + struct in_addr dst, const void *in, const void *src_mac, + size_t l4len) { char buf[USHRT_MAX]; struct iphdr *ip4h = tap_push_l2h(c, buf, src_mac, ETH_P_IP); @@ -299,7 +304,7 @@ void tap_icmp4_send(const struct ctx *c, struct in_addr src, struct in_addr dst, memcpy(icmp4h, in, l4len); csum_icmp4(icmp4h, icmp4h + 1, l4len - sizeof(*icmp4h)); - tap_send_single(c, buf, l4len + ((char *)icmp4h - buf)); + tap_send_single(c, qpair, buf, l4len + ((char *)icmp4h - buf)); } /** @@ -363,6 +368,7 @@ void *tap_push_uh6(struct udphdr *uh, /** * tap_udp6_send() - Send UDP over IPv6 packet * @c: Execution context + * @qpair: Queue pair on which to send packet * @src: IPv6 source address * @sport: UDP source port * @dst: IPv6 destination address @@ -371,7 +377,7 @@ void *tap_push_uh6(struct udphdr *uh, * @in: UDP payload contents (not including UDP header) * @dlen: UDP payload length (not including UDP header) */ -void tap_udp6_send(const struct ctx *c, +void tap_udp6_send(const struct ctx *c, unsigned int qpair, const struct in6_addr *src, in_port_t sport, const struct in6_addr *dst, in_port_t dport, uint32_t flow, void *in, size_t dlen) @@ -384,19 +390,20 @@ void tap_udp6_send(const struct ctx *c, char *data = tap_push_uh6(uh, src, sport, dst, dport, in, dlen); memcpy(data, in, dlen); - tap_send_single(c, buf, dlen + (data - buf)); + tap_send_single(c, qpair, buf, dlen + (data - buf)); } /** * tap_icmp6_send() - Send ICMPv6 packet * @c: Execution context + * @qpair: Queue pair on which to send packet * @src: IPv6 source address * @dst: IPv6 destination address * @in: ICMP packet, including ICMP header * @src_mac: MAC address to be used as source for message * @l4len: ICMP packet length, including ICMP header */ -void tap_icmp6_send(const struct ctx *c, +void tap_icmp6_send(const struct ctx *c, unsigned int qpair, const struct in6_addr *src, const struct in6_addr *dst, const void *in, const void *src_mac, size_t l4len) { @@ -408,7 +415,7 @@ void tap_icmp6_send(const struct ctx *c, memcpy(icmp6h, in, l4len); csum_icmp6(icmp6h, src, dst, icmp6h + 1, l4len - sizeof(*icmp6h)); - tap_send_single(c, buf, l4len + ((char *)icmp6h - buf)); + tap_send_single(c, qpair, buf, l4len + ((char *)icmp6h - buf)); } /** @@ -699,15 +706,19 @@ static bool tap4_is_fragment(const struct iphdr *iph, /** * tap4_handler() - IPv4 and ARP packet handler for tap file descriptor * @c: Execution context + * @qpair: Queue pair on which to send packets * @now: Current timestamp * * Return: count of packets consumed by handlers */ -static int tap4_handler(struct ctx *c, const struct timespec *now) +static int tap4_handler(struct ctx *c, unsigned int qpair, + const struct timespec *now) { unsigned int i, j, seq_count; struct tap4_l4_t *seq; + (void)qpair; + if (!c->ifi4 || !pool_tap4->count) return pool_tap4->count; @@ -933,15 +944,19 @@ found: /** * tap6_handler() - IPv6 packet handler for tap file descriptor * @c: Execution context + * @qpair: Queue pair on which to send packets * @now: Current timestamp * * Return: count of packets consumed by handlers */ -static int tap6_handler(struct ctx *c, const struct timespec *now) +static int tap6_handler(struct ctx *c, unsigned int qpair, + const struct timespec *now) { unsigned int i, j, seq_count = 0; struct tap6_l4_t *seq; + (void)qpair; + if (!c->ifi6 || !pool_tap6->count) return pool_tap6->count; @@ -1137,21 +1152,23 @@ void tap_flush_pools(void) /** * tap_handler() - IPv4/IPv6 and ARP packet handler for tap file descriptor * @c: Execution context + * @qpair: Queue pair on which to send packets * @now: Current timestamp */ -void tap_handler(struct ctx *c, const struct timespec *now) +void tap_handler(struct ctx *c, unsigned int qpair, const struct timespec *now) { - tap4_handler(c, now); - tap6_handler(c, now); + tap4_handler(c, qpair, now); + tap6_handler(c, qpair, now); } /** * tap_add_packet() - Queue/capture packet, update notion of guest MAC address * @c: Execution context + * @qpair: Queue pair associated with the packet * @data: Packet to add to the pool * @now: Current timestamp */ -void tap_add_packet(struct ctx *c, struct iov_tail *data, +void tap_add_packet(struct ctx *c, unsigned int qpair, struct iov_tail *data, const struct timespec *now) { size_t l2len = iov_tail_size(data); @@ -1178,14 +1195,14 @@ void tap_add_packet(struct ctx *c, struct iov_tail *data, case ETH_P_ARP: case ETH_P_IP: if (!pool_can_fit(pool_tap4, data)) { - tap4_handler(c, now); + tap4_handler(c, qpair, now); pool_flush(pool_tap4); } packet_add(pool_tap4, data); break; case ETH_P_IPV6: if (!pool_can_fit(pool_tap6, data)) { - tap6_handler(c, now); + tap6_handler(c, qpair, now); pool_flush(pool_tap6); } packet_add(pool_tap6, data); @@ -1270,7 +1287,7 @@ static void tap_passt_input(struct ctx *c, const struct timespec *now) n -= sizeof(uint32_t); data = IOV_TAIL_FROM_BUF(p, l2len, 0); - tap_add_packet(c, &data, now); + tap_add_packet(c, QPAIR_DEFAULT, &data, now); p += l2len; n -= l2len; @@ -1279,7 +1296,7 @@ static void tap_passt_input(struct ctx *c, const struct timespec *now) partial_len = n; partial_frame = p; - tap_handler(c, now); + tap_handler(c, QPAIR_DEFAULT, now); } /** @@ -1338,10 +1355,10 @@ static void tap_pasta_input(struct ctx *c, const struct timespec *now) continue; data = IOV_TAIL_FROM_BUF(pkt_buf + n, len, 0); - tap_add_packet(c, &data, now); + tap_add_packet(c, QPAIR_DEFAULT, &data, now); } - tap_handler(c, now); + tap_handler(c, QPAIR_DEFAULT, now); } /** @@ -1430,11 +1447,14 @@ bool tap_is_ready(const struct ctx *c) /** * tap_start_connection() - start a new connection * @c: Execution context + * @qpair: Queue pair to use for the connection */ -static void tap_start_connection(const struct ctx *c) +static void tap_start_connection(const struct ctx *c, unsigned int qpair) { union epoll_ref ref = { 0 }; + (void)qpair; + ref.fd = c->fd_tap; switch (c->mode) { case MODE_PASST: @@ -1462,9 +1482,10 @@ static void tap_start_connection(const struct ctx *c) /** * tap_listen_handler() - Handle new connection on listening socket * @c: Execution context + * @qpair: Queue pair to use for the connection * @events: epoll events */ -void tap_listen_handler(struct ctx *c, uint32_t events) +void tap_listen_handler(struct ctx *c, unsigned int qpair, uint32_t events) { int v = INT_MAX / 2; struct ucred ucred; @@ -1513,7 +1534,7 @@ void tap_listen_handler(struct ctx *c, uint32_t events) setsockopt(c->fd_tap, SOL_SOCKET, SO_SNDBUF, &v, sizeof(v))) trace("tap: failed to set SO_SNDBUF to %i", v); - tap_start_connection(c); + tap_start_connection(c, qpair); } /** @@ -1566,7 +1587,7 @@ static void tap_sock_tun_init(struct ctx *c) pasta_ns_conf(c); if (!c->splice_only) - tap_start_connection(c); + tap_start_connection(c, QPAIR_DEFAULT); } /** @@ -1603,7 +1624,7 @@ void tap_backend_init(struct ctx *c) if (c->fd_tap != -1) { /* Passed as --fd */ assert(c->one_off); - tap_start_connection(c); + tap_start_connection(c, QPAIR_DEFAULT); return; } diff --git a/tap.h b/tap.h index 07ca0965215c..ecb12de372b5 100644 --- a/tap.h +++ b/tap.h @@ -91,30 +91,31 @@ void *tap_push_ip6h(struct ipv6hdr *ip6h, const struct in6_addr *src, const struct in6_addr *dst, size_t l4len, uint8_t proto, uint32_t flow); -void tap_udp4_send(const struct ctx *c, struct in_addr src, in_port_t sport, - struct in_addr dst, in_port_t dport, +void tap_udp4_send(const struct ctx *c, unsigned int qpair, struct in_addr src, + in_port_t sport, struct in_addr dst, in_port_t dport, const void *in, size_t dlen); -void tap_icmp4_send(const struct ctx *c, struct in_addr src, struct in_addr dst, - const void *in, const void *src_mac, size_t l4len); +void tap_icmp4_send(const struct ctx *c, unsigned int qpair, struct in_addr src, + struct in_addr dst, const void *in, const void *src_mac, + size_t l4len); const struct in6_addr *tap_ip6_daddr(const struct ctx *c, const struct in6_addr *src); void *tap_push_ip6h(struct ipv6hdr *ip6h, const struct in6_addr *src, const struct in6_addr *dst, size_t l4len, uint8_t proto, uint32_t flow); -void tap_udp6_send(const struct ctx *c, +void tap_udp6_send(const struct ctx *c, unsigned int qpair, const struct in6_addr *src, in_port_t sport, const struct in6_addr *dst, in_port_t dport, uint32_t flow, void *in, size_t dlen); -void tap_icmp6_send(const struct ctx *c, +void tap_icmp6_send(const struct ctx *c, unsigned int qpair, const struct in6_addr *src, const struct in6_addr *dst, const void *in, const void *src_mac, size_t l4len); -void tap_send_single(const struct ctx *c, const void *data, size_t l2len); +void tap_send_single(const struct ctx *c, unsigned int qpair, const void *data, size_t l2len); 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, const unsigned char *eth_d, const unsigned char *eth_s); bool tap_is_ready(const struct ctx *c); -void tap_listen_handler(struct ctx *c, uint32_t events); +void tap_listen_handler(struct ctx *c, unsigned int qpair, uint32_t events); void tap_handler_pasta(struct ctx *c, uint32_t events, const struct timespec *now); void tap_handler_passt(struct ctx *c, uint32_t events, @@ -123,7 +124,7 @@ int tap_sock_unix_open(char *sock_path); void tap_sock_reset(struct ctx *c); void tap_backend_init(struct ctx *c); void tap_flush_pools(void); -void tap_handler(struct ctx *c, const struct timespec *now); -void tap_add_packet(struct ctx *c, struct iov_tail *data, +void tap_handler(struct ctx *c, unsigned int qpair, const struct timespec *now); +void tap_add_packet(struct ctx *c, unsigned int qpair, struct iov_tail *data, const struct timespec *now); #endif /* TAP_H */ diff --git a/tcp.c b/tcp.c index c400075440c9..c127b3132e5a 100644 --- a/tcp.c +++ b/tcp.c @@ -2227,7 +2227,7 @@ static void tcp_rst_no_conn(const struct ctx *c, int af, tcp_update_csum(psum, rsth, &payload, 0); rst_l2len = ((char *)rsth - buf) + sizeof(*rsth); - tap_send_single(c, buf, rst_l2len); + tap_send_single(c, QPAIR_DEFAULT, buf, rst_l2len); } /** diff --git a/udp.c b/udp.c index c28d6ee2b691..a295cb0e97cf 100644 --- a/udp.c +++ b/udp.c @@ -445,7 +445,7 @@ static void udp_send_tap_icmp4(const struct ctx *c, /* Try to obtain the MAC address of the generating node */ saddr_any = inany_from_v4(saddr); fwd_neigh_mac_get(c, &saddr_any, tap_omac); - tap_icmp4_send(c, saddr, eaddr, &msg, tap_omac, msglen); + tap_icmp4_send(c, QPAIR_DEFAULT, saddr, eaddr, &msg, tap_omac, msglen); } @@ -493,7 +493,7 @@ static void udp_send_tap_icmp6(const struct ctx *c, /* Try to obtain the MAC address of the generating node */ fwd_neigh_mac_get(c, (union inany_addr *) saddr, tap_omac); - tap_icmp6_send(c, saddr, eaddr, &msg, tap_omac, msglen); + tap_icmp6_send(c, QPAIR_DEFAULT, saddr, eaddr, &msg, tap_omac, msglen); } /** diff --git a/vu_common.c b/vu_common.c index 8b555ea9a8b1..6aa1ba768136 100644 --- a/vu_common.c +++ b/vu_common.c @@ -200,11 +200,12 @@ static void vu_handle_tx(struct vu_dev *vdev, int index, data = IOV_TAIL(elem[count].out_sg, elem[count].out_num, 0); if (IOV_DROP_HEADER(&data, struct virtio_net_hdr_mrg_rxbuf)) - tap_add_packet(vdev->context, &data, now); + tap_add_packet(vdev->context, QPAIR_FROM_QUEUE(index), + &data, now); count++; } - tap_handler(vdev->context, now); + tap_handler(vdev->context, QPAIR_FROM_QUEUE(index), now); if (count) { int i; -- 2.54.0