> -----Original Message----- > From: Xia, Chenbo <[email protected]> > Sent: Thursday, September 24, 2020 1:26 PM > To: Maxime Coquelin <[email protected]>; [email protected]; Fu, > Patrick <[email protected]>; [email protected] > Subject: RE: [dpdk-dev] [PATCH 7/7] net/virtio: introduce Vhost-vDPA > backend > > Hi Maxime, > > > + > > +/** > > + * Set up environment to talk with a vhost vdpa backend. > > + * > > + * @return > > + * - (-1) if fail to set up; > > + * - (>=0) if successful. > > + */ > > +static int > > +vhost_vdpa_setup(struct virtio_user_dev *dev) > > +{ > > + uint32_t did = (uint32_t)-1; > > I see in kernel, 'did' should be u8: > > static long vhost_vdpa_get_device_id(struct vhost_vdpa *v, u8 __user *argp) > > So I think here did should be uint8_t? >
Actually `did` is u32 in kernel. argp is just a user pointer. Whether it's u8* or u32* has nothing to do with the `did` data size refer to control code def: #define VHOST_VDPA_GET_DEVICE_ID _IOR(VHOST_VIRTIO, 0x70, __u32) Thanks, Patrick

