Hi Stephen,

Thanks for your reply.
I will change to DEBUG level log in next version.

> -----Original Message-----
> From: Stephen Hemminger <[email protected]>
> Sent: Friday, May 13, 2022 11:38 PM
> To: Pei, Andy <[email protected]>
> Cc: Xia, Chenbo <[email protected]>; [email protected];
> [email protected]; Cao, Gang <[email protected]>; Liu,
> Changpeng <[email protected]>
> Subject: Re: [PATCH v7 12/18] vdpa/ifc: add some log at vDPA launch before
> qemu connect
> 
> On Fri, 13 May 2022 08:34:38 +0000
> "Pei, Andy" <[email protected]> wrote:
> 
> > Hi Chenbo,
> >
> > Thanks for your reply.
> > My reply is inline.
> >
> > > -----Original Message-----
> > > From: Xia, Chenbo <[email protected]>
> > > Sent: Thursday, May 12, 2022 9:53 PM
> > > To: Pei, Andy <[email protected]>; [email protected]
> > > Cc: [email protected]; Cao, Gang <[email protected]>; Liu,
> > > Changpeng <[email protected]>
> > > Subject: RE: [PATCH v7 12/18] vdpa/ifc: add some log at vDPA launch
> > > before qemu connect
> > >
> > > > -----Original Message-----
> > > > From: Pei, Andy <[email protected]>
> > > > Sent: Wednesday, April 27, 2022 4:30 PM
> > > > To: [email protected]
> > > > Cc: Xia, Chenbo <[email protected]>;
> > > > [email protected]; Cao, Gang <[email protected]>; Liu,
> > > > Changpeng <[email protected]>
> > > > Subject: [PATCH v7 12/18] vdpa/ifc: add some log at vDPA launch
> > > > before qemu connect
> > >
> > > Title can be:
> > >
> > > vdpa/ifc: add log for config space of virtio blk
> > >
> > Sure.
> > > >
> > > > Add some log of virtio blk device config space information at VDPA
> > > > launch before qemu connects.
> > > >
> > > > Signed-off-by: Andy Pei <[email protected]>
> > > > ---
> > > >  drivers/vdpa/ifc/ifcvf_vdpa.c | 28 ++++++++++++++++++++++++++++
> > > >  1 file changed, 28 insertions(+)
> > > >
> > > > diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c
> > > > b/drivers/vdpa/ifc/ifcvf_vdpa.c index ca49bc3..4060a44 100644
> > > > --- a/drivers/vdpa/ifc/ifcvf_vdpa.c
> > > > +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
> > > > @@ -1363,6 +1363,9 @@ struct rte_vdpa_dev_info dev_info[] = {
> > > >         struct rte_kvargs *kvlist = NULL;
> > > >         int ret = 0;
> > > >         int16_t device_id;
> > > > +       uint64_t capacity = 0;
> > > > +       uint8_t *byte;
> > > > +       uint32_t i;
> > > >
> > > >         if (rte_eal_process_type() != RTE_PROC_PRIMARY)
> > > >                 return 0;
> > > > @@ -1429,6 +1432,31 @@ struct rte_vdpa_dev_info dev_info[] = {
> > > >                 internal->features = features &
> > > >                                         ~(1ULL <<
> > > VIRTIO_F_IOMMU_PLATFORM);
> > > >                 internal->features |= dev_info[IFCVF_BLK].features;
> > > > +
> > > > +               /* cannot read 64-bit register in one attempt,
> > > > +                * so read byte by byte.
> > > > +                */
> > > > +               for (i = 0; i < sizeof(internal->hw.blk_cfg->capacity); 
> > > > i++) {
> > > > +                       byte = (uint8_t 
> > > > *)&internal->hw.blk_cfg->capacity + i;
> > > > +                       capacity |= (uint64_t)*byte << (i * 8);
> > > > +               }
> > > > +               DRV_LOG(INFO, "capacity  : %"PRIu64"G", capacity >> 21);
> > >
> > > I believe this '21' should be calculated rather than hard-code.
> 
> Sounds like a debug not info message.
> It is meant for developer not end user.

Reply via email to