[RFC v3] add support for async vhost packed ring dequeue

Jiang, Cheng1 cheng1.jiang at intel.com
Thu Jun 9 15:23:25 CEST 2022



> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin at redhat.com>
> Sent: Thursday, June 9, 2022 9:04 PM
> To: Jiang, Cheng1 <cheng1.jiang at intel.com>; Xia, Chenbo
> <chenbo.xia at intel.com>
> Cc: dev at dpdk.org; Hu, Jiayu <jiayu.hu at intel.com>; Ding, Xuan
> <xuan.ding at intel.com>; Ma, WenwuX <wenwux.ma at intel.com>; Wang,
> YuanX <yuanx.wang at intel.com>; Yang, YvonneX <yvonnex.yang at intel.com>
> Subject: Re: [RFC v3] add support for async vhost packed ring dequeue
> 
> Hi Cheng,
> 
> On 5/30/22 06:56, Cheng Jiang wrote:
> > This RFC patch implements packed ring dequeue data path for
> > asynchronous vhost.
> 
> Please remove RFC in the next revision.

Sure.

> 
> > Signed-off-by: Cheng Jiang <cheng1.jiang at intel.com>
> > ---
> >   lib/vhost/virtio_net.c | 217
> ++++++++++++++++++++++++++++++++++++-----
> >   1 file changed, 191 insertions(+), 26 deletions(-)
> >
> > diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c
> 
> ...
> 
> > +
> > +static __rte_always_inline int
> > +virtio_dev_tx_async_single_packed(struct virtio_net *dev,
> > +			struct vhost_virtqueue *vq,
> > +			struct rte_mempool *mbuf_pool,
> > +			struct rte_mbuf *pkts,
> > +			uint16_t slot_idx,
> > +			bool legacy_ol_flags)
> > +{
> > +	int err;
> > +	uint16_t buf_id, desc_count = 0;
> > +	uint16_t nr_vec = 0;
> > +	uint32_t buf_len;
> > +	struct buf_vector buf_vec[BUF_VECTOR_MAX];
> > +	static bool allocerr_warned;
> > +
> > +	if (unlikely(fill_vec_buf_packed(dev, vq, vq->last_avail_idx,
> &desc_count,
> > +					 buf_vec, &nr_vec, &buf_id,
> &buf_len,
> > +					 VHOST_ACCESS_RO) < 0))
> > +		return -1;
> > +
> > +	if (unlikely(virtio_dev_pktmbuf_prep(dev, pkts, buf_len))) {
> > +		if (!allocerr_warned) {
> > +			VHOST_LOG_DATA(ERR, "Failed mbuf alloc of size %d
> from %s on %s.\n",
> > +				buf_len, mbuf_pool->name, dev->ifname);
> 
> We have defined a common format for all Vhost logs to ease logs
> filtering:
> VHOST_LOG_DATA(ERR, "(%s) Failed mbuf alloc of size %d from %s.\n",
> 
> 		dev->ifname, buf_len, mbuf_pool->name);
> 
> Could you please fix it here and everywhere else in the patch?
> 
> With above minor comments fixed, feel free to add:
> 
> Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
> 
> Thanks,
> Maxime

Sure, got it. I'll fix it.

Thanks a lot.
Cheng



More information about the dev mailing list