CPU melting work in progress.

This commit is contained in:
Herbert Wolverson
2023-03-14 17:24:12 +00:00
parent c70d01b3f6
commit 8f3a8a78eb
3 changed files with 3 additions and 4 deletions

View File

@@ -77,7 +77,7 @@ static __always_inline bool is_heimdall_watching(struct dissector_t *dissector)
return false;
}
static __always_inline void update_heimdall(struct dissector_t *dissector, __u32 size, int dir)
static __always_inline void update_heimdall(struct dissector_t *dissector, __u32 size)
{
struct heimdall_event event = {0};
event.timetamp = bpf_ktime_get_boot_ns();

View File

@@ -135,14 +135,14 @@ int xdp_prog(struct xdp_md *ctx)
// Send on its way
update_heimdall(&dissector, ctx->data_end - ctx->data, effective_direction);
update_heimdall(&dissector, ctx->data_end - ctx->data);
if (tc_handle != 0) {
// Send data to Heimdall
if (heimdall_mode == 2 || (heimdall_mode==1 && is_heimdall_watching(&dissector))) {
#ifdef VERBOSE
bpf_debug("(XDP) Storing Heimdall Data");
#endif
//update_heimdall(&dissector, ctx->data_end - ctx->data, effective_direction);
//update_heimdall(&dissector, ctx->data_end - ctx->data);
}
// Handle CPU redirection if there is one specified

View File

@@ -8,7 +8,6 @@ use crate::{bpf_map::BpfMap};
/// Change the eBPF Heimdall System mode.
pub fn set_heimdall_mode(mode: HeimdallMode) -> anyhow::Result<()> {
let mut map = BpfMap::<u32, HeimdalConfig>::from_path("/sys/fs/bpf/heimdall_config")?;
map.clear_no_repeat()?;
map.insert_or_update(&mut 0, &mut HeimdalConfig { mode: mode as u32 })?;
Ok(())
}