> -----Original Message----- > From: Xia, Chenbo <[email protected]> > Sent: Monday, June 20, 2022 3:49 PM > To: David Marchand <[email protected]>; > [email protected] > Cc: Wang, YuanX <[email protected]>; [email protected]; Hu, Jiayu > <[email protected]>; He, Xingguang <[email protected]>; > [email protected]; Ling, WeiX <[email protected]>; [email protected]; > [email protected]; [email protected]; Heinrich Kuhn > <[email protected]> > Subject: RE: [PATCH v2] examples/vhost: fix retry logic on eth rx path > > > -----Original Message----- > > From: David Marchand <[email protected]> > > Sent: Monday, June 20, 2022 3:36 PM > > To: Xia, Chenbo <[email protected]>; [email protected] > > Cc: Wang, YuanX <[email protected]>; [email protected]; Hu, Jiayu > > <[email protected]>; He, Xingguang <[email protected]>; > > [email protected]; Ling, WeiX <[email protected]>; > > [email protected]; [email protected]; > > [email protected]; Heinrich Kuhn <[email protected]> > > Subject: Re: [PATCH v2] examples/vhost: fix retry logic on eth rx path > > > > On Mon, Jun 20, 2022 at 5:20 AM Xia, Chenbo <[email protected]> > wrote: > > > > drain_eth_rx() uses rte_vhost_avail_entries() to calculate the > > > > available entries to determine if a retry is required. > > > > However, this function only works with split rings, and > > > > calculating packed rings will return the wrong value and cause > > > > unnecessary retries resulting in a significant performance penalty. > > > > > > > > This patch fix that by using the difference between tx/rx burst as > > > > the retry condition. > > > > > > Does it mean we don't need the API rte_vhost_avail_entries() anymore? > > > > > > Jiayu/Yuan/Maxime, what do you think? > > > > FWIW, I still see a user: > > virtio-forwarder/virtio_vhostuser.c: * This check ensures that we > > do not call rte_vhost_avail_entries > > virtio-forwarder/virtio_worker.c: try_rcv = > > rte_vhost_avail_entries((int)relay->vio.vio_dev, > > > > Cc'd a few Corigine guys. > > Thanks David for this info! Then I guess only split ring is used in this use > case? > If we want to keep it, then this API should also be fixed as it's not > supporting > packed ring.
Same issue for rte_vhost_rx_queue_count(), and it is used in OVS. But if look into the implementation of rte_vhost_avail_entries(), it calculates the number of available descriptors by " vq->avail->idx - vq->last_used_idx". This logic looks strange. Anyone knows the reason of this implementation? Thanks, Jiayu > > Thanks, > Chenbo > > > > > > > -- > > David Marchand >

