SlideShare a Scribd company logo
1 of 15
Progress of Wrapdrive
(A Common Accelerator Framework for User Space)
Zaibo Xu from Huawei
Contents
● Looking back
● Progress
● Current Challenges
● Plans
Looking back on Wrapdrive: SFO 2017
What is Wrapdrive (WD)?
1. An accelerator framework for
user space, leveraging hardware
accelerators with native
performance.
2. Based on VFIO and VFIO Mdev,
allowing direct access of hardware
with improved security and
efficiency.
3. Hardware accelerator is accessed
via a ‘queue’, the minimal working
unit for user. The queue’s DMA
priority is controlled by the user.
Looking back on Wrapdrive: SFO 2017
Why Wrapdrive?
● Try to get the native performance of accelerator.
● Break the limit of one device serving only one process with ‘queue’.
● ‘Queue’ should be managed with more security.
Status back then
● Shared virtual memory (SVM, SVA) was in the phase of RFC.
● Substream-ID was not supported by SMMU driver .
● Wrapdrive supported only one process.
Wrapdrive Progress
● Support SVA
● DMA mapping one device from multiple processes
● Keep compatibility (native, normal mdev)
Support SVA
● Extends SVA patch set from Jean-Philippe Brucker.
○ https://www.spinics.net/lists/devicetree/msg214285.html
● Currently no I/O page fault (IOPF).
○ Uses ‘mlock’ to trigger any faults before DMA access and to prevent the pages from being
swapped.
○ In theory, WD can support SVA with IOPF, but no accelerator is yet available to test.
● Tested on a Hisilicon D06 board of Hisilicon with ZIP accelerator (Example)
● One Wrapdrive device (Wdev) serves multiple processes including kernel.
○ VFIO can bind one Mdev(queue) to serve one process with an IO page table, so accelerator
supported PASID with multiple queues can support multiple processes. Moreover, kernel
default IO page table’s PASID is zero, which is existing as before.
DMA Mapping in multiple processes
● Add VFIO APIs for private DMA map, similar to SVA VFIO bind/unbind.
+#define VFIO_IOMMU_ATTACH _IO(VFIO_TYPE, VFIO_BASE + 24)
+#define VFIO_IOMMU_DETACH _IO(VFIO_TYPE, VFIO_BASE + 25)
● VFIO_IOMMU_ATTACH creates a PASID linked IOVA address space for the
VFIO container.
● This IOVA address space is retrieved using a DMA map operation.
● iommu map/unmap versions with PASID is added to the iommu operations.
/* Actually, ‘io_mm’ denotes an address space and it includes a PASID */
struct iommu_ops {
…
int (*map)(struct iommu_domain *domain, unsigned long iova, phys_addr_t paddr, size_t size, int prot);
size_t (*unmap)(struct iommu_domain *domain, unsigned long iova, size_t size);
+int (*sva_map)(struct iommu_domain *domain, struct io_mm *io_mm, unsigned long iova, phys_addr_t paddr, size_t size, int prot);
+size_t (*sva_unmap)(struct iommu_domain *domain, struct io_mm *io_mm, unsigned long iova, size_t size);
…
}
● May be merged with normal map/unmap in future.
Extend standard interfaces
● A pointer to the parent device iommu_group is added to the vfio_group.
struct vfio_group {
struct iommu_group *iommu_group;
+/* iommu_group of mdev's parent device */
+struct iommu_group *parent_group;
struct list_head next;
};
● A Wdev enabling method is added in ‘vfio_iommu_type1_attach_group’.
mdev_bus = symbol_get(mdev_bus_type);
if (mdev_bus) {
if ((bus == mdev_bus) && !iommu_present(bus)) {
…
+/* Check if it is wdev (wrapdrive device) and get parent device’s group, or go default logic */
+ret = iommu_group_for_each_dev(iommu_group, &pgroup, vfio_wdev_type);
…
+domain->domain = iommu_group_default_domain(pgroup);
+group->parent_group = pgroup;
…
+return 0;
+}
if (!iommu->external_domain) {
● Normal Mediated Device handling is untouched (vGPU etc)
Wrapdrive is moved into VFIO as VFIO_Wdev, and a hardware queue can be a Mdev if the DEV is a VFIO_Wdev. For
Mdev from VFIO_Wdev, VFIO operations are finally applied on Mdev’s parent device. One device supports multiple
processes without unbinding its driver.
VFIO
VFIO_Mdev
VFIO_Wdev
Relationship with VFIO / MDEV
IOMMU
DEV
…
Queue
Queue
Process
Process
…
IO PGTBL
IO PGTBL
PGTBL
PGTBL
…
…
DEV
…
Queue
Queue
Process
Process
…
SVA
Processes
DMA MAP
iommu_domain
iommu_domain
Kernel IO
PGTBL
PASID = 0
Example
● zlib acceleration on a Hisilicon D06 board (using a ZIP accelerator)
Source code:https://github.com/zaiboxu/wrapdrive.git Branch:wrapdrive-4.15-rc9
ZIP K_DRV
VFIO_WDEV
vfio_wdev_register
VFIO
ZIP U_DRV
U_WD
Test
Sample
1. Synchronous and asynchronous
mode APIs of WD compared.
2. Multiple DMA map and SVA no IOPF
scenarios compared.
3. Each scenario is run by 1 or 3
processes.
4. A range of different packet lengths.
Zlib acceleration performance
● zlib throughput on Hisilicon D06 board (using ZIP accelerator)
Source code:https://github.com/zaiboxu/wrapdrive.git Branch:wrapdrive-4.15-rc9
Mpps Mpps
Bytes
8 scenarios : ZIP accelerator serves 1 or 3 processes with SVA no IOPF or multiple map in synchronous or asynchronous modes.
Current Challenges
● Still existing security risk since several users work on one device.
○ ‘Queue’ is not isolated as much as a task in the OS.
● Wrapdrive queue management on VFIO Mdev is still awkward.
○ Creating Mdev for WD needs root permission.
○ Getting/putting a WD queue involves a series of Sysfs operations.
○ Mdev held by a process cannot be released automatically if the process exits unexpectedly.
● Coexist with Linux kernel Crypto / AF_ALG (controversial topic)
○ Ecosystem is ready because devices support PASID/PRI/ATS/ATC and corresponding software
such as VFIO and SVA is in place.
○ Userspace should be able to leverage accelerators directly with high performance now that
devices can DMA in user space in a fast and secure way.
Plans
● SVA with I/O page fault (hardware dependent)
● Extend to other type of devices (e.g. NIC)
○ Benefits user space data plane applications (ODP/DPDK etc)
● VFIO_Mdev framework Optimization to better support the requirements of
Wrapdrive.
Contributions/ack
Thank You!
And question?
xuzaibo@huawei.com

More Related Content

More from Linaro

Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...Linaro
 
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...Linaro
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineLinaro
 
HKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening KeynoteHKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening KeynoteLinaro
 
HKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP WorkshopHKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP WorkshopLinaro
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineLinaro
 
HKG18-315 - Why the ecosystem is a wonderful thing, warts and all
HKG18-315 - Why the ecosystem is a wonderful thing, warts and allHKG18-315 - Why the ecosystem is a wonderful thing, warts and all
HKG18-315 - Why the ecosystem is a wonderful thing, warts and allLinaro
 
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse HypervisorHKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse HypervisorLinaro
 
HKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMUHKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMULinaro
 
HKG18-113- Secure Data Path work with i.MX8M
HKG18-113- Secure Data Path work with i.MX8MHKG18-113- Secure Data Path work with i.MX8M
HKG18-113- Secure Data Path work with i.MX8MLinaro
 
HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation Linaro
 
HKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted bootHKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted bootLinaro
 
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...Linaro
 
HKG18-317 - Arm Server Ready Program
HKG18-317 - Arm Server Ready ProgramHKG18-317 - Arm Server Ready Program
HKG18-317 - Arm Server Ready ProgramLinaro
 
HKG18-312 - CMSIS-NN
HKG18-312 - CMSIS-NNHKG18-312 - CMSIS-NN
HKG18-312 - CMSIS-NNLinaro
 
HKG18-301 - Dramatically Accelerate 96Board Software via an FPGA with Integra...
HKG18-301 - Dramatically Accelerate 96Board Software via an FPGA with Integra...HKG18-301 - Dramatically Accelerate 96Board Software via an FPGA with Integra...
HKG18-301 - Dramatically Accelerate 96Board Software via an FPGA with Integra...Linaro
 
HKG18-300K2 - Keynote: Tomas Evensen - All Programmable SoCs? – Platforms to ...
HKG18-300K2 - Keynote: Tomas Evensen - All Programmable SoCs? – Platforms to ...HKG18-300K2 - Keynote: Tomas Evensen - All Programmable SoCs? – Platforms to ...
HKG18-300K2 - Keynote: Tomas Evensen - All Programmable SoCs? – Platforms to ...Linaro
 
HKG18-212 - Trusted Firmware M: Introduction
HKG18-212 - Trusted Firmware M: IntroductionHKG18-212 - Trusted Firmware M: Introduction
HKG18-212 - Trusted Firmware M: IntroductionLinaro
 
HKG18-116 - RAS Solutions for Arm64 Servers
HKG18-116 - RAS Solutions for Arm64 ServersHKG18-116 - RAS Solutions for Arm64 Servers
HKG18-116 - RAS Solutions for Arm64 ServersLinaro
 
HKG18-TR14 - Postmortem Debugging with Coresight
HKG18-TR14 - Postmortem Debugging with CoresightHKG18-TR14 - Postmortem Debugging with Coresight
HKG18-TR14 - Postmortem Debugging with CoresightLinaro
 

More from Linaro (20)

Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
 
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
 
HKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening KeynoteHKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening Keynote
 
HKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP WorkshopHKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP Workshop
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
 
HKG18-315 - Why the ecosystem is a wonderful thing, warts and all
HKG18-315 - Why the ecosystem is a wonderful thing, warts and allHKG18-315 - Why the ecosystem is a wonderful thing, warts and all
HKG18-315 - Why the ecosystem is a wonderful thing, warts and all
 
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse HypervisorHKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
 
HKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMUHKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMU
 
HKG18-113- Secure Data Path work with i.MX8M
HKG18-113- Secure Data Path work with i.MX8MHKG18-113- Secure Data Path work with i.MX8M
HKG18-113- Secure Data Path work with i.MX8M
 
HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation
 
HKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted bootHKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted boot
 
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
 
HKG18-317 - Arm Server Ready Program
HKG18-317 - Arm Server Ready ProgramHKG18-317 - Arm Server Ready Program
HKG18-317 - Arm Server Ready Program
 
HKG18-312 - CMSIS-NN
HKG18-312 - CMSIS-NNHKG18-312 - CMSIS-NN
HKG18-312 - CMSIS-NN
 
HKG18-301 - Dramatically Accelerate 96Board Software via an FPGA with Integra...
HKG18-301 - Dramatically Accelerate 96Board Software via an FPGA with Integra...HKG18-301 - Dramatically Accelerate 96Board Software via an FPGA with Integra...
HKG18-301 - Dramatically Accelerate 96Board Software via an FPGA with Integra...
 
HKG18-300K2 - Keynote: Tomas Evensen - All Programmable SoCs? – Platforms to ...
HKG18-300K2 - Keynote: Tomas Evensen - All Programmable SoCs? – Platforms to ...HKG18-300K2 - Keynote: Tomas Evensen - All Programmable SoCs? – Platforms to ...
HKG18-300K2 - Keynote: Tomas Evensen - All Programmable SoCs? – Platforms to ...
 
HKG18-212 - Trusted Firmware M: Introduction
HKG18-212 - Trusted Firmware M: IntroductionHKG18-212 - Trusted Firmware M: Introduction
HKG18-212 - Trusted Firmware M: Introduction
 
HKG18-116 - RAS Solutions for Arm64 Servers
HKG18-116 - RAS Solutions for Arm64 ServersHKG18-116 - RAS Solutions for Arm64 Servers
HKG18-116 - RAS Solutions for Arm64 Servers
 
HKG18-TR14 - Postmortem Debugging with Coresight
HKG18-TR14 - Postmortem Debugging with CoresightHKG18-TR14 - Postmortem Debugging with Coresight
HKG18-TR14 - Postmortem Debugging with Coresight
 

Recently uploaded

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 

Recently uploaded (20)

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

HKG18- 214 - Progress of Wrapdrive

  • 1. Progress of Wrapdrive (A Common Accelerator Framework for User Space) Zaibo Xu from Huawei
  • 2. Contents ● Looking back ● Progress ● Current Challenges ● Plans
  • 3. Looking back on Wrapdrive: SFO 2017 What is Wrapdrive (WD)? 1. An accelerator framework for user space, leveraging hardware accelerators with native performance. 2. Based on VFIO and VFIO Mdev, allowing direct access of hardware with improved security and efficiency. 3. Hardware accelerator is accessed via a ‘queue’, the minimal working unit for user. The queue’s DMA priority is controlled by the user.
  • 4. Looking back on Wrapdrive: SFO 2017 Why Wrapdrive? ● Try to get the native performance of accelerator. ● Break the limit of one device serving only one process with ‘queue’. ● ‘Queue’ should be managed with more security. Status back then ● Shared virtual memory (SVM, SVA) was in the phase of RFC. ● Substream-ID was not supported by SMMU driver . ● Wrapdrive supported only one process.
  • 5. Wrapdrive Progress ● Support SVA ● DMA mapping one device from multiple processes ● Keep compatibility (native, normal mdev)
  • 6. Support SVA ● Extends SVA patch set from Jean-Philippe Brucker. ○ https://www.spinics.net/lists/devicetree/msg214285.html ● Currently no I/O page fault (IOPF). ○ Uses ‘mlock’ to trigger any faults before DMA access and to prevent the pages from being swapped. ○ In theory, WD can support SVA with IOPF, but no accelerator is yet available to test. ● Tested on a Hisilicon D06 board of Hisilicon with ZIP accelerator (Example) ● One Wrapdrive device (Wdev) serves multiple processes including kernel. ○ VFIO can bind one Mdev(queue) to serve one process with an IO page table, so accelerator supported PASID with multiple queues can support multiple processes. Moreover, kernel default IO page table’s PASID is zero, which is existing as before.
  • 7. DMA Mapping in multiple processes ● Add VFIO APIs for private DMA map, similar to SVA VFIO bind/unbind. +#define VFIO_IOMMU_ATTACH _IO(VFIO_TYPE, VFIO_BASE + 24) +#define VFIO_IOMMU_DETACH _IO(VFIO_TYPE, VFIO_BASE + 25) ● VFIO_IOMMU_ATTACH creates a PASID linked IOVA address space for the VFIO container. ● This IOVA address space is retrieved using a DMA map operation. ● iommu map/unmap versions with PASID is added to the iommu operations. /* Actually, ‘io_mm’ denotes an address space and it includes a PASID */ struct iommu_ops { … int (*map)(struct iommu_domain *domain, unsigned long iova, phys_addr_t paddr, size_t size, int prot); size_t (*unmap)(struct iommu_domain *domain, unsigned long iova, size_t size); +int (*sva_map)(struct iommu_domain *domain, struct io_mm *io_mm, unsigned long iova, phys_addr_t paddr, size_t size, int prot); +size_t (*sva_unmap)(struct iommu_domain *domain, struct io_mm *io_mm, unsigned long iova, size_t size); … } ● May be merged with normal map/unmap in future.
  • 8. Extend standard interfaces ● A pointer to the parent device iommu_group is added to the vfio_group. struct vfio_group { struct iommu_group *iommu_group; +/* iommu_group of mdev's parent device */ +struct iommu_group *parent_group; struct list_head next; }; ● A Wdev enabling method is added in ‘vfio_iommu_type1_attach_group’. mdev_bus = symbol_get(mdev_bus_type); if (mdev_bus) { if ((bus == mdev_bus) && !iommu_present(bus)) { … +/* Check if it is wdev (wrapdrive device) and get parent device’s group, or go default logic */ +ret = iommu_group_for_each_dev(iommu_group, &pgroup, vfio_wdev_type); … +domain->domain = iommu_group_default_domain(pgroup); +group->parent_group = pgroup; … +return 0; +} if (!iommu->external_domain) { ● Normal Mediated Device handling is untouched (vGPU etc)
  • 9. Wrapdrive is moved into VFIO as VFIO_Wdev, and a hardware queue can be a Mdev if the DEV is a VFIO_Wdev. For Mdev from VFIO_Wdev, VFIO operations are finally applied on Mdev’s parent device. One device supports multiple processes without unbinding its driver. VFIO VFIO_Mdev VFIO_Wdev Relationship with VFIO / MDEV IOMMU DEV … Queue Queue Process Process … IO PGTBL IO PGTBL PGTBL PGTBL … … DEV … Queue Queue Process Process … SVA Processes DMA MAP iommu_domain iommu_domain Kernel IO PGTBL PASID = 0
  • 10. Example ● zlib acceleration on a Hisilicon D06 board (using a ZIP accelerator) Source code:https://github.com/zaiboxu/wrapdrive.git Branch:wrapdrive-4.15-rc9 ZIP K_DRV VFIO_WDEV vfio_wdev_register VFIO ZIP U_DRV U_WD Test Sample 1. Synchronous and asynchronous mode APIs of WD compared. 2. Multiple DMA map and SVA no IOPF scenarios compared. 3. Each scenario is run by 1 or 3 processes. 4. A range of different packet lengths.
  • 11. Zlib acceleration performance ● zlib throughput on Hisilicon D06 board (using ZIP accelerator) Source code:https://github.com/zaiboxu/wrapdrive.git Branch:wrapdrive-4.15-rc9 Mpps Mpps Bytes 8 scenarios : ZIP accelerator serves 1 or 3 processes with SVA no IOPF or multiple map in synchronous or asynchronous modes.
  • 12. Current Challenges ● Still existing security risk since several users work on one device. ○ ‘Queue’ is not isolated as much as a task in the OS. ● Wrapdrive queue management on VFIO Mdev is still awkward. ○ Creating Mdev for WD needs root permission. ○ Getting/putting a WD queue involves a series of Sysfs operations. ○ Mdev held by a process cannot be released automatically if the process exits unexpectedly. ● Coexist with Linux kernel Crypto / AF_ALG (controversial topic) ○ Ecosystem is ready because devices support PASID/PRI/ATS/ATC and corresponding software such as VFIO and SVA is in place. ○ Userspace should be able to leverage accelerators directly with high performance now that devices can DMA in user space in a fast and secure way.
  • 13. Plans ● SVA with I/O page fault (hardware dependent) ● Extend to other type of devices (e.g. NIC) ○ Benefits user space data plane applications (ODP/DPDK etc) ● VFIO_Mdev framework Optimization to better support the requirements of Wrapdrive.