Hi, > -----Original Message----- > From: Ma, WenwuX <wenwux...@intel.com> > Sent: Tuesday, September 7, 2021 4:49 AM > To: dev@dpdk.org > Cc: maxime.coque...@redhat.com; Xia, Chenbo <chenbo....@intel.com>; Jiang, > Cheng1 <cheng1.ji...@intel.com>; Hu, Jiayu <jiayu...@intel.com>; Pai G, Sunil > <sunil.pa...@intel.com>; Yang, YvonneX <yvonnex.y...@intel.com>; Ma, WenwuX > <wenwux...@intel.com> > Subject: [PATCH 2/4] examples/vhost: refactor vhost enqueue and dequeue > datapaths > > Previously, by judging the flag, we call different enqueue/dequeue > functions in data path. > > Now, we use an ops that was initialized when Vhost was created, > so that we can call ops directly in Vhost data path without any more > flag judgment. > > Signed-off-by: Wenwu Ma <wenwux...@intel.com> > Reviewed-by: Maxime Coquelin <maxime.coque...@redhat.com> > --- > examples/vhost/main.c | 100 +++++++++++++++++++++--------------- > examples/vhost/main.h | 31 +++++++++-- > examples/vhost/virtio_net.c | 16 +++++- > 3 files changed, 101 insertions(+), 46 deletions(-) > > diff --git a/examples/vhost/main.c b/examples/vhost/main.c > index a4a8214e05..e246b640ea 100644 > --- a/examples/vhost/main.c > +++ b/examples/vhost/main.c > @@ -106,6 +106,8 @@ static uint32_t burst_rx_retry_num = BURST_RX_RETRIES; > static char *socket_files;
[...] > > @@ -87,7 +100,19 @@ void vs_vhost_net_remove(struct vhost_dev *dev); > uint16_t vs_enqueue_pkts(struct vhost_dev *dev, uint16_t queue_id, > struct rte_mbuf **pkts, uint32_t count); > > -uint16_t vs_dequeue_pkts(struct vhost_dev *dev, uint16_t queue_id, > - struct rte_mempool *mbuf_pool, > - struct rte_mbuf **pkts, uint16_t count); > +uint16_t builtin_enqueue_pkts(struct vhost_dev *dev, uint16_t queue_id, > + struct rte_mbuf **pkts, uint32_t count); > +uint16_t builtin_dequeue_pkts(struct vhost_dev *dev, uint16_t queue_id, > + struct rte_mempool *mbuf_pool, > + struct rte_mbuf **pkts, uint16_t count); > +uint16_t sync_enqueue_pkts(struct vhost_dev *dev, uint16_t queue_id, > + struct rte_mbuf **pkts, uint32_t count); > +uint16_t sync_dequeue_pkts(struct vhost_dev *dev, uint16_t queue_id, > + struct rte_mempool *mbuf_pool, > + struct rte_mbuf **pkts, uint16_t count); > +uint16_t async_enqueue_pkts(struct vhost_dev *dev, uint16_t queue_id, > + struct rte_mbuf **pkts, uint32_t count); > +uint16_t async_dequeue_pkts(struct vhost_dev *dev, uint16_t queue_id, > + struct rte_mempool *mbuf_pool, > + struct rte_mbuf **pkts, uint16_t count); This func is defined in the 4th. So please remove it here. Thanks, Chenbo