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

Introduce VirtIONetRaw to allow custom NIC buffer management and used buffer notification suppression #111

Merged
merged 14 commits into from
Nov 14, 2023

Conversation

hky1999
Copy link
Contributor

@hky1999 hky1999 commented Sep 25, 2023

Some tiny modifications need to be completed within ArceOS. @equation314

@hky1999
Copy link
Contributor Author

hky1999 commented Sep 27, 2023

Arceos PR : arceos-org/arceos#129

Copy link
Collaborator

@qwandor qwandor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This mostly looks good, but some minor things to fix.

src/queue.rs Outdated Show resolved Hide resolved
src/device/net/dev.rs Outdated Show resolved Hide resolved
src/device/net/dev.rs Show resolved Hide resolved
src/device/net/dev_raw.rs Outdated Show resolved Hide resolved
src/device/net/dev_raw.rs Outdated Show resolved Hide resolved
///
/// [`fill_buffer_header`]: Self::fill_buffer_header
pub fn transmit_wait(&mut self, tx_buf: &[u8]) -> Result<usize> {
let token = unsafe { self.transmit_begin(tx_buf)? };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add safety comments for the unsafe blocks, or better, use add_notify_wait_pop to avoid them entirely.

src/device/net/dev_raw.rs Outdated Show resolved Hide resolved
src/device/net/dev_raw.rs Outdated Show resolved Hide resolved
@hky1999 hky1999 requested a review from qwandor November 13, 2023 05:30
src/device/net/dev_raw.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@qwandor qwandor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tidying this up! Just two minor comments then I'm happy to merge it.

}

/// Whether can receive packet.
pub fn can_recv(&self) -> bool {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just remove this, poll_receive fills the same purpose.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean peek_used?
Since it was used by ArceOS, so I reserve it, it has been deleted!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant the poll_receive method that you added to VirtIONetRaw, which calls peek_used internally.

I've pushed a commit to keep can_recv on VirtIONet, by calling VirtIONetRAW::peek_used.

@hky1999 hky1999 requested a review from qwandor November 14, 2023 12:47
@qwandor qwandor merged commit 3da64ea into rcore-os:master Nov 14, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants