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 42D6F41BBD; Fri, 3 Feb 2023 15:43:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 329E742B7E; Fri, 3 Feb 2023 15:43:42 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id AA4AA4021E for ; Fri, 3 Feb 2023 15:43:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675435420; 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=h8Ci/DGyFe4XNjhZ3SYPjZSwYB5ay8flsi333YLaaHw=; b=aUP8WhpIavacRc8P3R6FdFUYwyLK4X9yLRqprjnchlqTlJjxpcnAeznP+qKpES3O/1XPg+ Q+nl6s2qillDHev5cdKD7W4iducYPejUi6WZbmoUutIt+mkZbyCAHA9hkC6QfXUCaXWPzj qiLrFOiA+Zk8oKvjn9+a2UU7LUQtq4w= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-642-SQmC6lBFPW2XtJ09tVVqzw-1; Fri, 03 Feb 2023 09:43:37 -0500 X-MC-Unique: SQmC6lBFPW2XtJ09tVVqzw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 01A2818E0920; Fri, 3 Feb 2023 14:43:37 +0000 (UTC) Received: from [10.39.208.28] (unknown [10.39.208.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6AC97112132C; Fri, 3 Feb 2023 14:43:33 +0000 (UTC) Message-ID: <522ccc0c-a601-0342-0e23-3020d0bdb792@redhat.com> Date: Fri, 3 Feb 2023 15:43:31 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH] vhost: fix net header settings in vhost datapath To: Wenwu Ma , dev@dpdk.org Cc: stable@dpdk.org References: <20230104023945.6669-1-wenwux.ma@intel.com> From: Maxime Coquelin In-Reply-To: <20230104023945.6669-1-wenwux.ma@intel.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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 1/4/23 03:39, Wenwu Ma wrote: > In vhost sync batch enqueue, the "num_buffers" of > virtio net header is not be set, but it should be > set to 1 if the mrg_rxbuf feature is turned on, > This patch fix the issue. > > Fixes: ef861692c398 ("vhost: add packed ring batch enqueue") > Cc: stable@dpdk.org > > Signed-off-by: Wenwu Ma > --- > lib/vhost/virtio_net.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c > index cf796183a0..61d9052a57 100644 > --- a/lib/vhost/virtio_net.c > +++ b/lib/vhost/virtio_net.c > @@ -1493,6 +1493,12 @@ virtio_dev_rx_batch_packed_copy(struct virtio_net *dev, > sizeof(struct virtio_net_hdr_mrg_rxbuf); > } > > + if (rxvq_is_mergeable(dev)) { > + vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE) { > + ASSIGN_UNLESS_EQUAL(hdrs[i]->num_buffers, 1); > + } > + } > + > vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE) > virtio_enqueue_offload(pkts[i], &hdrs[i]->hdr); > Reviewed-by: Maxime Coquelin Thanks, Maxime