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 442905A0271 for ; Sun, 13 Aug 2023 15:17:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691932673; 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=uHN83AIOPs3IKxRzmnSA3iSJSMcKXB0QKI4gn/OnpZk=; b=Cai16jNV5PbV4JZtc9wfCnmdlweJdPlRP4iHWZ6eOk5w5nw4R0sIOios42ZGwtZmSs8QuM 1JepPoBgRIvdsHqy7DO8JLvjTbjAzqypqtw1YNx+jG/zRtcLv995anEHk7IE6goC+qDcWL owXOW2LTMuAZKk+1C+pw9UQL8C0DSh8= 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-163-KBwyxTFJPJmXlAgABtBx-Q-1; Sun, 13 Aug 2023 09:17:51 -0400 X-MC-Unique: KBwyxTFJPJmXlAgABtBx-Q-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2E795101A528; Sun, 13 Aug 2023 13:17:51 +0000 (UTC) Received: from elisabeth (unknown [10.39.208.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 09D88C15BAD; Sun, 13 Aug 2023 13:17:49 +0000 (UTC) Date: Sun, 13 Aug 2023 15:17:37 +0200 From: Stefano Brivio To: Laurent Vivier Subject: Re: [PATCH] tap: fix seq->p.count limit Message-ID: <20230813151737.7c3754fd@elisabeth> In-Reply-To: <20230809092342.2299907-1-lvivier@redhat.com> References: <20230809092342.2299907-1-lvivier@redhat.com> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: PB5XH7YBHUT6TRDYHE4Q2YZR2NN2S4D7 X-Message-ID-Hash: PB5XH7YBHUT6TRDYHE4Q2YZR2NN2S4D7 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 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. -- Stefano