Hi, > -----Original Message----- > From: Liu, Yong <yong....@intel.com> > Sent: Monday, July 6, 2020 11:06 AM > To: Fu, Patrick <patrick...@intel.com>; dev@dpdk.org; > maxime.coque...@redhat.com; Xia, Chenbo <chenbo....@intel.com>; Wang, > Zhihong <zhihong.w...@intel.com> > Cc: Fu, Patrick <patrick...@intel.com>; Wang, Yinan > <yinan.w...@intel.com>; Jiang, Cheng1 <cheng1.ji...@intel.com>; Liang, > Cunming <cunming.li...@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