tools/testing/selftests/bpf/progs/bpf_dctcp_release.c

Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/progs/bpf_dctcp_release.c

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/bpf/progs/bpf_dctcp_release.c
Extension
.c
Size
520 bytes
Lines
23
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: implementation source
Status
source implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2021 Facebook */

#include "bpf_tracing_net.h"
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_tracing.h>

char _license[] SEC("license") = "GPL";
const char cubic[] = "cubic";

SEC("struct_ops")
void BPF_PROG(dctcp_nouse_release, struct sock *sk)
{
	bpf_setsockopt(sk, SOL_TCP, TCP_CONGESTION,
		       (void *)cubic, sizeof(cubic));
}

SEC(".struct_ops")
struct tcp_congestion_ops dctcp_rel = {
	.release	= (void *)dctcp_nouse_release,
	.name		= "bpf_dctcp_rel",
};

Annotation

Implementation Notes