From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E457B46091; Wed, 15 Jan 2025 13:59:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3A1C8402F0; Wed, 15 Jan 2025 13:59:53 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 19813402ED for ; Wed, 15 Jan 2025 13:59:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1736945991; 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=sHjqmmfPMtTgsaJoKl5LirPD270cC+rPrGGQOO++f24=; b=G96BiPIlvoM59FLmzk6spDN2bhZJuuiXOSU/JTLJ5CnaMhZM+jzHiZA/XUF8BdnZo2pl+E hm4aJjzIdz7y5PBF0rlFKkLQFHqzeX7kLSQSuaZH1SKZr+ZqHfD31GRCOTP/VQ3viJv045 H+rbB1kjEKCE6h73A0bHlY/D2XNbiig= 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-517-NvyLQ7AEPLOfA6yqbmObZQ-1; Wed, 15 Jan 2025 07:59:48 -0500 X-MC-Unique: NvyLQ7AEPLOfA6yqbmObZQ-1 X-Mimecast-MFC-AGG-ID: NvyLQ7AEPLOfA6yqbmObZQ Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 8A01E196E05B; Wed, 15 Jan 2025 12:59:47 +0000 (UTC) Received: from max-p1.redhat.com (unknown [10.39.208.25]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 753F819560AA; Wed, 15 Jan 2025 12:59:45 +0000 (UTC) From: Maxime Coquelin To: dev@dpdk.org, david.marchand@redhat.com, chenbox@nvidia.com Cc: Maxime Coquelin , stable@dpdk.org Subject: [PATCH v2 1/4] vhost: fix missing packets count reset when not ready Date: Wed, 15 Jan 2025 13:59:35 +0100 Message-ID: <20250115125938.2699577-2-maxime.coquelin@redhat.com> In-Reply-To: <20250115125938.2699577-1-maxime.coquelin@redhat.com> References: <20250115125938.2699577-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: EaQSxiKvUHJV6VInuQ6PdSkiRYqJ-nOyaA3-VBjcxuA_1736945987 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org This patch fixes the rte_vhost_dequeue_burst return value when the virtqueue is not ready. Without it, a discrepancy between the packet array and its size is faced by the caller of this API when the virtqueue is not ready. Fixes: 9fc93a1e2320 ("vhost: fix virtqueue access check in datapath") Cc: stable@dpdk.org Signed-off-by: Maxime Coquelin --- lib/vhost/virtio_net.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c index 69901ab3b5..a340e5a772 100644 --- a/lib/vhost/virtio_net.c +++ b/lib/vhost/virtio_net.c @@ -3629,6 +3629,8 @@ rte_vhost_dequeue_burst(int vid, uint16_t queue_id, rte_rwlock_read_unlock(&vq->access_lock); virtio_dev_vring_translate(dev, vq); + + count = 0; goto out_no_unlock; } -- 2.47.1