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=gC3NpKmI; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id CA64C5A061A for ; Fri, 31 Jul 2026 18:16:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1785514588; 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=NVJEr7S9ouSrgNUdYp/5RC3xJKFd+yHPNXKflBKrl3w=; b=gC3NpKmIGy+Kccmb+z5gbD0cIwiXhG/aorrcaKRa+JazRVf4KSWSe9cmFgtvQLTW9uCfmY kGknO97YthohXhvxRr+0g2TO1UZo73lT0Bd8spPEuMc9j1yYaXP9n5oUwO1iyS8FUo64kd 0xzByR/hecNkrFVYaaZP5DbLbtA8NQk= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-117-VpMUfI1EP4GWLIxtCvXTEA-1; Fri, 31 Jul 2026 12:16:27 -0400 X-MC-Unique: VpMUfI1EP4GWLIxtCvXTEA-1 X-Mimecast-MFC-AGG-ID: VpMUfI1EP4GWLIxtCvXTEA_1785514586 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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7AF4C1800473 for ; Fri, 31 Jul 2026 16:16:26 +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 B8B791800480; Fri, 31 Jul 2026 16:16:25 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH v6 05/12] arp: Pass queue pair explicitly through ARP send path Date: Fri, 31 Jul 2026 18:16:10 +0200 Message-ID: <20260731161617.3550626-6-lvivier@redhat.com> In-Reply-To: <20260731161617.3550626-1-lvivier@redhat.com> References: <20260731161617.3550626-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: osasc0hzct2LmE7-MjNhMR8tlSi9ZzjcgdMTRkxm0Eg_1785514586 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true Message-ID-Hash: H42MOOEBILTW7P4RPGLXMBHQNG6WBQOZ X-Message-ID-Hash: H42MOOEBILTW7P4RPGLXMBHQNG6WBQOZ 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: Add a qpair parameter to arp(), forwarding it to tap_send_single() instead of hardcoding QPAIR_DEFAULT, so replies go out on the same queue pair the request arrived on. arp_send_init_req() and arp_announce() are unsolicited, low-volume messages with no meaningful queue pair context, so they hardcode QPAIR_DEFAULT internally. No functional change. Signed-off-by: Laurent Vivier --- arp.c | 5 +++-- arp.h | 2 +- tap.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/arp.c b/arp.c index e97c4de86a99..a12b50ff8439 100644 --- a/arp.c +++ b/arp.c @@ -63,11 +63,12 @@ static bool ignore_arp(const struct ctx *c, /** * arp() - Check if this is a supported ARP message, reply as needed * @c: Execution context + * @qpair: Queue pair on which to send the reply * @data: Single packet with Ethernet buffer * * Return: 1 if handled, -1 on failure */ -int arp(const struct ctx *c, struct iov_tail *data) +int arp(const struct ctx *c, unsigned int qpair, struct iov_tail *data) { union inany_addr tgt; struct { @@ -112,7 +113,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, QPAIR_DEFAULT, &resp, sizeof(resp)); + tap_send_single(c, qpair, &resp, sizeof(resp)); return 1; } diff --git a/arp.h b/arp.h index 4b1f38bcec9b..5872b535635a 100644 --- a/arp.h +++ b/arp.h @@ -22,7 +22,7 @@ struct arpmsg { unsigned char tip[4]; } __attribute__((__packed__)); -int arp(const struct ctx *c, struct iov_tail *data); +int arp(const struct ctx *c, unsigned int qpair, struct iov_tail *data); void arp_send_init_req(const struct ctx *c); void arp_announce(const struct ctx *c, struct in_addr *ip, const unsigned char *mac); diff --git a/tap.c b/tap.c index 206a1c36b779..928cf5c086ee 100644 --- a/tap.c +++ b/tap.c @@ -727,7 +727,7 @@ resume: if (!eh) continue; if (ntohs(eh->h_proto) == ETH_P_ARP) { - arp(c, &data); + arp(c, qpair, &data); continue; } -- 2.54.0