-
Notifications
You must be signed in to change notification settings - Fork 3
Should AF_XDP's driver running on a seperate thread? #146
Copy link
Copy link
Open
Description
When working on AF_XDP driver, I went into some issue:
rattan/rattan-core/src/metal/io/af_xdp.rs
Lines 62 to 66 in acd3e01
| for packet in packets { | |
| self.sender | |
| .blocking_send(packet) | |
| .map_err(|_| std::io::Error::other("send error"))?; | |
| } |
I believe that the send_bulk quoted above is essential for rattan to achieve the packet forwarding performance comparable to that in the repo camellia 's examples. Yet blocking_send was used there, making it impossible to be used directly in the tokio runtime.
A direct solution is making our veth receiving futures, aka the ones tokio::spawn in VirtualEthernetEgress::new to
be running on a seperate thread, which means using std::thread::spawn. Is this the designed way to use it?
rattan/rattan-core/src/cells/external.rs
Lines 237 to 247 in acd3e01
| for d in driver.into_iter() { | |
| let notify = AsyncFd::new(d.raw_fd())?; | |
| tokio::spawn(Self::recv( | |
| flow_map.clone(), | |
| notify, | |
| d.into_receiver(), | |
| tx.clone(), | |
| log_tx.clone(), | |
| base_ts, | |
| )); | |
| } |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels