mbox series

[V4,0/3] vDPA/ifcvf: enables Intel C5000X-PL virtio-blk

Message ID 20210419063326.3748-1-lingshan.zhu@intel.com (mailing list archive)
Headers show
Series vDPA/ifcvf: enables Intel C5000X-PL virtio-blk | expand

Message

Zhu, Lingshan April 19, 2021, 6:33 a.m. UTC
This series enabled Intel FGPA SmartNIC C5000X-PL virtio-blk for vDPA.

This series requires:
Stefano's vdpa block patchset: https://lkml.org/lkml/2021/3/15/2113
my patchset to enable Intel FGPA SmartNIC C5000X-PL virtio-net for vDPA:
https://lkml.org/lkml/2021/3/17/432

changes from V3:
remove (pdev->device < 0x1000 || pdev->device > 0x107f) checks in
probe(), because id_table already cut them off(Jason)

changes from V2:
both get_features() and get_config_size() use switch code block
now(Stefano)

changes from V1:
(1)add comments to explain this driver drives virtio modern devices
and transitional devices in modern mode.(Jason)
(2)remove IFCVF_BLK_SUPPORTED_FEATURES, use hardware feature bits
directly(Jason)
(3)add error handling and message in get_config_size(Stefano)

Thanks!

Zhu Lingshan (3):
  vDPA/ifcvf: deduce VIRTIO device ID when probe
  vDPA/ifcvf: enable Intel C5000X-PL virtio-block for vDPA
  vDPA/ifcvf: get_config_size should return dev specific config size

 drivers/vdpa/ifcvf/ifcvf_base.h |  9 ++++-
 drivers/vdpa/ifcvf/ifcvf_main.c | 65 ++++++++++++++++++++++++++-------
 2 files changed, 59 insertions(+), 15 deletions(-)

Comments

Stefano Garzarella Nov. 24, 2021, 3:39 p.m. UTC | #1
Hi Zhu,

On Mon, Apr 19, 2021 at 8:39 AM Zhu Lingshan <lingshan.zhu@intel.com> wrote:
>
> This series enabled Intel FGPA SmartNIC C5000X-PL virtio-blk for vDPA.

Looking at the IFCVF upstream vDPA driver (with this series applied), it 
seems that there is still some cleaning to be done to support virtio-blk 
devices:

- ifcvf_vdpa_get_config() and ifcvf_vdpa_set_config() use
  `sizeof(struct virtio_net_config)` to check the inputs.
  This seems wrong for a virtio-blk device. Maybe we can set the config
  size for each device in ifcvf_vdpa_dev_add() and use that field to
  check the inputs. We can reuse the same field also in
  ifcvf_vdpa_get_config_size().

- Just for make the code more readable we should rename `net_cfg` field
  to `device_cfg`in `struct ifcvf_hw`.

What do you think?

Thanks,
Stefano
Zhu, Lingshan Nov. 25, 2021, 2:12 a.m. UTC | #2
Hello Stefano,

Thanks for your review and advices, I will fix them

Thanks,
Zhu Lingshan

On 11/24/2021 11:39 PM, Stefano Garzarella wrote:
> Hi Zhu,
>
> On Mon, Apr 19, 2021 at 8:39 AM Zhu Lingshan <lingshan.zhu@intel.com> wrote:
>> This series enabled Intel FGPA SmartNIC C5000X-PL virtio-blk for vDPA.
> Looking at the IFCVF upstream vDPA driver (with this series applied), it
> seems that there is still some cleaning to be done to support virtio-blk
> devices:
>
> - ifcvf_vdpa_get_config() and ifcvf_vdpa_set_config() use
>    `sizeof(struct virtio_net_config)` to check the inputs.
>    This seems wrong for a virtio-blk device. Maybe we can set the config
>    size for each device in ifcvf_vdpa_dev_add() and use that field to
>    check the inputs. We can reuse the same field also in
>    ifcvf_vdpa_get_config_size().
>
> - Just for make the code more readable we should rename `net_cfg` field
>    to `device_cfg`in `struct ifcvf_hw`.
>
> What do you think?
>
> Thanks,
> Stefano
>