Skip to content

Commit 2271c26

Browse files
authored
build(deps): update aya to 0.13 (#2348)
1 parent 032f326 commit 2271c26

File tree

19 files changed

+43
-39
lines changed

19 files changed

+43
-39
lines changed

.github/workflows/ci.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ env:
1515
RUST_BACKTRACE: 1
1616
# Pin the nightly toolchain to prevent breakage.
1717
# This should be occasionally updated.
18-
RUST_NIGHTLY_TOOLCHAIN: nightly-2024-04-16
18+
RUST_NIGHTLY_TOOLCHAIN: nightly-2024-10-09
1919
CDN: https://dnglbrstg7yg.cloudfront.net
2020
# enable unstable features for testing
2121
S2N_UNSTABLE_CRYPTO_OPT_TX: 100
@@ -424,9 +424,8 @@ jobs:
424424
- name: Install rust toolchain
425425
id: toolchain
426426
run: |
427-
rustup toolchain install ${{ needs.env.outputs.msrv }} --profile minimal
428-
rustup override set ${{ needs.env.outputs.msrv }}
429-
427+
rustup toolchain install stable --profile minimal
428+
rustup override set stable
430429
431430
- name: Run cargo build
432431
run: cargo build --manifest-path ${{ matrix.crate }}

common/s2n-codec/src/decoder/value.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub trait DecoderValue<'a>: Sized {
1616
}
1717

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

2222
#[macro_export]

