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 830B0A0C43; Tue, 16 Nov 2021 11:25:45 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 69768411FE; Tue, 16 Nov 2021 11:25:45 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id D2033411FB for ; Tue, 16 Nov 2021 11:25:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637058343; 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=B7bj9g5FKlnkYQJg2HHB57TfDEvdOdTIrroKVl66ypU=; b=e+X+xogYg5wmOzc1wfGtpB3PvN8WPTasQsUXv8Lt6C3Mb+R86fvzCMoxBhAIz9C+THuUjL CP6lO56dDj73c2Lq4v01Icuvrr8LuLDyJS2rmfi7qafoSBhwVXN9dZU4dAQVFsKLUU2TzW 0GhQl100LOiRj7e9V/v2l1ZwE17cxGA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-585-vTYo3N9aPo2ow1jzkZhCtw-1; Tue, 16 Nov 2021 05:25:41 -0500 X-MC-Unique: vTYo3N9aPo2ow1jzkZhCtw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4E68F1842159; Tue, 16 Nov 2021 10:25:40 +0000 (UTC) Received: from [10.39.208.9] (unknown [10.39.208.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 53D1F10016F4; Tue, 16 Nov 2021 10:25:39 +0000 (UTC) Message-ID: <69580123-a73c-cfe4-c02f-bd205ec2bee4@redhat.com> Date: Tue, 16 Nov 2021 11:25:37 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH v3] vhost: fix packed ring descriptor update in async enqueue To: Jiayu Hu , dev@dpdk.org Cc: chenbo.xia@intel.com, xingguang.he@intel.com References: <20211110124009.2250592-1-jiayu.hu@intel.com> <20211116151756.2420165-1-jiayu.hu@intel.com> From: Maxime Coquelin In-Reply-To: <20211116151756.2420165-1-jiayu.hu@intel.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 On 11/16/21 16:17, Jiayu Hu wrote: > If the packet uses multiple descriptors and its descriptor indices are > wrapped, the first descriptor flag is not updated last, which may cause > virtio read the incomplete packet. For example, given a packet uses 64 > descriptors, and virtio ring size is 256, and its descriptor indices are > 224~255 and 0~31, current implementation will update 224~255 descriptor > flags earlier than 0~31 descriptor flags. > > This patch fixes this issue by updating descriptor flags in one loop, > so that the first descriptor flag is always updated last. > > Fixes: 873e8dad6f49 ("vhost: support packed ring in async datapath") > > Signed-off-by: Jiayu Hu > Reviewed-by: Chenbo Xia > --- > v3: > * fix typo > v2: > * update commit log > --- > lib/vhost/virtio_net.c | 122 ++++++++++++++++++----------------------- > 1 file changed, 54 insertions(+), 68 deletions(-) > Applied to dpdk-next-virtio/main. Thanks, Maxime