From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: passt.top; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=D7Rt+5xi; dkim-atps=neutral Received: from mail-wm2-x10.google.com (mail-wm2-x10.google.com [IPv6:2a00:1450:4864:31::10]) by passt.top (Postfix) with ESMTPS id 5E8FB5A0265 for ; Sat, 12 Sep 2026 12:58:00 +0200 (CEST) Received: by mail-wm2-x10.google.com with SMTP id 5b1f17b1804b1-49e620fa473so2001785e9.1 for ; Sat, 12 Sep 2026 03:58:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789210680; x=1789815480; darn=passt.top; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-type:content-transfer-encoding:mime-version:from:to:cc :subject:date:message-id:reply-to:content-type; bh=zha+cUW7uGl7FXotB4bbFoAhWtyuotvUDU/aHyhoj7U=; b=D7Rt+5xiSx7PFi93BOVKT0lmWXhpjUJIdccYxD/rzaNHNn8xPR+e1NuWopkV/9ZQcD T8wjhRXJpi/DUWQBHjS8d8X4QBO/Kb9PNxOZTnsIyFpArcxPgW68hayvgBvhBe7VP5m9 f6m0IGKNR0IX/ay8d8WmIQ15zA7sF2YFEKk49Vhf4gFmmWiBdnWvxK0WU6W5fMb7qfiM +xxQXnjYnB+33H7Qx2gpBrROYdlSkptg5VUqQKu+OROiiy1oO8WTO/1D+93nNRxgrjYO tZ0cWjtaZqAKLIN31CjBFM2icivAGI1QTTSfiWhaxmdcffGcedwRE9zzAnUye8Wt4Y9Z gMYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789210680; x=1789815480; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-type:content-transfer-encoding:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=zha+cUW7uGl7FXotB4bbFoAhWtyuotvUDU/aHyhoj7U=; b=CIaAWFnQcQvC1zvwqujUxgpK5frQVgqgfdLpbYYgbybKN2rqwjKZ1SQop9Mi16VBqy xRByTy2Tnr/XNYqVciPsLehSSIu16h8Tm6gfkhjfBVhuoiSh/1rjk6viZzmrT5KZW18+ Zgs3i+7aVw2BNd5LU8hxxAu3XVSplycQhdK1neyN85K2Tf8V2nLF0OlQ3w3fXVO2fAsP ONYZfJro1VADbpSP+y4FxY2c0fxQHe8Liv3Xj/gueCqg2V76pMgV9WpTSGxF+glocOUS NKgY5p4DMW6A9c8sigEb2jxK0GgzIJjq3LHVZAAaoWz5voXkhZuBf2JxCPFfw3nnxF90 TgtQ== X-Forwarded-Encrypted: i=1; AKwUvBx5qz+07cXropfIBAWIxIh4LqjixUQzYBC1aVRlwvPDy5DP8OqA1b0xY49V4lduMXq4XRqd21kOt1U=@passt.top X-Gm-Message-State: AFuF++nE28sAJGzpwyb97bVIHwMD7sErx3kjwhmsD5d+oQ2OeuoJ3qAn g+hKipnV+TCBdTL8Ec1wbH8gw1ogSvvA9Sfzd+oNLQvRrv6EJHPMybmT X-Gm-Gg: AYBFou3jWUWJiNiChdxQIfJMkmVusG2cPtOTPrKgc+qRBWkahEuR2Zg22TAJuiAlm4G f7L4aoo5FSPMcd7JJpbq81GGp8hcB7f1mULXTgTih1StDrpFPAGup+d2I+/ZgBahXiEY0XxgkW9 ZAC1gV/7ujpLTbgDhXkGXhvuuZriHrgeBV06ObnDhqePD7iDmbsAa/uEbVaq76nseIKaP8k/cdn AinCiXxaCCpMP2eOi0RfbN2mETZsuO61Vnbmy9xDw4Wbf2holFr9jcVPwtkja9lJUli9wVfnkfb 1kF7wT1iudOYaGT4POLnPwyxljuBLKW9RdI9AhggCeoENQPA+7ojuH8CraGabdFnvPpkGiezeIu Rd70NqNnxNDIlqSRRoieH7vey657c4EIaUA27SbiKzPaZ3tjZzoswDmRr4xFpACQ1U7UJv7YsN/ zx8nW2TaZdDF+AvFp2K2A6tfUTDLssVn3HEGNKnhTmISzj9+CijjiUaK629czcNSu8Rpn1l7xBO 2+sTvw6GrVMO1pQY1Vc3gIlhLB+1o3hT4ZLt+t5yPA= X-Received: by 2002:a05:600c:4f87:b0:49c:dca2:ac47 with SMTP id 5b1f17b1804b1-49e6ca9085cmr18888235e9.2.1789210679471; Sat, 12 Sep 2026 03:57:59 -0700 (PDT) Received: from localhost ([196.153.185.185]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-486eb2ecf2esm13199462f8f.2.2026.09.12.03.57.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 12 Sep 2026 03:57:59 -0700 (PDT) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sat, 12 Sep 2026 13:57:57 +0300 Message-Id: Subject: Re: [PATCH 2/7] conf: Add context fields, epoll types and --vhost-kernel flag to pasta From: "Ammar Yasser" To: "Laurent Vivier" , "aerosouund" , X-Mailer: aerc 0.21.0 References: <20260904212826.41027-1-aerosound161@gmail.com> <20260904212826.41027-3-aerosound161@gmail.com> <5048eb43-caa2-46ae-839f-696e05e02ebf@redhat.com> In-Reply-To: <5048eb43-caa2-46ae-839f-696e05e02ebf@redhat.com> Message-ID-Hash: X235VDIPBUAVCCN4X6IG4VUY57KD7CQC X-Message-ID-Hash: X235VDIPBUAVCCN4X6IG4VUY57KD7CQC X-MailFrom: aerosound161@gmail.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: eperezma@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: On Wed Sep 9, 2026 at 3:35 PM EEST, Laurent Vivier wrote: > On 9/4/26 23:28, aerosouund wrote: >> From: Ammar Yasser >> + * The only structural limit the QEMU socket protocol imposes on frames= is >> + * (2^32-1) bytes, but that would be ludicrously long in practice. For= now, >> + * limit it somewhat arbitrarily to 65535 bytes. FIXME: Work out an ap= propriate >> + * limit with more precision. >> + */ >> +#define L2_MAX_LEN_PASST USHRT_MAX >> + >> +/** L2_MAX_LEN_VU - Maximum frame length for vhost-user mode (with L2 h= eader) >> + * >> + * vhost-user allows multiple buffers per frame, each of which can be q= uite >> + * large, so the inherent frame size limit is rather large. Much large= r than is >> + * actually useful for IP. For now limit arbitrarily to 65535 bytes. F= IXME: >> + * Work out an appropriate limit with more precision. >> + */ >> +#define L2_MAX_LEN_VU USHRT_MAX >> + >> +/* Number of descriptors in each vhost-net virtqueue */ >> +#define VHOST_NDESCS 128 >> + >> +/* Bytes of pkt_buf backing one from-guest descriptor: a maximum size f= rame >> + * plus the virtio-net header the kernel writes in front of it >> + */ >> +#define VHOST_DESC_BYTES (L2_MAX_LEN_PASTA + \ >> + sizeof(struct virtio_net_hdr_mrg_rxbuf)) >> + >> +/* One maximum size frame per vhost-net descriptor */bbb >> +#define PKT_BUF_BYTES (VHOST_NDESCS * VHOST_DESC_BYTES) > > 128 * (65535 + 12) =3D 8390016 > > but we have in passt.c > > madvise(pkt_buf, sizeof(pkt_buf), MADV_HUGEPAGE); > > originaly we had: > > 2dbed699e78e ("passt: Align pkt_buf to PAGE_SIZE (start and size), try to= fit in huge pages") > > And your change is reverting the logic of: > > b6945e055376 ("Simplify sizing of pkt_buf") > Hmm, i see the reasoning behind why it was this way before now. Generally speaking, i think it's pretty unlikely that the there will be a time where the packet buffer will be completely full (the kernel queued 128 packets and i didn't process any). Only in this case would the fact that this buffer is 8MB and doesn't have space for the virtio_net_mrg_rxbuf cause problems. So maybe we can just put it back to be 8MB. what do you think ? > >> + ret.iov_len =3D sizeof(struct virtio_net_hdr_mrg_rxbuf); >> + } else { >> + ret.iov_len =3D c->mode =3D=3D MODE_PASST ? sizeof(thdr->vnet_len) : = 0; >> + }; > > no need for the semicolon. > > This change should be in PATCH 1 This won't work unfortunately. Since this change depends on the fields added to the context. the c->vhost.fd field > >> + >> + return ret; >> } >> =20 >> /**