Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /* Copyright (c) 2021 Facebook */
0003 
0004 #include <stddef.h>
0005 #include <linux/bpf.h>
0006 #include <linux/types.h>
0007 #include <linux/stddef.h>
0008 #include <linux/tcp.h>
0009 #include <bpf/bpf_helpers.h>
0010 #include <bpf/bpf_tracing.h>
0011 #include "bpf_tcp_helpers.h"
0012 
0013 char _license[] SEC("license") = "GPL";
0014 const char cubic[] = "cubic";
0015 
0016 void BPF_STRUCT_OPS(dctcp_nouse_release, struct sock *sk)
0017 {
0018     bpf_setsockopt(sk, SOL_TCP, TCP_CONGESTION,
0019                (void *)cubic, sizeof(cubic));
0020 }
0021 
0022 SEC(".struct_ops")
0023 struct tcp_congestion_ops dctcp_rel = {
0024     .release    = (void *)dctcp_nouse_release,
0025     .name       = "bpf_dctcp_rel",
0026 };