From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=none 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=Ddy8/i4I; dkim-atps=neutral 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 AB08A5A061D for ; Wed, 04 Dec 2024 16:33:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733326406; 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; bh=QZQdTzY+jOtXibFlwacP18NAWmI1V1mqlQ/6OnBewD4=; b=Ddy8/i4I7VErB/3bLAP/Te9Q201d01SkV2jqHu+86TBAZVz5Bta0+gsqKfOq4OUSvs4Uzi yBPLjQ+a0up+gXoo1ZCtim7krc48RBNZi5uIDGu0SrToLn/4sZAZ6QR8oOyBBTVrPBkftX o0EOUFXKM2CPeWu3WPhbuRvsSQhF/E0= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-533-InQJLJ0uMf6J23hw0FIF8g-1; Wed, 04 Dec 2024 10:33:24 -0500 X-MC-Unique: InQJLJ0uMf6J23hw0FIF8g-1 X-Mimecast-MFC-AGG-ID: InQJLJ0uMf6J23hw0FIF8g Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 89F00195605C for ; Wed, 4 Dec 2024 15:33:23 +0000 (UTC) Received: from lenovo-t14s.redhat.com (unknown [10.39.192.237]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 894FB300019E; Wed, 4 Dec 2024 15:33:22 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH] udp_vu: update segment size Date: Wed, 4 Dec 2024 16:33:21 +0100 Message-ID: <20241204153321.87117-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: b-Yu3a-K9oPlfld_-twCMBAoirg7uL_1lNNQ7jENbRY_1733326403 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true Message-ID-Hash: 6GCK3B6UZ2OB2JNNJAXQYKLHMZ2R2RO6 X-Message-ID-Hash: 6GCK3B6UZ2OB2JNNJAXQYKLHMZ2R2RO6 X-MailFrom: lvivier@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: Laurent Vivier 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: In udp_vu_sock_recv(), collect a segment with a size defined to IP_MAX_MTU + ETH_HLEN + sizeof(struct virtio_net_hdr_mrg_rxbuf) Signed-off-by: Laurent Vivier --- udp_vu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/udp_vu.c b/udp_vu.c index 9c697f3be247..41235101b69e 100644 --- a/udp_vu.c +++ b/udp_vu.c @@ -104,7 +104,8 @@ static int udp_vu_sock_recv(const struct ctx *c, int s, uint32_t events, vu_init_elem(elem, iov_vu, VIRTQUEUE_MAX_SIZE); iov_cnt = vu_collect(vdev, vq, elem, VIRTQUEUE_MAX_SIZE, - IP_MAX_MTU - sizeof(struct udphdr) + hdrlen, + IP_MAX_MTU + ETH_HLEN + + sizeof(struct virtio_net_hdr_mrg_rxbuf), NULL); if (iov_cnt == 0) return 0; -- 2.47.0