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 aya to 0.13 #2348

Merged
merged 1 commit into from
Oct 9, 2024
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
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:
RUST_BACKTRACE: 1
# Pin the nightly toolchain to prevent breakage.
# This should be occasionally updated.
RUST_NIGHTLY_TOOLCHAIN: nightly-2024-04-16
RUST_NIGHTLY_TOOLCHAIN: nightly-2024-10-09
CDN: https://dnglbrstg7yg.cloudfront.net
# enable unstable features for testing
S2N_UNSTABLE_CRYPTO_OPT_TX: 100
Expand Down Expand Up @@ -424,9 +424,8 @@ jobs:
- name: Install rust toolchain
id: toolchain
run: |
rustup toolchain install ${{ needs.env.outputs.msrv }} --profile minimal
rustup override set ${{ needs.env.outputs.msrv }}

rustup toolchain install stable --profile minimal
rustup override set stable
Comment on lines +427 to +428
Copy link
Contributor

Choose a reason for hiding this comment

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

why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had to bump the MSRV for the s2n-quic-xdp crate higher than our root MSRV. But I wanted to avoid special casing this in the crates task so just using stable seemed better, especially since we've already got a specific test task to test the MSRV.


- name: Run cargo build
run: cargo build --manifest-path ${{ matrix.crate }}
Expand Down
2 changes: 1 addition & 1 deletion common/s2n-codec/src/decoder/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub trait DecoderValue<'a>: Sized {
}

