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 E1661A0A02; Fri, 16 Apr 2021 22:58:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6B505161DA9; Fri, 16 Apr 2021 22:58:46 +0200 (CEST) Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by mails.dpdk.org (Postfix) with ESMTP id 74880161DA5; Fri, 16 Apr 2021 22:58:44 +0200 (CEST) Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 13GKYSLo063765; Fri, 16 Apr 2021 16:58:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=BfYXDHmnwGuICflRryfyh3XYBBKODNyAWtDICV2BgmM=; b=iJfIZMVgy7lnsFTyb3zi8qqu33i+KjXRljPrxDsUhcT5IKKae5QuBSstacJczLUA7w1P e1RJkFEjXZtWJDOecwkMOpwuRhl7RlRnx55cJ4W+60JbsaZ0qzKcQMmHZkJ3bO1vToGa tugoRnEKyH0tQFJ7h5x8gXskzFLyNoa6LnzGcAlj2sGoZk3aqde0KjFaAwRJeWbDcMdy UuGDc7pPtH/UOgbINKn8Eqxb+KRcKTus3vXMAwq1zeJsoVFYx7iNV63h1XOYTge6twn6 4ZwGwLW7Izqz357zVdbgDNSVJ2FuvbWxQKYP2647AHlo8cn61HdTt5XoaA370j7+Yctb Yg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 37xbq5dfnm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 16 Apr 2021 16:58:36 -0400 Received: from m0127361.ppops.net (m0127361.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 13GKlD5a098527; Fri, 16 Apr 2021 16:58:35 -0400 Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0a-001b2d01.pphosted.com with ESMTP id 37xbq5dfne-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 16 Apr 2021 16:58:35 -0400 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 13GKw9kZ009509; Fri, 16 Apr 2021 20:58:35 GMT Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by ppma03wdc.us.ibm.com with ESMTP id 37uhcngqra-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 16 Apr 2021 20:58:35 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 13GKwYtW33161494 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 16 Apr 2021 20:58:34 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C2BFF112066; Fri, 16 Apr 2021 20:58:34 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 26E23112063; Fri, 16 Apr 2021 20:58:33 +0000 (GMT) Received: from Davids-MBP.randomparity.org (unknown [9.163.0.90]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 16 Apr 2021 20:58:32 +0000 (GMT) To: Xueming Li Cc: dev@dpdk.org, =?UTF-8?B?6LCi5Y2O5LyfICjmraTml7bmraTliLvvvIk=?= , jerin.jacob@caviumnetworks.com, stable@dpdk.org, Maxime Coquelin , Chenbo Xia , Jerin Jacob , Ruifeng Wang , Bruce Richardson , Konstantin Ananyev , Jianfeng Tan , Huawei Xie , Jianbo Liu , Yuanhan Liu References: <20210414042631.7041-1-xuemingl@nvidia.com> <20210414141404.9486-1-xuemingl@nvidia.com> From: David Christensen Message-ID: <9607536a-d514-9485-f621-18a9945d7d4a@linux.vnet.ibm.com> Date: Fri, 16 Apr 2021 13:58:32 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: <20210414141404.9486-1-xuemingl@nvidia.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: m_YZ-_acZZV13pZJRe3KAM6tkAmlRaOd X-Proofpoint-GUID: 9zG9L5REdvIs6mF3NDp-brCkMAEsolr0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-04-16_09:2021-04-16, 2021-04-16 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 impostorscore=0 suspectscore=0 malwarescore=0 mlxlogscore=902 phishscore=0 spamscore=0 mlxscore=0 bulkscore=0 priorityscore=1501 adultscore=0 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104160145 Subject: Re: [dpdk-dev] [PATCH v1] net/virtio: fix vectorized Rx queue stuck 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" > When Rx queue worked in vectorized mode and rxd <= 512, under traffic of > high PPS rate, testpmd often start and receive packets of rxd without > further growth. > > Testpmd started with rxq flush which tried to rx MAX_PKT_BURST(512) > packets and drop. When Rx burst size >= Rx queue size, all descriptors > in used queue consumed without rearm, device can't receive more packets. > The next Rx burst returned at once since no used descriptors found, > rearm logic was skipped, rx vq kept in starving state. > > To avoid rx vq starving, this patch always check the available queue, > rearm if needed even no used descriptor reported by device. > > Fixes: fc3d66212fed ("virtio: add vector Rx") > Cc: 谢华伟(此时此刻) > Fixes: 2d7c37194ee4 ("net/virtio: add NEON based Rx handler") > Cc: jerin.jacob@caviumnetworks.com > Fixes: 52b5a707e6ca ("net/virtio: add Altivec Rx") > Cc: drc@linux.vnet.ibm.com > Cc: stable@dpdk.org > > Signed-off-by: Xueming Li > --- > drivers/net/virtio/virtio_rxtx_simple_altivec.c | 12 ++++++------ > drivers/net/virtio/virtio_rxtx_simple_neon.c | 12 ++++++------ > drivers/net/virtio/virtio_rxtx_simple_sse.c | 12 ++++++------ > 3 files changed, 18 insertions(+), 18 deletions(-) > > diff --git a/drivers/net/virtio/virtio_rxtx_simple_altivec.c b/drivers/net/virtio/virtio_rxtx_simple_altivec.c > index 62e5100a48..7534974ef4 100644 > --- a/drivers/net/virtio/virtio_rxtx_simple_altivec.c > +++ b/drivers/net/virtio/virtio_rxtx_simple_altivec.c > @@ -85,6 +85,12 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, > if (unlikely(nb_pkts < RTE_VIRTIO_DESC_PER_LOOP)) > return 0; > > + if (vq->vq_free_cnt >= RTE_VIRTIO_VPMD_RX_REARM_THRESH) { > + virtio_rxq_rearm_vec(rxvq); > + if (unlikely(virtqueue_kick_prepare(vq))) > + virtqueue_notify(vq); > + } > + > nb_used = virtqueue_nused(vq); > > rte_compiler_barrier(); > @@ -102,12 +108,6 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, > > rte_prefetch0(rused); > > - if (vq->vq_free_cnt >= RTE_VIRTIO_VPMD_RX_REARM_THRESH) { > - virtio_rxq_rearm_vec(rxvq); > - if (unlikely(virtqueue_kick_prepare(vq))) > - virtqueue_notify(vq); > - } > - > nb_total = nb_used; > ref_rx_pkts = rx_pkts; > for (nb_pkts_received = 0; Reviewed-by: David Christensen