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 DAE754608F; Wed, 15 Jan 2025 11:29:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 68A30402DA; Wed, 15 Jan 2025 11:29:17 +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 B00124003C for ; Wed, 15 Jan 2025 11:29:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1736936955; 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=aYGU3RI9UzU4pxPgJj+awTxND2O2329wzUmaxCnh1OmEiGo/vJKNE0x0k+fuM+uKLHhInN FYAAJ5V5mwWoEkEfG8nna5fpoJ49fd1SvxSKNtl/TesdXE+fA3RFjc6Lo9B1P0Gjw9sAi9 VZsLJ2YOU0PnJo4+ylwcJW5ffx2FtNU= 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-631-UnIu5pBQOv6KlMRqClvusQ-1; Wed, 15 Jan 2025 05:29:14 -0500 X-MC-Unique: UnIu5pBQOv6KlMRqClvusQ-1 X-Mimecast-MFC-AGG-ID: UnIu5pBQOv6KlMRqClvusQ 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 174261955DC6; Wed, 15 Jan 2025 10:29:13 +0000 (UTC) Received: from max-p1.redhat.com (unknown [10.39.208.25]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id F159330001BE; Wed, 15 Jan 2025 10:29:10 +0000 (UTC) From: Maxime Coquelin To: dev@dpdk.org, david.marchand@redhat.com, chenbox@nvidia.com Cc: Maxime Coquelin , stable@dpdk.org Subject: [PATCH 1/3] vhost: fix missing packets count reset when not ready Date: Wed, 15 Jan 2025 11:29:03 +0100 Message-ID: <20250115102905.2572035-2-maxime.coquelin@redhat.com> In-Reply-To: <20250115102905.2572035-1-maxime.coquelin@redhat.com> References: <20250115102905.2572035-1-maxime.coquelin@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: gUddkRL6vLutQ5z0UhCFOj26uIGRiOssAKqaffFUImI_1736936953 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