pub trait DecoderValueMut<'a>: Sized {
fn decode_mut(bytes: DecoderBufferMut<'a>) -> DecoderBufferMutResult<Self>;
fn decode_mut(bytes: DecoderBufferMut<'a>) -> DecoderBufferMutResult<'a, Self>;
}

#[macro_export]
Expand Down
6 changes: 3 additions & 3 deletions common/s2n-codec/src/zerocopy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ macro_rules! zerocopy_value_codec {
$name: $crate::zerocopy::FromBytes,
{
#[inline]
fn decode(buffer: $crate::DecoderBuffer<'a>) -> $crate::DecoderBufferResult<Self> {
fn decode(buffer: $crate::DecoderBuffer<'a>) -> $crate::DecoderBufferResult<'a, Self> {
let (value, buffer) = <&'a $name as $crate::DecoderValue>::decode(buffer)?;
Ok((*value, buffer))
}
Expand All @@ -32,7 +32,7 @@ macro_rules! zerocopy_value_codec {
$name: $crate::zerocopy::FromBytes,
{
#[inline]
fn decode(buffer: $crate::DecoderBuffer<'a>) -> $crate::DecoderBufferResult<Self> {
fn decode(buffer: $crate::DecoderBuffer<'a>) -> $crate::DecoderBufferResult<'a, Self> {
let (value, buffer) = buffer.decode_slice(core::mem::size_of::<$name>())?;
let value = value.into_less_safe_slice();
let value = unsafe {
Expand All @@ -50,7 +50,7 @@ macro_rules! zerocopy_value_codec {
#[inline]
fn decode_mut(
buffer: $crate::DecoderBufferMut<'a>,
) -> $crate::DecoderBufferMutResult<Self> {
) -> $crate::DecoderBufferMutResult<'a, Self> {
let (value, buffer) = <&'a $name as $crate::DecoderValueMut>::decode_mut(buffer)?;
Ok((*value, buffer))
}
Expand Down
2 changes: 1 addition & 1 deletion quic/s2n-quic-core/src/frame/ack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ impl<'a> core::fmt::Debug for AckRangesDecoder<'a> {

decoder_parameterized_value!(
impl<'a> AckRangesDecoder<'a> {
fn decode(largest_acknowledged: VarInt, buffer: Buffer) -> Result<AckRangesDecoder> {
fn decode(largest_acknowledged: VarInt, buffer: Buffer) -> Result<AckRangesDecoder<'a>> {
let (mut ack_range_count, buffer) = buffer.decode::<VarInt>()?;

// add one to the total, which includes the first ack range
Expand Down
2 changes: 1 addition & 1 deletion quic/s2n-quic-core/src/recovery/congestion_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pub struct PathPublisher<'a, Pub: event::ConnectionPublisher> {

impl<'a, Pub: event::ConnectionPublisher> PathPublisher<'a, Pub> {
/// Constructs a new `Publisher` around the given `event::ConnectionPublisher` and `path_id`
pub fn new(publisher: &'a mut Pub, path_id: path::Id) -> PathPublisher<Pub> {
pub fn new(publisher: &'a mut Pub, path_id: path::Id) -> PathPublisher<'a, Pub> {
Self { publisher, path_id }
}
}
Expand Down
5 changes: 2 additions & 3 deletions quic/s2n-quic-core/src/transport/parameters/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ use crate::{
use core::{mem::size_of, time::Duration};
use s2n_codec::{
decoder_invariant, decoder_value, DecoderBuffer, DecoderBufferMut, DecoderBufferMutResult,
DecoderBufferResult, DecoderError, DecoderValue, DecoderValueMut, Encoder, EncoderBuffer,
EncoderValue,
DecoderBufferResult, DecoderError, DecoderValue, DecoderValueMut, Encoder, EncoderValue,
};

#[cfg(test)]
Expand Down Expand Up @@ -48,7 +47,7 @@ pub trait TransportParameter: Sized {
let original_size = buffer.len();
let new_parameter_size = TransportParameterCodec(self).encoding_size();
buffer.resize(original_size + new_parameter_size, 0);
let mut buffer = EncoderBuffer::new(buffer);
let mut buffer = s2n_codec::EncoderBuffer::new(buffer);
buffer.set_position(original_size);
buffer.encode(&TransportParameterCodec(self));
}
Expand Down
4 changes: 2 additions & 2 deletions quic/s2n-quic-qns/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ trace = ["s2n-quic-core/branch-tracing", "s2n-quic-core/probe-tracing", "s2n-qui
xdp = ["s2n-quic/unstable-provider-io-xdp", "aya", "aya-log"]

[dependencies]
aya = { version = "0.12", optional = true }
aya-log = { version = "0.2", optional = true }
aya = { version = "0.13", optional = true }
aya-log = { version = "0.2.1", optional = true }
bytes = { version = "1", default-features = false }
cfg-if = "1"
futures = "0.3"
Expand Down
8 changes: 4 additions & 4 deletions quic/s2n-quic-qns/src/xdp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use crate::Result;
use aya::{
maps::{HashMap, MapData, XskMap},
programs, Bpf,
programs, Ebpf,
};
use s2n_quic::provider::io::{
self,
Expand Down Expand Up @@ -203,15 +203,15 @@ impl Xdp {
fn bpf_task(&self, port: u16, rx_fds: Vec<(u32, socket::Fd)>) -> Result<()> {
// load the default BPF program from s2n-quic-xdp
let mut bpf = if self.bpf_trace {
let mut bpf = Bpf::load(bpf::DEFAULT_PROGRAM_TRACE)?;
let mut bpf = Ebpf::load(bpf::DEFAULT_PROGRAM_TRACE)?;

if let Err(err) = aya_log::BpfLogger::init(&mut bpf) {
if let Err(err) = aya_log::EbpfLogger::init(&mut bpf) {
eprint!("error initializing BPF trace: {err:?}");
}

bpf
} else {
Bpf::load(bpf::DEFAULT_PROGRAM)?
Ebpf::load(bpf::DEFAULT_PROGRAM)?
};

let interface = self.interface.clone();
Expand Down
4 changes: 2 additions & 2 deletions tools/xdp/ebpf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ edition = "2021"

[dependencies]
# These crates are not published so use a git dependency for now. See https://github.com/aya-rs/aya/issues/464
aya-bpf = { git = "https://github.com/aya-rs/aya", tag = "aya-v0.12.0" }
aya-log-ebpf = { git = "https://github.com/aya-rs/aya", tag = "aya-v0.12.0" }
aya-ebpf = { git = "https://github.com/aya-rs/aya", tag = "aya-v0.13.0" }
aya-log-ebpf = { git = "https://github.com/aya-rs/aya", tag = "aya-v0.13.0" }
s2n-quic-core = { path = "../../../quic/s2n-quic-core", default-features = false }

[features]
Expand Down
2 changes: 1 addition & 1 deletion tools/xdp/ebpf/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[toolchain]
# pin the version to prevent random breakage
channel = "nightly-2024-04-16"
channel = "nightly-2024-10-09"
# The source code of rustc, provided by the rust-src component, is needed for
# building eBPF programs.
components = [ "rustc", "cargo", "rust-src" ]
2 changes: 1 addition & 1 deletion tools/xdp/ebpf/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#![no_std]
#![no_main]

use aya_bpf::{
use aya_ebpf::{
bindings::xdp_action,
macros::{map, xdp},
maps::{HashMap, XskMap},
Expand Down
2 changes: 1 addition & 1 deletion tools/xdp/rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.74.1"
channel = "1.80.0"
components = [ "rustc", "clippy", "rustfmt" ]
8 changes: 7 additions & 1 deletion tools/xdp/s2n-quic-xdp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ exclude = ["corpus.tar.gz"]
default = ["tokio"]

[dependencies]
aya = { version = "0.12", default-features = false }
aya = { version = "0.13", default-features = false }
bitflags = "2"
errno = "0.3"
libc = "0.2"
Expand All @@ -29,3 +29,9 @@ pin-project-lite = "0.2"
rand = "0.8"
s2n-quic-core = { path = "../../../quic/s2n-quic-core", features = ["testing"] }
tokio = { version = "1", features = ["full"] }

[lints.rust.unexpected_cfgs]
level = "warn"
check-cfg = [
'cfg(s2n_quic_xdp_trace)',
]
4 changes: 2 additions & 2 deletions tools/xdp/s2n-quic-xdp/src/bpf/s2n-quic-xdp-bpfeb-trace.ebpf
Git LFS file not shown
4 changes: 2 additions & 2 deletions tools/xdp/s2n-quic-xdp/src/bpf/s2n-quic-xdp-bpfeb.ebpf
Git LFS file not shown
4 changes: 2 additions & 2 deletions tools/xdp/s2n-quic-xdp/src/bpf/s2n-quic-xdp-bpfel-trace.ebpf
Git LFS file not shown
4 changes: 2 additions & 2 deletions tools/xdp/s2n-quic-xdp/src/bpf/s2n-quic-xdp-bpfel.ebpf
Git LFS file not shown
4 changes: 2 additions & 2 deletions tools/xdp/tester/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ edition = "2021"
publish = false

[dependencies]
aya = { version = "0.12", features = ["async_tokio"] }
aya-log = "0.2"
aya = { version = "0.13", features = ["async_tokio"] }
aya-log = "0.2.1"
clap = { version = "4.1", features = ["derive"] }
anyhow = "1.0.68"
env_logger = "0.11"
Expand Down
8 changes: 4 additions & 4 deletions tools/xdp/tester/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
use anyhow::Context;
use aya::{
programs::{Xdp, XdpFlags},
Bpf,
Ebpf,
};
use aya_log::BpfLogger;
use aya_log::EbpfLogger;
use clap::Parser;
use log::{info, warn};
use tokio::signal;
Expand Down Expand Up @@ -40,10 +40,10 @@ async fn main() -> Result<(), anyhow::Error> {
s2n_quic_xdp::bpf::DEFAULT_PROGRAM
};

let mut bpf = Bpf::load(bpf)?;
let mut bpf = Ebpf::load(bpf)?;

if opt.trace {
if let Err(e) = BpfLogger::init(&mut bpf) {
if let Err(e) = EbpfLogger::init(&mut bpf) {
warn!("failed to initialize eBPF logger: {}", e);
}
}
Expand Down
Loading