Hi,
> -----Original Message-----
> From: Liu, Yong <[email protected]>
> Sent: Monday, July 6, 2020 11:06 AM
> To: Fu, Patrick <[email protected]>; [email protected];
> [email protected]; Xia, Chenbo <[email protected]>; Wang,
> Zhihong <[email protected]>
> Cc: Fu, Patrick <[email protected]>; Wang, Yinan
> <[email protected]>; Jiang, Cheng1 <[email protected]>; Liang,
> Cunming <[email protected]>
> 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