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=OTjDNaGW; 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 B2F235A0278 for ; Thu, 24 Jul 2025 16:30:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1753367457; 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=stEg4xXrTVOzI4wIIy8gt4qc0UmjV60V7gVvNOZcPGU=; b=OTjDNaGWKePgNTthDxdwWvW+a7BcAh9cpFUh1yO/kN6q3QiIRzYRoNPrxSuY9gLQYbmY6b wLMCaf2HoHgoDWKDmk8O44NFf7kQQTzNQ4nB0Ureo3N79CH2kbFFpNuQigq+MTKjuVNsMz X+7tdh1k/IAKITNu1haadSVKk7jNxns= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-264-blluHBpWNCu7phmnAk4cLw-1; Thu, 24 Jul 2025 10:30:55 -0400 X-MC-Unique: blluHBpWNCu7phmnAk4cLw-1 X-Mimecast-MFC-AGG-ID: blluHBpWNCu7phmnAk4cLw_1753367454 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-45624f0be48so5841935e9.3 for ; Thu, 24 Jul 2025 07:30:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753367454; x=1753972254; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=yOO5g6lHNHxj0cYd3fXkZzC8prHtLXBCxAIvx8d+9hs=; b=uMz5lPQDXxEDg2qupTAOTsASe/pPtjKmksI0JcjYMoJNXeCuow6HASgmbQhqGvKs8+ xhWSaBjkMtNYu0U6ex2uoo4x7dEcaTm0l6yKpdZMhuVSg1zSD1tWoQzuExAXbjwYBhJk zLtwP6bs5IEYKY7x9Bza3c1uvfbpnjYirNwQpg8v0O9+zzJmkjegXxIv9rhrvyXd3b1S 9HssoiiV7PXa8LHPViLozVFguuqOU6UhQ9yZ2yHwsbLynSZHLnboJSgALWUdRwqp1f0q dr6+t+oA+uZQXDIwYJklriXYnCRsynMPQi7Z1BTleJ9Hjo5v50jNtf2bljOmUOKcHn0G JBmg== X-Forwarded-Encrypted: i=1; AJvYcCXsVLMyq7c/YvnlB6LLTrkMRQCjAQbWcgXk9wdsKA30PMLOUeE3XbtmEYVxufKJC1tImq/ARgeNBnk=@passt.top X-Gm-Message-State: AOJu0YwqPbUWQKLc/bF+6xV6wtnc66+Q5Svt66WttwYNcbdYEfwUvfHy J9iDhUHR2m9zEwbqLmB2EL8yMhDfbYQI0cRwQvzCU+rLhCfddZEftRpIAOEt38N52FuCnW0tV9+ JDrEb0Ca+W2KR58E6LRG8xXjiDoLNgRv5vDp8Gbw1L1UA8yd40r6iRg== X-Gm-Gg: ASbGncuZXQMN650STDCnIU6jVLcsDS9eFyENRI6yYF0OxeW+PAmFdAWUilVgAtgRodX Ab/JwNrgmffcvUy3BBnKXwGjmYux0Jn+bCISFkKmV0Kx+W74Yt6aeyQfcCdmqZR/MVR70z9lv55 nhvaZ6L4DhOlnqe9sQFp8bUwVEqLSks/IgmjV7nlFmXeu4+nvSUhJlAvP7uB9j+ALWcDvcJcL6V rZjzIdJInW6ywYih+LHUOAx5WJ3F6FKMz7OV02bMtAb1VNvMyFB1yE6kgHtLx9TTLBVRyuu/5E1 FCZy2wWKqlmiJ660iR50GnW0yKpJqo09YNyuJ4QYRvvXPCxawkdxLlR0otoIZz67Fky2 X-Received: by 2002:a05:600c:37c8:b0:456:1824:4808 with SMTP id 5b1f17b1804b1-45868d82612mr58792795e9.32.1753367453737; Thu, 24 Jul 2025 07:30:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGTg2sxrrdAk7eiTcY4ZpFMwj6dCkV0OGSBnrnNSTGGxfCeU91HeqvZTfbXCp3J1oXRbXxPMg== X-Received: by 2002:a05:600c:37c8:b0:456:1824:4808 with SMTP id 5b1f17b1804b1-45868d82612mr58792445e9.32.1753367453264; Thu, 24 Jul 2025 07:30:53 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45870568fb1sm22014885e9.27.2025.07.24.07.30.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Jul 2025 07:30:52 -0700 (PDT) Date: Thu, 24 Jul 2025 16:30:50 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [RFC v2 07/11] tap: support tx through vhost Message-ID: <20250724163050.170c18c4@elisabeth> In-Reply-To: References: <20250709174748.3514693-1-eperezma@redhat.com> <20250709174748.3514693-8-eperezma@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: nNxnNdFNXs0GIhSR7PV1dTbTsg6KJzl2aIAxlHSf0_c_1753367454 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: H4DXPAZ374A47RPCTPDVWVTF4TW2MMWA X-Message-ID-Hash: H4DXPAZ374A47RPCTPDVWVTF4TW2MMWA 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: Eugenio =?UTF-8?B?UMOpcmV6?= , passt-dev@passt.top, jasowang@redhat.com 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: Silly comments only: On Thu, 24 Jul 2025 10:24:39 +1000 David Gibson wrote: > On Wed, Jul 09, 2025 at 07:47:44PM +0200, Eugenio P=C3=A9rez wrote: > > No users enable vhost right now, just defining the functions. > >=20 > > The use of virtqueue is similar than in rx case. fills the descriptor > > table with packet data it wants to send to the namespace. Each > > descriptor points to a buffer in memory, with an address and a length. > > The number of descriptors is again defined by VHOST_NDESCS. =20 >=20 > Does the number of descriptors have to be equal for the Tx and Rx > queues? For Rx, the number of descriptors is basically determined by > how many frames we can fit in pkt_buf. That doesn't really apply to > the Tx path though, it would be more natural to define the number of > Tx descriptors independently. >=20 > > Afterwards it writes the descriptor index into the avail->ring[] array, > > then increments avail->idx to make it visible to the kernel, then kicks > > the virtqueue 1 event fd. > >=20 > > When the kernel does not need the buffer anymore it writes its id into > > the used_ring->ring[], and increments used_ring->idx. Normally, the > > kernel also notifies pasta through call eventfd of the virtqueue 1. > > But we don't monitor the eventfd. Instead, we check if we can reuse th= e > > buffers or not just when we produce, making the code simpler and more > > performant. =20 >=20 > Oh, that's pretty neat. >=20 > Nit: s/performant/performent/ Actually, "performent" (which I had never heard before) seems to be an archaic term for "performance": https://www.oed.com/dictionary/performent_n whereas "performant": https://en.wiktionary.org/wiki/performant seems to be fitting here (as much as I'd favour "efficient" instead, because it actually sounds like a real word ;)). --=20 Stefano