[dpdk-dev] [PATCH v4 1/2] vhost: introduce async enqueue registration API

Fu, Patrick patrick.fu at intel.com
Mon Jul 6 11:08:15 CEST 2020


Hi,

> -----Original Message-----
> From: Liu, Yong <yong.liu at intel.com>
> Sent: Monday, July 6, 2020 11:06 AM
> To: Fu, Patrick <patrick.fu at intel.com>; dev at dpdk.org;
> maxime.coquelin at redhat.com; Xia, Chenbo <chenbo.xia at intel.com>; Wang,
> Zhihong <zhihong.wang at intel.com>
> Cc: Fu, Patrick <patrick.fu at intel.com>; Wang, Yinan
> <yinan.wang at intel.com>; Jiang, Cheng1 <cheng1.jiang at intel.com>; Liang,
> Cunming <cunming.liang at intel.com>
> Subject: RE: [dpdk-dev] [PATCH v4 1/2] vhost: introduce async enqueue
> registration API
> 
> Hi Patrick,
> Few comments are inline,  others are fine to me.
> 
> Regards,
> Marvin
> 
> > diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c index
> > 0d822d6..58ee3ef 100644
> > --- a/lib/librte_vhost/vhost.c
> > +++ b/lib/librte_vhost/vhost.c
> > @@ -332,8 +332,13 @@
> >  {
> >  	if (vq_is_packed(dev))
> >  		rte_free(vq->shadow_used_packed);
> > -	else
> > +	else {
> >  		rte_free(vq->shadow_used_split);
> > +		if (vq->async_pkts_pending)
> > +			rte_free(vq->async_pkts_pending);
> > +		if (vq->async_pending_info)
> > +			rte_free(vq->async_pending_info);
> 
> Missed pointer set and feature set to 0.
> 
This memory free statement is part of vq free operation, which should be safe to leave the vq member pointer just as is

> > +	if (vq->async_pkts_pending) {
> > +		rte_free(vq->async_pkts_pending);
> > +		vq->async_pkts_pending = 0;
> > +	}
> > +
> > +	if (vq->async_pending_info) {
> > +		rte_free(vq->async_pending_info);
> > +		vq->async_pending_info = 0;
> > +	}
> > +
> 
> Please unify the async pending pointer check and free logic and pointer
> should be set to NULL.
> 
Will change it in the next patch version

Thanks,

Patrick




More information about the dev mailing list