mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Add BPF MPTCP scheduler for kernel 6.6
This commit is contained in:
parent
9d98b8bd78
commit
7348518bb0
19 changed files with 3638 additions and 2 deletions
32
mptcp-bpf-first/src/mptcp_bpf_first.c
Normal file
32
mptcp-bpf-first/src/mptcp_bpf_first.c
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/* Copyright (c) 2022, SUSE. */
|
||||
|
||||
#include <linux/bpf.h>
|
||||
#include "bpf_tcp_helpers.h"
|
||||
|
||||
char _license[] SEC("license") = "GPL";
|
||||
|
||||
SEC("struct_ops/mptcp_sched_first_init")
|
||||
void BPF_PROG(mptcp_sched_first_init, struct mptcp_sock *msk)
|
||||
{
|
||||
}
|
||||
|
||||
SEC("struct_ops/mptcp_sched_first_release")
|
||||
void BPF_PROG(mptcp_sched_first_release, struct mptcp_sock *msk)
|
||||
{
|
||||
}
|
||||
|
||||
int BPF_STRUCT_OPS(bpf_first_get_subflow, struct mptcp_sock *msk,
|
||||
struct mptcp_sched_data *data)
|
||||
{
|
||||
mptcp_subflow_set_scheduled(bpf_mptcp_subflow_ctx_by_pos(data, 0), true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
SEC(".struct_ops")
|
||||
struct mptcp_sched_ops first = {
|
||||
.init = (void *)mptcp_sched_first_init,
|
||||
.release = (void *)mptcp_sched_first_release,
|
||||
.get_subflow = (void *)bpf_first_get_subflow,
|
||||
.name = "bpf_first",
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue