Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is a need to add dma_sync_single_for_cpu in the dma safety abstraction and provide a safe way of accessing the ptr of pic::device. #1020

Open
Richardhongyu opened this issue Jul 11, 2023 · 2 comments
Labels
• drivers Related to the example drivers in `drivers/`. • lib Related to the `rust/` library.

Comments

@Richardhongyu
Copy link

Richardhongyu commented Jul 11, 2023

With some effort, I successfully run the rust-e1000 driver developed by Fujita on a physical e1000 nic. During this phase, I find some needs to change some of the RFL safe abstractions.

The first is to provide a safety wrapper of dma_sync_single_for_cpu of the DMA subsystem. This function can fetch data from nic to memory by a DMA device. Without it, the data from the nic will be random. All the received packages will be dropped. The specific situation can be seen in this issue.

The second is to provide a safe way of accessing the PCI::device. The current draft PR uses a hack of changing the ptr of the device from pub(crate) to pub. It's definitely incorrect. We need a safe interface to do this.

@ojeda ojeda added • drivers Related to the example drivers in `drivers/`. • lib Related to the `rust/` library. labels Jul 11, 2023
@ojeda
Copy link
Member

ojeda commented Jul 11, 2023

Cc @fujita

@fujita
Copy link

fujita commented Jul 11, 2023

I've not checked but Andreas might have abstractions for the DMA mapping API? The NVME driver surely needs them.
I can't work on this now. I resume the e1000 stuff with abstractions for network device drivers someday but I'll try to work on abstractions for PHY drivers first after the discussion on netdev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
• drivers Related to the example drivers in `drivers/`. • lib Related to the `rust/` library.
Development

No branches or pull requests

3 participants