common/s2n-codec/src/zerocopy.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ macro_rules! zerocopy_value_codec {
2121
$name: $crate::zerocopy::FromBytes,
2222
{
2323
#[inline]
24-
fn decode(buffer: $crate::DecoderBuffer<'a>) -> $crate::DecoderBufferResult<Self> {
24+
fn decode(buffer: $crate::DecoderBuffer<'a>) -> $crate::DecoderBufferResult<'a, Self> {
2525
let (value, buffer) = <&'a $name as $crate::DecoderValue>::decode(buffer)?;
2626
Ok((*value, buffer))
2727
}
@@ -32,7 +32,7 @@ macro_rules! zerocopy_value_codec {
3232
$name: $crate::zerocopy::FromBytes,
3333
{
3434
#[inline]
35-
fn decode(buffer: $crate::DecoderBuffer<'a>) -> $crate::DecoderBufferResult<Self> {
35+
fn decode(buffer: $crate::DecoderBuffer<'a>) -> $crate::DecoderBufferResult<'a, Self> {
3636
let (value, buffer) = buffer.decode_slice(core::mem::size_of::<$name>())?;
3737
let value = value.into_less_safe_slice();
3838
let value = unsafe {
@@ -50,7 +50,7 @@ macro_rules! zerocopy_value_codec {
5050
#[inline]
5151
fn decode_mut(
5252
buffer: $crate::DecoderBufferMut<'a>,
53-
) -> $crate::DecoderBufferMutResult<Self> {
53+
) -> $crate::DecoderBufferMutResult<'a, Self> {
5454
let (value, buffer) = <&'a $name as $crate::DecoderValueMut>::decode_mut(buffer)?;
5555
Ok((*value, buffer))
5656
}

quic/s2n-quic-core/src/frame/ack.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ impl<'a> core::fmt::Debug for AckRangesDecoder<'a> {
282282

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

288288
// add one to the total, which includes the first ack range

quic/s2n-quic-core/src/recovery/congestion_controller.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ pub struct PathPublisher<'a, Pub: event::ConnectionPublisher> {
7171

7272
impl<'a, Pub: event::ConnectionPublisher> PathPublisher<'a, Pub> {
7373
/// Constructs a new `Publisher` around the given `event::ConnectionPublisher` and `path_id`
74-
pub fn new(publisher: &'a mut Pub, path_id: path::Id) -> PathPublisher<Pub> {
74+
pub fn new(publisher: &'a mut Pub, path_id: path::Id) -> PathPublisher<'a, Pub> {
7575
Self { publisher, path_id }
7676
}
7777
}

quic/s2n-quic-core/src/transport/parameters/mod.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ use crate::{
1212
use core::{mem::size_of, time::Duration};
1313
use s2n_codec::{
1414
decoder_invariant, decoder_value, DecoderBuffer, DecoderBufferMut, DecoderBufferMutResult,
15-
DecoderBufferResult, DecoderError, DecoderValue, DecoderValueMut, Encoder, EncoderBuffer,
16-
EncoderValue,
15+
DecoderBufferResult, DecoderError, DecoderValue, DecoderValueMut, Encoder, EncoderValue,
1716
};
1817

1918
#[cfg(test)]
@@ -48,7 +47,7 @@ pub trait TransportParameter: Sized {
4847
let original_size = buffer.len();
4948
let new_parameter_size = TransportParameterCodec(self).encoding_size();
5049
buffer.resize(original_size + new_parameter_size, 0);
51-
let mut buffer = EncoderBuffer::new(buffer);
50+
let mut buffer = s2n_codec::EncoderBuffer::new(buffer);
5251
buffer.set_position(original_size);
5352
buffer.encode(&TransportParameterCodec(self));
5453
}

quic/s2n-quic-qns/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ trace = ["s2n-quic-core/branch-tracing", "s2n-quic-core/probe-tracing", "s2n-qui
1414
xdp = ["s2n-quic/unstable-provider-io-xdp", "aya", "aya-log"]
1515

1616
[dependencies]
17-
aya = { version = "0.12", optional = true }
18-
aya-log = { version = "0.2", optional = true }
17+
aya = { version = "0.13", optional = true }
18+
aya-log = { version = "0.2.1", optional = true }
1919
bytes = { version = "1", default-features = false }
2020
cfg-if = "1"
2121
futures = "0.3"

quic/s2n-quic-qns/src/xdp.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use crate::Result;
55
use aya::{
66
maps::{HashMap, MapData, XskMap},
7-
programs, Bpf,
7+
programs, Ebpf,
88
};
99
use s2n_quic::provider::io::{
1010
self,
@@ -203,15 +203,15 @@ impl Xdp {
203203
fn bpf_task(&self, port: u16, rx_fds: Vec<(u32, socket::Fd)>) -> Result<()> {
204204
// load the default BPF program from s2n-quic-xdp
205205
let mut bpf = if self.bpf_trace {
206-
let mut bpf = Bpf::load(bpf::DEFAULT_PROGRAM_TRACE)?;
206+
let mut bpf = Ebpf::load(bpf::DEFAULT_PROGRAM_TRACE)?;
207207

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

212212
bpf
213213
} else {
214-
Bpf::load(bpf::DEFAULT_PROGRAM)?
214+
Ebpf::load(bpf::DEFAULT_PROGRAM)?
215215
};
216216

217217
let interface = self.interface.clone();

tools/xdp/ebpf/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ edition = "2021"
55

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

1212
[features]

tools/xdp/ebpf/rust-toolchain.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[toolchain]
22
# pin the version to prevent random breakage
3-
channel = "nightly-2024-04-16"
3+
channel = "nightly-2024-10-09"
44
# The source code of rustc, provided by the rust-src component, is needed for
55
# building eBPF programs.
66
components = [ "rustc", "cargo", "rust-src" ]

tools/xdp/ebpf/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#![no_std]
55
#![no_main]
66

7-
use aya_bpf::{
7+
use aya_ebpf::{
88
bindings::xdp_action,
99
macros::{map, xdp},
1010
maps::{HashMap, XskMap},

tools/xdp/rust-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "1.74.1"
2+
channel = "1.80.0"
33
components = [ "rustc", "clippy", "rustfmt" ]

tools/xdp/s2n-quic-xdp/Cargo.toml

+7-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ exclude = ["corpus.tar.gz"]
1414
default = ["tokio"]
1515

1616
[dependencies]
17-
aya = { version = "0.12", default-features = false }
17+
aya = { version = "0.13", default-features = false }
1818
bitflags = "2"
1919
errno = "0.3"
2020
libc = "0.2"
@@ -29,3 +29,9 @@ pin-project-lite = "0.2"
2929
rand = "0.8"
3030
s2n-quic-core = { path = "../../../quic/s2n-quic-core", features = ["testing"] }
3131
tokio = { version = "1", features = ["full"] }
32+
33+
[lints.rust.unexpected_cfgs]
34+
level = "warn"
35+
check-cfg = [
36+
'cfg(s2n_quic_xdp_trace)',
37+
]
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:fba47c364fb19e71609e40466441fc29af5e511a8396e6e4bb32d06b4391f4c7
3-
size 9040
2+
oid sha256:e7e1a2f7505be3f3e70c0db90fc558c45b5e2b33d9037dd7d35b003d2c730bd3
3+
size 8728
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:9e09f4d5daf0c71f144778deff4983187c543d2cc1e65df37cd7f17e54a96e62
3-
size 2568
2+
oid sha256:4bdb72572f52ad23f797ec7937fd0c56638b2fc1aa35147b8720588d6dbe4680
3+
size 2456
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:09e64ffe8cf1e6fef0ecab3addff835faec61784e3e887fa3977c1ba703eba63
3-
size 9072
2+
oid sha256:e7cd328e2c2686812c079b8e3a276255f351966fe119da24b17b89c50b0343cc
3+
size 8760
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:742fc28f3d94b579a18ae4f466c7577565e4eaaf88693c221fd670d2b2f51b4e
3-
size 2600
2+
oid sha256:0837e02ce8fa913832d6cfafefd6bd58901d8e2a018639e7fb127edd05eb1d2b
3+
size 2488

tools/xdp/tester/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ edition = "2021"
55
publish = false
66

77
[dependencies]
8-
aya = { version = "0.12", features = ["async_tokio"] }
9-
aya-log = "0.2"
8+
aya = { version = "0.13", features = ["async_tokio"] }
9+
aya-log = "0.2.1"
1010
clap = { version = "4.1", features = ["derive"] }
1111
anyhow = "1.0.68"
1212
env_logger = "0.11"

tools/xdp/tester/src/main.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
use anyhow::Context;
55
use aya::{
66
programs::{Xdp, XdpFlags},
7-
Bpf,
7+
Ebpf,
88
};
9-
use aya_log::BpfLogger;
9+
use aya_log::EbpfLogger;
1010
use clap::Parser;
1111
use log::{info, warn};
1212
use tokio::signal;
@@ -40,10 +40,10 @@ async fn main() -> Result<(), anyhow::Error> {
4040
s2n_quic_xdp::bpf::DEFAULT_PROGRAM
4141
};
4242

43-
let mut bpf = Bpf::load(bpf)?;
43+
let mut bpf = Ebpf::load(bpf)?;
4444

4545
if opt.trace {
46-
if let Err(e) = BpfLogger::init(&mut bpf) {
46+
if let Err(e) = EbpfLogger::init(&mut bpf) {
4747
warn!("failed to initialize eBPF logger: {}", e);
4848
}
4949
}

0 commit comments

Comments
 (0)