mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
CPU melting work in progress.
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user