OSDN Git Service

ifcvf/vDPA: fix misuse virtio-net device config size for blk dev
authorZhu Lingshan <lingshan.zhu@intel.com>
Wed, 1 Dec 2021 08:12:55 +0000 (16:12 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 14 Jan 2022 23:50:52 +0000 (18:50 -0500)
commit0f420c383a2bb414ebccedf9289b5b815f1295fe
tree826a55a78a9cda6918b0f3525625b9161888672e
parentb4d80c8dda229c830f0ba38c103e5263c2a7bc64
ifcvf/vDPA: fix misuse virtio-net device config size for blk dev

This commit fixes a misuse of virtio-net device config size issue
for virtio-block devices.

A new member config_size in struct ifcvf_hw is introduced and would
be initialized through vdpa_dev_add() to record correct device
config size.

To be more generic, rename ifcvf_hw.net_config to ifcvf_hw.dev_config,
the helpers ifcvf_read/write_net_config() to ifcvf_read/write_dev_config()

Signed-off-by: Zhu Lingshan <lingshan.zhu@intel.com>
Reported-and-suggested-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Fixes: 6ad31d162a4e ("vDPA/ifcvf: enable Intel C5000X-PL virtio-block for vDPA")
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20211201081255.60187-1-lingshan.zhu@intel.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vdpa/ifcvf/ifcvf_base.c
drivers/vdpa/ifcvf/ifcvf_base.h
drivers/vdpa/ifcvf/ifcvf_main.c