Skip to content

Commit

Permalink
Merge pull request bpfman#766 from astoycos/aya-main
Browse files Browse the repository at this point in the history
bpfd: update to aya:main
  • Loading branch information
mergify[bot] authored Oct 12, 2023
2 parents aa6a942 + cb7d38d commit 01d21bb
Show file tree
Hide file tree
Showing 10 changed files with 106 additions and 109 deletions.
195 changes: 96 additions & 99 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ members = [
resolver = "2"

[patch.crates-io]
aya = { git = "https://github.com/bpfd-dev/aya", branch = "main" }
aya = { git = "https://github.com/aya-rs/aya", branch = "main" }

[workspace.dependencies]
anyhow = { version = "1", default-features = false }
Expand Down
6 changes: 3 additions & 3 deletions bpfd/src/bpf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ impl BpfManager {
tracepoint.load()?;
program
.data
.set_kernel_info(Some(tracepoint.program_info()?.try_into()?));
.set_kernel_info(Some(tracepoint.info()?.try_into()?));

let link_id = tracepoint.attach(&category, &name)?;

Expand Down Expand Up @@ -510,7 +510,7 @@ impl BpfManager {

program
.data
.set_kernel_info(Some(kprobe.program_info()?.try_into()?));
.set_kernel_info(Some(kprobe.info()?.try_into()?));

let link_id = kprobe.attach(program.fn_name.as_str(), program.offset)?;

Expand Down Expand Up @@ -551,7 +551,7 @@ impl BpfManager {

program
.data
.set_kernel_info(Some(uprobe.program_info()?.try_into()?));
.set_kernel_info(Some(uprobe.info()?.try_into()?));

let link_id = uprobe.attach(
program.fn_name.as_deref(),
Expand Down
2 changes: 2 additions & 0 deletions bpfd/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ pub enum BpfdError {
#[error("An error occurred. {0}")]
Error(String),
#[error(transparent)]
BpfIOError(#[from] std::io::Error),
#[error(transparent)]
BpfProgramError(#[from] aya::programs::ProgramError),
#[error(transparent)]
BpfLoadError(#[from] aya::BpfError),
Expand Down
3 changes: 1 addition & 2 deletions bpfd/src/multiprog/tc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,7 @@ impl TcDispatcher {
let target_fn = format!("prog{i}");

ext.load(dispatcher.fd()?.try_clone()?, &target_fn)?;
v.data
.set_kernel_info(Some(ext.program_info()?.try_into()?));
v.data.set_kernel_info(Some(ext.info()?.try_into()?));

let id = v
.data
Expand Down
3 changes: 1 addition & 2 deletions bpfd/src/multiprog/xdp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,7 @@ impl XdpDispatcher {
let target_fn = format!("prog{i}");

ext.load(dispatcher.fd()?.try_clone()?, &target_fn)?;
v.data
.set_kernel_info(Some(ext.program_info()?.try_into()?));
v.data.set_kernel_info(Some(ext.info()?.try_into()?));

let id = v
.data
Expand Down
2 changes: 1 addition & 1 deletion examples/go-xdp-counter/bpf/xdp_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ __u32 xdp_stats_record_action(struct xdp_md *ctx, __u32 action)
return action;
}

SEC("xdp/stats")
SEC("xdp")
int xdp_stats(struct xdp_md *ctx)
{
__u32 action = XDP_PASS; /* XDP_PASS = 2 */
Expand Down
Binary file modified examples/go-xdp-counter/bpf_bpfeb.o
Binary file not shown.
Binary file modified examples/go-xdp-counter/bpf_bpfel.o
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/integration-test/bpf/xdp_pass.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
volatile const __u8 GLOBAL_u8 = 0;
volatile const __u32 GLOBAL_u32 = 0;

SEC("xdp/pass")
SEC("xdp")
int pass(struct xdp_md *ctx)
{
bpf_printk("XDP: GLOBAL_u8: 0x%02X, GLOBAL_u32: 0x%08X", GLOBAL_u8, GLOBAL_u32);
Expand Down

0 comments on commit 01d21bb

Please sign in to comment.