Skip to content

Commit a8d7060

Browse files
committed
Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
Pull virtio updates from Michael Tsirkin: - resume support in vdpa/solidrun - structure size optimizations in virtio_pci - new pds_vdpa driver - immediate initialization mechanism for vdpa/ifcvf - interrupt bypass for vdpa/mlx5 - multiple worker support for vhost - viirtio net in Intel F2000X-PL support for vdpa/ifcvf - fixes, cleanups all over the place * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: (48 commits) vhost: Make parameter name match of vhost_get_vq_desc() vduse: fix NULL pointer dereference vhost: Allow worker switching while work is queueing vhost_scsi: add support for worker ioctls vhost: allow userspace to create workers vhost: replace single worker pointer with xarray vhost: add helper to parse userspace vring state/file vhost: remove vhost_work_queue vhost_scsi: flush IO vqs then send TMF rsp vhost_scsi: convert to vhost_vq_work_queue vhost_scsi: make SCSI cmd completion per vq vhost_sock: convert to vhost_vq_work_queue vhost: convert poll work to be vq based vhost: take worker or vq for flushing vhost: take worker or vq instead of dev for queueing vhost, vhost_net: add helper to check if vq has work vhost: add vhost_worker pointer to vhost_virtqueue vhost: dynamically allocate vhost_worker vhost: create worker at end of vhost_dev_set_owner virtio_bt: call scheduler when we free unused buffs ...
2 parents e8069f5 + 9e396a2 commit a8d7060

42 files changed

Lines changed: 2767 additions & 348 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
.. SPDX-License-Identifier: GPL-2.0+
2+
.. note: can be edited and viewed with /usr/bin/formiko-vim
3+
4+
==========================================================
5+
PCI vDPA driver for the AMD/Pensando(R) DSC adapter family
6+
==========================================================
7+
8+
AMD/Pensando vDPA VF Device Driver
9+
10+
Copyright(c) 2023 Advanced Micro Devices, Inc
11+
12+
Overview
13+
========
14+
15+
The ``pds_vdpa`` driver is an auxiliary bus driver that supplies
16+
a vDPA device for use by the virtio network stack. It is used with
17+
the Pensando Virtual Function devices that offer vDPA and virtio queue
18+
services. It depends on the ``pds_core`` driver and hardware for the PF
19+
and VF PCI handling as well as for device configuration services.
20+
21+
Using the device
22+
================
23+
24+
The ``pds_vdpa`` device is enabled via multiple configuration steps and
25+
depends on the ``pds_core`` driver to create and enable SR-IOV Virtual
26+
Function devices. After the VFs are enabled, we enable the vDPA service
27+
in the ``pds_core`` device to create the auxiliary devices used by pds_vdpa.
28+
29+
Example steps:
30+
31+
.. code-block:: bash
32+
33+
#!/bin/bash
34+
35+
modprobe pds_core
36+
modprobe vdpa
37+
modprobe pds_vdpa
38+
39+
PF_BDF=`ls /sys/module/pds_core/drivers/pci\:pds_core/*/sriov_numvfs | awk -F / '{print $7}'`
40+
41+
# Enable vDPA VF auxiliary device(s) in the PF
42+
devlink dev param set pci/$PF_BDF name enable_vnet cmode runtime value true
43+
44+
# Create a VF for vDPA use
45+
echo 1 > /sys/bus/pci/drivers/pds_core/$PF_BDF/sriov_numvfs
46+
47+
# Find the vDPA services/devices available
48+
PDS_VDPA_MGMT=`vdpa mgmtdev show | grep vDPA | head -1 | cut -d: -f1`
49+
50+
# Create a vDPA device for use in virtio network configurations
51+
vdpa dev add name vdpa1 mgmtdev $PDS_VDPA_MGMT mac 00:11:22:33:44:55
52+
53+
# Set up an ethernet interface on the vdpa device
54+
modprobe virtio_vdpa
55+
56+
57+
58+
Enabling the driver
59+
===================
60+
61+
The driver is enabled via the standard kernel configuration system,
62+
using the make command::
63+
64+
make oldconfig/menuconfig/etc.
65+
66+
The driver is located in the menu structure at:
67+
68+
-> Device Drivers
69+
-> Network device support (NETDEVICES [=y])
70+
-> Ethernet driver support
71+
-> Pensando devices
72+
-> Pensando Ethernet PDS_VDPA Support
73+
74+
Support
75+
=======
76+
77+
For general Linux networking support, please use the netdev mailing
78+
list, which is monitored by Pensando personnel::
79+
80+
netdev@vger.kernel.org
81+
82+
For more specific support needs, please use the Pensando driver support
83+
email::
84+
85+
drivers@pensando.io

Documentation/networking/device_drivers/ethernet/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Contents:
1515
amazon/ena
1616
altera/altera_tse
1717
amd/pds_core
18+
amd/pds_vdpa
1819
aquantia/atlantic
1920
chelsio/cxgb
2021
cirrus/cs89x0

MAINTAINERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22535,6 +22535,10 @@ F: include/linux/vringh.h
2253522535
F: include/uapi/linux/virtio_*.h
2253622536
F: tools/virtio/
2253722537

22538+
PDS DSC VIRTIO DATA PATH ACCELERATOR
22539+
R: Shannon Nelson <shannon.nelson@amd.com>
22540+
F: drivers/vdpa/pds/
22541+
2253822542
VIRTIO CRYPTO DRIVER
2253922543
M: Gonglei <arei.gonglei@huawei.com>
2254022544
L: virtualization@lists.linux-foundation.org

drivers/bluetooth/virtio_bt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ static int virtbt_close_vdev(struct virtio_bluetooth *vbt)
7979

8080
while ((skb = virtqueue_detach_unused_buf(vq)))
8181
kfree_skb(skb);
82+
cond_resched();
8283
}
8384

8485
return 0;

drivers/char/virtio_console.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1936,6 +1936,7 @@ static void remove_vqs(struct ports_device *portdev)
19361936
flush_bufs(vq, true);
19371937
while ((buf = virtqueue_detach_unused_buf(vq)))
19381938
free_buf(buf, true);
1939+
cond_resched();
19391940
}
19401941
portdev->vdev->config->del_vqs(portdev->vdev);
19411942
kfree(portdev->in_vqs);

drivers/crypto/virtio/virtio_crypto_core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ static void virtcrypto_free_unused_reqs(struct virtio_crypto *vcrypto)
480480
kfree(vc_req->req_data);
481481
kfree(vc_req->sgs);
482482
}
483+
cond_resched();
483484
}
484485
}
485486

drivers/vdpa/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,14 @@ config ALIBABA_ENI_VDPA
116116
This driver includes a HW monitor device that
117117
reads health values from the DPU.
118118

119+
config PDS_VDPA
120+
tristate "vDPA driver for AMD/Pensando DSC devices"
121+
select VIRTIO_PCI_LIB
122+
depends on PCI_MSI
123+
depends on PDS_CORE
124+
help
125+
vDPA network driver for AMD/Pensando's PDS Core devices.
126+
With this driver, the VirtIO dataplane can be
127+
offloaded to an AMD/Pensando DSC device.
128+
119129
endif # VDPA

drivers/vdpa/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ obj-$(CONFIG_MLX5_VDPA) += mlx5/
77
obj-$(CONFIG_VP_VDPA) += virtio_pci/
88
obj-$(CONFIG_ALIBABA_ENI_VDPA) += alibaba/
99
obj-$(CONFIG_SNET_VDPA) += solidrun/
10+
obj-$(CONFIG_PDS_VDPA) += pds/

0 commit comments

Comments
 (0)