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=HeHuiuiy; 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 A90375A0265 for ; Sun, 10 May 2026 03:33:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778376831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v0u5l83hWc3Px1lS2UGLg0A74Bsnz7XqOFKQzOgQN2g=; b=HeHuiuiyPPbxQMNV89ubUiZzNMiuDTIV0TsZaHg9HqFrkngsmJnQnSopcE/+zxJoovEw3l R7y+cAcz+OxCK1sbo1wdpGg3ncTuwQRZerh2S9QmICxYaG8qChnocHBl3hANJFghmFk2CY f26eMRG73AO3G1h8YvjVMI+GNsiL1L8= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-218-NI5eew6oP-GGDMMLFM3Ekg-1; Sat, 09 May 2026 21:33:50 -0400 X-MC-Unique: NI5eew6oP-GGDMMLFM3Ekg-1 X-Mimecast-MFC-AGG-ID: NI5eew6oP-GGDMMLFM3Ekg_1778376830 Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-514b673c8f1so4623601cf.3 for ; Sat, 09 May 2026 18:33:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778376830; x=1778981630; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=v0u5l83hWc3Px1lS2UGLg0A74Bsnz7XqOFKQzOgQN2g=; b=bqZH0Y0psdj3MWHQ6xxDkVqgWUADosp7mVdmXp1u8LL7tz/b+romc0xyEGxmYy+kdr bTdLqdXZxTJlOEvH0ZBbYIQVDkZ490mMxNsOyDkcuyPbw+fPB2xjfR7elY3Rde7JyoSS MZ3q/dNIuUQ/1qtOePWG/vx/k80t5EbbbZ+sYPe4Xfbv/ViJM6lKPjQw0Qb5EaLyVdFg 0L/ofMHCYgYdOH7Tt9e+ccDRg9XTKLDocUOkcKM/Q/hy2ZCd7IqoVGrThfJTb0JukG25 6WmC0yZxFXugEOWtgAlCxUcQzYum/f5vlBUWzPgmPuSzBIj4YMLM7RZmICyPDVRWhPMs FBXg== X-Forwarded-Encrypted: i=1; AFNElJ8xpmgITLgVLIC/VuJYtkTwRlI2nVThNEd7CU8jqLU3FaPUUsCJK5YIpRYVVpnxnPeXlPvUlCJmPT0=@passt.top X-Gm-Message-State: AOJu0YyL9PZanWYYISjlpXR8cLf+kXuWoBp9mmiCj5cq49TE4bqo0PTs FogzhQMAKSOmNS40pUdtajqK7MzNtDsHMyAMUig8hpz2ZZAUkwwRmGmigPLQPR9P4yPHiXMlWTU ZaXaUtBXEVijkoIS4uvr2hwa9HghMlUSHKgOYo96+es5eZc6l2D1FPQ== X-Gm-Gg: Acq92OGvdb2ea5OvAKo9E9i3VFl53OywJI+the2HhRaK/sWZ9qPBJA+BXrUumqhlmIj Ld1RNFVMyFs8Iz0lkdBJ6cPVoUvPyfNNESUxJuP98zbs0P3Gd9uRspggZkCot4f1w6EoKdnruxQ vWD6GNwCJU1/cqcn/YL37n/VL3XUxF5YPon1VRxcDRyPCuJvveR4Uc//ZvgKXgnahN0pBx5mBKI okHABSCAT8Peu2RNvnxzeVrKnewXZ9x3NrYpV18nmvHmeymOyWz9Pnwl7kP+ZxBUp1y0qgtnubV tuBIjHNEcM+zVTF9zO46r9NSaOIXn0cyUixeiDrBgkfZR0HF9AG2JkH89//ZGC78jqluH0eTHjm /SRyqGUbMN3obVM7WHFDJ3tvP11omN6MDJaghA/q+WaOXs0LmqLzKiOs8ss21UyZZPxo/9CDg8S BUunilDKQj27vy X-Received: by 2002:ac8:7dc4:0:b0:510:1ae7:88b3 with SMTP id d75a77b69052e-51461c1dbd8mr260279441cf.4.1778376829744; Sat, 09 May 2026 18:33:49 -0700 (PDT) X-Received: by 2002:ac8:7dc4:0:b0:510:1ae7:88b3 with SMTP id d75a77b69052e-51461c1dbd8mr260279281cf.4.1778376829347; Sat, 09 May 2026 18:33:49 -0700 (PDT) Received: from [192.168.2.15] (lnsm4-toronto63-142-116-28-118.internet.virginmobile.ca. [142.116.28.118]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-5148e655d65sm55991391cf.8.2026.05.09.18.33.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 09 May 2026 18:33:49 -0700 (PDT) Message-ID: <959ac067-404b-4a89-9988-11d151337f69@redhat.com> Date: Sat, 9 May 2026 21:33:48 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 3/4] tcp_vu: Support multibuffer frames in tcp_vu_sock_recv() To: Laurent Vivier , passt-dev@passt.top References: <20260416161618.3826904-1-lvivier@redhat.com> <20260416161618.3826904-4-lvivier@redhat.com> From: Jon Maloy In-Reply-To: <20260416161618.3826904-4-lvivier@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: w3TiI1B0JrJ_a_O_9X_qXYt6h3CLHTL442olFS9eEO0_1778376830 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID-Hash: PQDWQJ4FJEAEKSMFU7QUBUDM3YFJWP2T X-Message-ID-Hash: PQDWQJ4FJEAEKSMFU7QUBUDM3YFJWP2T X-MailFrom: jmaloy@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 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 2026-04-16 12:16, Laurent Vivier wrote: > Previously, tcp_vu_sock_recv() assumed a 1:1 mapping between virtqueue > elements and iovecs (one iovec per element), enforced by an ASSERT. > This prevented the use of virtqueue elements with multiple buffers > (e.g. when mergeable rx buffers are not negotiated and headers are > provided in a separate buffer). > [...] > - if (dlen > len) > - dlen = len; > - len -= dlen; > + dlen = frame[i].size - hdrlen; > > /* The IPv4 header checksum varies only with dlen */ > if (previous_dlen != dlen) > check |= IP4_CSUM; > previous_dlen = dlen; > > - tcp_vu_prepare(c, conn, iov, buf_cnt, dlen, &check, push); > + tcp_vu_prepare(c, conn, iov, iov_cnt, dlen, &check, push); > > - vu_pad(elem[head[i]].in_sg, buf_cnt, dlen + hdrlen); > - vu_flush(vdev, vq, &elem[head[i]], buf_cnt, dlen + hdrlen); > + vu_pad(&iov[frame[i].idx_iovec], frame[i].num_iovec, > + dlen + hdrlen); This doesn't look right. iov is already &iov_vu[frame[i].idx_iovec], set a few lines further up this patch. I suspect your intention is to access it the way you do in tcp_vu_prepare: vu_pad(iov, iov_cnt, dlen + hdrlen); /jon > > if (*c->pcap) { > - pcap_iov(iov, buf_cnt, VNET_HLEN, > + pcap_iov(iov, iov_cnt, VNET_HLEN, > dlen + hdrlen - VNET_HLEN); > } > + vu_flush(vdev, vq, &elem[frame[i].idx_element], > + frame[i].num_element, dlen + hdrlen); > > conn->seq_to_tap += dlen; > }