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 59D67A0C46; Tue, 14 Sep 2021 13:26:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 449E3410E6; Tue, 14 Sep 2021 13:26:17 +0200 (CEST) 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 AFBD5410E6 for ; Tue, 14 Sep 2021 13:26:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631618775; 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=+OHPgL86CR2ZkGNyQT6mblaJuxQFk1Iagf6NPVbv/z0=; b=Dup8JGidbRFbxMMfg1aJ53UXoSEMtAotrb+jGohgqn4aqY1PWz/R7ovmD4k9xX4ELRTxFR YFnrUkFIfd4fyKKAdl7+v7zUumjHEZ3ULmZtyz/wgIziAItj+VLqT24BTAmEn7mcjm61L3 HGQqRP+kiXxZBMnlJpA7XihLnhBe7nM= 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-224-Vaw662c_P9e_75sDFde4FA-1; Tue, 14 Sep 2021 07:26:12 -0400 X-MC-Unique: Vaw662c_P9e_75sDFde4FA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BC33E802C87; Tue, 14 Sep 2021 11:26:10 +0000 (UTC) Received: from [10.39.208.12] (unknown [10.39.208.12]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 285BE5C1D1; Tue, 14 Sep 2021 11:26:08 +0000 (UTC) To: Andrew Rybchenko , Chenbo Xia , Jianfeng Tan , Huawei Xie Cc: dev@dpdk.org, Ivan Ilchenko , stable@dpdk.org References: <20210820124752.3522683-1-andrew.rybchenko@oktetlabs.ru> From: Maxime Coquelin Message-ID: <22100145-7894-2e12-cb30-9e2b7f120b5b@redhat.com> Date: Tue, 14 Sep 2021 13:26:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210820124752.3522683-1-andrew.rybchenko@oktetlabs.ru> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] net/virtio: turn SW RxQ size to that of split vec. virtqueue 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 Sender: "dev" On 8/20/21 2:47 PM, Andrew Rybchenko wrote: > From: Ivan Ilchenko > > Descriptors number may be set less than queue size for split queue > vectorized Rx path. Pointers to mbufs for received packets are > obtained from SW ring, that is initially filled with them in the end > of queue setup in virtio_dev_rx_queue_setup_finish(). The begin of the > SW ring filled up to the size of descriptors number. At queue size > offset from the begin of the SW ring pointers to some fake mbuf are also > set for wrapping purpose. So the ring may contains the hole of invalid > pointers from descriptors number offset to queue size offset, and split > vectorized Rx routines could write to the invalid addresses since they > use the ring up to the queue size. Fix this by setting descriptors > number to queue size on Rx queue setup. > > Fixes: fc3d66212fed ("virtio: add vector Rx") > Cc: stable@dpdk.org > > Signed-off-by: Ivan Ilchenko > Signed-off-by: Andrew Rybchenko > --- > drivers/net/virtio/virtio_rxtx.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > Applied to dpdk-next-virtio/main. Thanks, Maxime