When working on AF_XDP driver, I went into some issue:
|
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?
|
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, |
|
)); |
|
} |
@minhuw
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
I believe that the
send_bulkquoted above is essential for rattan to achieve the packet forwarding performance comparable to that in the repocamellia's examples. Yetblocking_sendwas 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::spawninVirtualEthernetEgress::newtobe 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
@minhuw