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 89F75A04AE for ; Tue, 8 Feb 2022 12:11:54 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7F02241140; Tue, 8 Feb 2022 12:11:54 +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 54C6041144 for ; Tue, 8 Feb 2022 12:11:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644318712; 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=uLoYzgWFK3n6/DcEgS76yj62wykSaVqpX65iGYBd434=; b=gVaZpBTuQN+LMSxcDcoq1qLQ8za+Y8EDmW1Y6tHwrE8furu1adKZ4RtNUUmWZxRqx2EKCw hUaN9inVXNEKOAe+20YNjWKcrOE0D7aDPZmulX/6Xw9mohW6VrZsaT5jlBuJPTlPHgw5dh g1YHJcln8Ycy6swefR/IEiioKfQW5PE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-597-8BLeik86MnKY211zUtxCcw-1; Tue, 08 Feb 2022 06:11:49 -0500 X-MC-Unique: 8BLeik86MnKY211zUtxCcw-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 95FFA36393; Tue, 8 Feb 2022 11:11:48 +0000 (UTC) Received: from [10.39.208.19] (unknown [10.39.208.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 922411042AAC; Tue, 8 Feb 2022 11:11:47 +0000 (UTC) Message-ID: <53ac98b0-f81d-9205-06df-46bf546bf541@redhat.com> Date: Tue, 8 Feb 2022 12:11:46 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH] net/virtio: fix incorrect slots number when indirect feature on To: Marvin Liu , chenbo.xia@intel.com Cc: dev@dpdk.org, stable@dpdk.org References: <20220120122218.25027-1-yong.liu@intel.com> From: Maxime Coquelin In-Reply-To: <20220120122218.25027-1-yong.liu@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: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On 1/20/22 13:22, Marvin Liu wrote: > Virtio driver only occupies one slot for enqueuing chained mbufs when > indirect feature is on. Required slots calculation should depend on > indirect feature status at the end. > > Fixes: 0eaf7fc2fe8e ("net/virtio: separate AVX Rx/Tx") > Cc: stable@dpdk.org > > Signed-off-by: Marvin Liu > > diff --git a/drivers/net/virtio/virtio_rxtx_packed.h b/drivers/net/virtio/virtio_rxtx_packed.h > index d5c259a1f6..536112983c 100644 > --- a/drivers/net/virtio/virtio_rxtx_packed.h > +++ b/drivers/net/virtio/virtio_rxtx_packed.h > @@ -125,13 +125,12 @@ virtqueue_enqueue_single_packed_vec(struct virtnet_tx *txvq, > * any_layout => number of segments > * default => number of segments + 1 > */ > - slots = use_indirect ? 1 : (txm->nb_segs + !can_push); > can_push = rte_mbuf_refcnt_read(txm) == 1 && > RTE_MBUF_DIRECT(txm) && > txm->nb_segs == 1 && > rte_pktmbuf_headroom(txm) >= hdr_size; > > - slots = txm->nb_segs + !can_push; > + slots = use_indirect ? 1 : (txm->nb_segs + !can_push); > need = slots - vq->vq_free_cnt; > > /* Positive value indicates it need free vring descriptors */ Applied to dpdk-next-virtio/main. Thanks, Maxime