Unverified Commit a3c1378d authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!222 vdpa: add two ioctl commands to support generic vDPA

Merge Pull Request from: @Zhao_Py 
 
[Description]​
To support generic vdpa deivce, we need add the following ioctls:
  - GET_CONFIG_SIZE: the size of the virtio config space
  - GET_VQS_COUNT: the count of virtqueues that exposed

#I5WXCZ
https://lore.kernel.org/all/20220315032553.455-1-longpeng2@huawei.com/

upstream commits list here:
64b9f64f vdpa: introduce virtio pci driver
442706f9 vdpa: add get_config_size callback in vdpa_config_ops
a61280dd vdpa: support exposing the config size to userspace
fd70a406 vdpa: Extend routine to accept vdpa device name
33b34750 vdpa: Define vdpa mgmt device, ops and a netlink interface
476c135e vdpa: Add missing comment for virtqueue count
903f7bca vdpa: Enable a user to add and delete a vdpa device
b04d910a vdpa: support exposing the count of vqs to userspace
64f2087a virtio-pci: do not access iomem via struct virtio_pci_device directly
b5d58094 virtio-pci: split out modern device
117a9de2 virtio-pci-modern: factor out modern device initialization logic
32490370 virtio-pci-modern: introduce vp_modern_remove()
1a5c85f1 virtio-pci-modern: introduce helper to set config vector
e3669129 virtio-pci-modern: introduce helpers for setting and getting status
0b017708 virtio-pci-modern: introduce helpers for setting and getting features
ed2a73db virtio-pci-modern: introduce vp_modern_generation()
a6525b99 Merge tag 'mips_5.12_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux
e1b0fa2e virtio-pci-modern: introduce vp_modern_queue_address()
dc2e6481 virtio-pci-modern: introduce helper to set/get queue_enable
75658afb virtio-pci-modern: introduce helper for setting/geting queue size
6e52fc44 virtio-pci-modern: introduce helper for getting queue nums
1bfd8413 virtio-pci-modern: introduce helper to get notification offset
8000a6b6 virito-pci-modern: rename map_capability() to vp_modern_map_capability()
fd502729 virtio-pci: introduce modern device module
bc0d90ee vdpa: Enable user to query vdpa device info
29b90f92 vdpa: remove unnecessary 'default n' in Kconfig entries
275900df vdpa_sim: split vdpasim_virtqueue's iov field in out_iov and in_iov
2f8f4618 vdpa_sim: add device id field in vdpasim_dev_attr
a13b5918 vdpa_sim: add work_fn in vdpasim_dev_attr
c124a95e vdpa_sim: add set_config callback in vdpasim_dev_attr
011c35ba vdpa_sim: add supported_features field in vdpasim_dev_attr
f00bdce0 vdpa: set the virtqueue num during register
db1e8bb6 vdpa: split vdpasim to core and net modules
0c853c2c vdpa: add vdpa simulator for block device
da7af696 vdpa_sim: make vdpasim->buffer size configurable
a3c06ae1 vdpa_sim_net: Add support for user supported devices
899c4d18 vdpa_sim_blk: add support for vdpa management tool
539fec78 vdpa: add driver_override support
d6d8bb92: vhost/vdpa: use get_config_size callback in vhost_vdpa_config_validate()
9e3bb9b7: virtio_pci_modern: introduce helper to map vq notify area
7dca6c0e: virtio-pci library: switch to use vp_modern_map_vq_notify()
11d8ffed: vp_vdpa: switch to use vp_modern_map_vq_notify()
9e311bca: virtio-pci library: report resource address
526cb858: vp_vdpa: report doorbell address
0686082d: vdpa: Add reset callback in vdpa_config_ops
5bbfea1e: vp_vdpa: add vq irq offloading support
530a5678: vdpa: support packed virtqueue for set/get_vq_state()
0140b3d0: virtio-pci library: introduce vp_modern_get_driver_features()
1225c216: vp_vdpa: allow set vq state to initial state after reset
0f8a0b0b: virtio_pci_modern: __force cast the notify mapping
d7bce85a: virtio_pci_modern: correct sparse tags for notify
9632e78e: vp_vdpa: Fix return value check for vdpa_alloc_device()
27d9839f: virtio: always enter drivers/virtio/
eb057b44: vdpa: fix use-after-free on vp_vdpa_remove
bb47620b: vdpa: Consider device id larger than 31
ef76eb83: vdpa/mlx5: Fix clearing of VIRTIO_NET_F_MAC feature bit
870aaff9: vdpa: clean up get_config_size ret value handling

[Testing]
kernel options:
CONFIG_VDPA=m
CONFIG_VDPA_SIM=m
CONFIG_VDPA_SIM_NET=m
CONFIG_VDPA_SIM_BLOCK=m
CONFIG_VP_VDPA=m
CONFIG_VHOST=m
CONFIG_VHOST_MENU=y
CONFIG_VHOST_NET=m
CONFIG_VHOST_VSOCK=m
CONFIG_VHOST_VDPA=m
CONFIG_RUNTIME_TESTING_MENU=y

Tested on openEuler 22.03 LTS:
```
$ modprobe vdpa
$ modprobe vdpa_sim
$ modprobe vdpa-sim-net
$ modprobe vhost-vdpa
$ vdpa dev add mgmtdev vdpasim_net name vdpa0
$ vdpa dev show
vdpa0: type network mgmtdev vdpasim_net vendor_id 0 max_vqs 2 max_vq_size 256
$ ls /dev/vhost-vdpa-*
/dev/vhost-vdpa-0
```




 
 
Link:https://gitee.com/openeuler/kernel/pulls/222

 
Reviewed-by: default avatarKevin Zhu <zhukeqian1@huawei.com>
Reviewed-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parents 606f08e8 be1d2d41
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment