Linux Audio

Check our new training course

Loading...
v6.13.7
 1// SPDX-License-Identifier: GPL-2.0
 2/* Copyright (c) 2021 Facebook */
 3
 4#include "bpf_tracing_net.h"
 
 
 
 
 5#include <bpf/bpf_helpers.h>
 6#include <bpf/bpf_tracing.h>
 
 7
 8char _license[] SEC("license") = "GPL";
 9const char cubic[] = "cubic";
10
11SEC("struct_ops")
12void BPF_PROG(dctcp_nouse_release, struct sock *sk)
13{
14	bpf_setsockopt(sk, SOL_TCP, TCP_CONGESTION,
15		       (void *)cubic, sizeof(cubic));
16}
17
18SEC(".struct_ops")
19struct tcp_congestion_ops dctcp_rel = {
20	.release	= (void *)dctcp_nouse_release,
21	.name		= "bpf_dctcp_rel",
22};
v6.8
 1// SPDX-License-Identifier: GPL-2.0
 2/* Copyright (c) 2021 Facebook */
 3
 4#include <stddef.h>
 5#include <linux/bpf.h>
 6#include <linux/types.h>
 7#include <linux/stddef.h>
 8#include <linux/tcp.h>
 9#include <bpf/bpf_helpers.h>
10#include <bpf/bpf_tracing.h>
11#include "bpf_tcp_helpers.h"
12
13char _license[] SEC("license") = "GPL";
14const char cubic[] = "cubic";
15
16void BPF_STRUCT_OPS(dctcp_nouse_release, struct sock *sk)
 
17{
18	bpf_setsockopt(sk, SOL_TCP, TCP_CONGESTION,
19		       (void *)cubic, sizeof(cubic));
20}
21
22SEC(".struct_ops")
23struct tcp_congestion_ops dctcp_rel = {
24	.release	= (void *)dctcp_nouse_release,
25	.name		= "bpf_dctcp_rel",
26};