From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTP id 69FEA5A0275 for ; Sun, 13 Aug 2023 18:31:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691944307; 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=UXC2wOFlCgfHqd5RK9ZnxtdFuw9UO+5tOF4hRWJRdCY=; b=V77E5Evf9jHlefMzrsfHL/xGAajlwfPPs8wTI4qNjoH5CMAvhs+JQglu/q8eNI7eBWPGsh RXyyhS7Ga/sqMLjP3QXbhf/0WJzl286K6NB7TMVAXj9QJureVXvDa2daJqri+g8TUfmbwP kg+0E3gwBPpRWyybuaidEllc1Z1u9Vg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-393-pcZwMUsRMDqepFWCedIX6g-1; Sun, 13 Aug 2023 12:31:45 -0400 X-MC-Unique: pcZwMUsRMDqepFWCedIX6g-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 11CEF80557A; Sun, 13 Aug 2023 16:31:45 +0000 (UTC) Received: from elisabeth (unknown [10.39.208.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3443F492B0F; Sun, 13 Aug 2023 16:31:44 +0000 (UTC) Date: Sun, 13 Aug 2023 18:31:42 +0200 From: Stefano Brivio To: Laurent Vivier Subject: Re: [PATCH] tap: fix seq->p.count limit Message-ID: <20230813183142.30a8a4e6@elisabeth> In-Reply-To: <20230813151737.7c3754fd@elisabeth> References: <20230809092342.2299907-1-lvivier@redhat.com> <20230813151737.7c3754fd@elisabeth> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 4RFIWNXAA2EYGW6NKBSFIMS6IZOMBU6D X-Message-ID-Hash: 4RFIWNXAA2EYGW6NKBSFIMS6IZOMBU6D X-MailFrom: sbrivio@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: passt-dev@passt.top, David Gibson 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: On Sun, 13 Aug 2023 15:17:37 +0200 Stefano Brivio wrote: > On Wed, 9 Aug 2023 11:23:42 +0200 > Laurent Vivier wrote: > > > The number of items in pool_l4_t is defined to UIO_MAXIOV, > > not TAP_SEQS. TAP_SEQS is the number of the messages. > > ...sequences of packets (within the same connection), rather than > "messages" (which might sound like packets). > > > Fix the value used to compare seq->p.count with. > > > > Fix: bb708111833e ("treewide: Packet abstraction with mandatory boundary checks") > > Signed-off-by: Laurent Vivier > > I was wondering why throughput tests on the tap path, namespace to > host, started failing miserably with this (0.4 Gbps instead of 7 Gbps > with small packets). > > It turned out that yes, the pool has UIO_MAXIOV items, but (also by > mistake in some sense) we initialised only the first TAP_SEQS ones. This > fixes it: > > diff --git a/tap.c b/tap.c > index 7d5dd6a..a6f8692 100644 > --- a/tap.c > +++ b/tap.c > @@ -1258,8 +1258,8 @@ void tap_sock_init(struct ctx *c) > pool_tap6_storage = PACKET_INIT(pool_tap6, TAP_MSGS, pkt_buf, sz); > > for (i = 0; i < TAP_SEQS; i++) { > - tap4_l4[i].p = PACKET_INIT(pool_l4, TAP_SEQS, pkt_buf, sz); > - tap6_l4[i].p = PACKET_INIT(pool_l4, TAP_SEQS, pkt_buf, sz); > + tap4_l4[i].p = PACKET_INIT(pool_l4, UIO_MAXIOV, pkt_buf, sz); > + tap6_l4[i].p = PACKET_INIT(pool_l4, UIO_MAXIOV, pkt_buf, sz); > } > > if (c->fd_tap != -1) { /* Passed as --fd */ > > ...I would simply apply it on top. Applied (with this change), thanks! -- Stefano