On 1/22/21 8:25 AM, Xia, Chenbo wrote:
> Hi Maxime,
>
>> -----Original Message-----
>> From: Maxime Coquelin <maxime.coque...@redhat.com>
>> Sent: Wednesday, January 20, 2021 5:25 AM
>> To: dev@dpdk.org; Xia, Chenbo <chenbo....@intel.com>; olivier.m...@6wind.com;
>> amore...@redhat.com; david.march...@redhat.com
>> Cc: Maxime Coquelin <maxime.coque...@redhat.com>
>> Subject: [PATCH v2 27/44] net/virtio: add Virtio-user features ops
>>
>> This patch introduces new callbacks for getting
>> and setting Virtio features, and implements them
>> for the different backend types.
>>
>> Signed-off-by: Maxime Coquelin <maxime.coque...@redhat.com>
>> ---
>> drivers/net/virtio/virtio_user/vhost.h | 2 +
>> drivers/net/virtio/virtio_user/vhost_kernel.c | 150 +++++++++---------
>> .../net/virtio/virtio_user/vhost_kernel_tap.c | 23 +++
>> .../net/virtio/virtio_user/vhost_kernel_tap.h | 1 +
>> drivers/net/virtio/virtio_user/vhost_user.c | 64 +++++++-
>> drivers/net/virtio/virtio_user/vhost_vdpa.c | 38 +++--
>> .../net/virtio/virtio_user/virtio_user_dev.c | 5 +-
>> drivers/net/virtio/virtio_user_ethdev.c | 3 +-
>> 8 files changed, 190 insertions(+), 96 deletions(-)
>>
>> diff --git a/drivers/net/virtio/virtio_user/vhost.h
>> b/drivers/net/virtio/virtio_user/vhost.h
>> index 5413ec6778..13a88c7671 100644
>> --- a/drivers/net/virtio/virtio_user/vhost.h
>> +++ b/drivers/net/virtio/virtio_user/vhost.h
>> @@ -110,6 +110,8 @@ struct virtio_user_dev;
>
> <snip>
>
>> +
>> + ret = tap_support_features(&tap_features);
>> + if (ret < 0) {
>> + PMD_DRV_LOG(ERR, "Failed to get TAP features)");
>
> Delete the ')' before " ?
Indeed, done.
>> + return -1;
>> + }
>> +
>
> <snip>
>
>>
>> +static int
>> +vhost_user_get_features(struct virtio_user_dev *dev, uint64_t *features)
>> +{
>> + int ret;
>> + struct vhost_user_msg msg = {
>> + .request = VHOST_USER_GET_FEATURES,
>> + .flags = VHOST_USER_VERSION,
>> + };
>> +
>> + ret = vhost_user_write(dev->vhostfd, &msg, NULL, 0);
>> + if (ret < 0)
>> + goto err;
>> +
>> + ret = vhost_user_read(dev->vhostfd, &msg);
>> + if (ret < 0)
>> + goto err;
>
> Better add error log both after write and read?
As you replied later, we already log in read & write functions, so
skipping this comment.
> Thanks!
> Chenbo
>
Thanks,
Maxime