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

build(deps): update rand requirement in /tools/xdp #2474

Merged
merged 1 commit into from
Feb 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/xdp/s2n-quic-xdp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ tokio = { version = "1", features = ["net"], optional = true }
bolero = "0.12"
futures = "0.3"
pin-project-lite = "0.2"
rand = "0.8"
rand = "0.9"
s2n-quic-core = { path = "../../../quic/s2n-quic-core", features = ["testing"] }
tokio = { version = "1", features = ["full"] }

Expand Down
6 changes: 3 additions & 3 deletions tools/xdp/s2n-quic-xdp/src/io/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use super::{
};
use crate::{if_xdp::RingFlags, ring, umem::Umem};
use core::{mem::size_of, time::Duration};
use rand::prelude::*;
use rand::Rng;
use s2n_quic_core::{
inet::ExplicitCongestionNotification,
io::{
Expand Down Expand Up @@ -131,7 +131,7 @@ async fn send(count: u32, outputs: Vec<tx::Channel<atomic_waker::Handle>>, umem:

tx.queue(|queue| {
let max = queue.capacity().min((count - counter) as usize);
let count = thread_rng().gen_range(0..=max);
let count = rand::rng().random_range(0..=max);
trace!("max: {max}, count: {count}");

for _ in 0..count {
Expand Down Expand Up @@ -182,7 +182,7 @@ async fn recv(packets: u32, inputs: Vec<rx::Channel<atomic_waker::Handle>>, umem

/// Randomly yields to other tasks
async fn maybe_yield() {
if thread_rng().gen() {
if rand::rng().random() {
trace!("yielding");
tokio::task::yield_now().await;
}
Expand Down
Loading