Don't poll ifaces if not necessary

This commit is contained in:
Ruihan Li
2024-11-16 23:09:20 +08:00
committed by Tate, Hongliang Tian
parent fab61f5f66
commit 1c1da8ea06
11 changed files with 217 additions and 87 deletions

View File

@ -6,7 +6,7 @@ use aster_bigtcp::device::WithDevice;
use ostd::sync::LocalIrqDisabled;
use spin::Once;
use super::{poll_ifaces, Iface};
use super::{poll::poll_ifaces, Iface};
use crate::{
net::iface::ext::{IfaceEx, IfaceExt},
prelude::*,

View File

@ -4,8 +4,9 @@ mod ext;
mod init;
mod poll;
pub use ext::IfaceEx;
pub use init::{init, IFACES};
pub use poll::{lazy_init, poll_ifaces};
pub use poll::lazy_init;
pub type Iface = dyn aster_bigtcp::iface::Iface<ext::IfaceExt>;
pub type BoundTcpSocket = aster_bigtcp::socket::BoundTcpSocket<ext::IfaceExt>;

View File

@ -19,7 +19,7 @@ pub fn lazy_init() {
}
}
pub fn poll_ifaces() {
pub(super) fn poll_ifaces() {
let ifaces = IFACES.get().unwrap();
for iface in ifaces.iter() {