linux/net/ipv4/bpf_tcp_ca.c

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

#include <linux/init.h>
#include <linux/types.h>
#include <linux/bpf_verifier.h>
#include <linux/bpf.h>
#include <linux/btf.h>
#include <linux/btf_ids.h>
#include <linux/filter.h>
#include <net/tcp.h>
#include <net/bpf_sk_storage.h>

/* "extern" is to avoid sparse warning.  It is only used in bpf_struct_ops.c. */
static struct bpf_struct_ops bpf_tcp_congestion_ops;

static u32 unsupported_ops[] =;

static const struct btf_type *tcp_sock_type;
static u32 tcp_sock_id, sock_id;
static const struct btf_type *tcp_congestion_ops_type;

static int bpf_tcp_ca_init(struct btf *btf)
{}

static bool is_unsupported(u32 member_offset)
{}

static bool bpf_tcp_ca_is_valid_access(int off, int size,
				       enum bpf_access_type type,
				       const struct bpf_prog *prog,
				       struct bpf_insn_access_aux *info)
{}

static int bpf_tcp_ca_btf_struct_access(struct bpf_verifier_log *log,
					const struct bpf_reg_state *reg,
					int off, int size)
{}

BPF_CALL_2(bpf_tcp_send_ack, struct tcp_sock *, tp, u32, rcv_nxt)
{}

static const struct bpf_func_proto bpf_tcp_send_ack_proto =;

static u32 prog_ops_moff(const struct bpf_prog *prog)
{}

static const struct bpf_func_proto *
bpf_tcp_ca_get_func_proto(enum bpf_func_id func_id,
			  const struct bpf_prog *prog)
{}

BTF_KFUNCS_START(bpf_tcp_ca_check_kfunc_ids)
BTF_ID_FLAGS()
BTF_ID_FLAGS()
BTF_ID_FLAGS()
BTF_ID_FLAGS()
BTF_ID_FLAGS()
BTF_KFUNCS_END()

static const struct btf_kfunc_id_set bpf_tcp_ca_kfunc_set =;

static const struct bpf_verifier_ops bpf_tcp_ca_verifier_ops =;

static int bpf_tcp_ca_init_member(const struct btf_type *t,
				  const struct btf_member *member,
				  void *kdata, const void *udata)
{}

static int bpf_tcp_ca_check_member(const struct btf_type *t,
				   const struct btf_member *member,
				   const struct bpf_prog *prog)
{}

static int bpf_tcp_ca_reg(void *kdata, struct bpf_link *link)
{}

static void bpf_tcp_ca_unreg(void *kdata, struct bpf_link *link)
{}

static int bpf_tcp_ca_update(void *kdata, void *old_kdata, struct bpf_link *link)
{}

static int bpf_tcp_ca_validate(void *kdata)
{}

static u32 bpf_tcp_ca_ssthresh(struct sock *sk)
{}

static void bpf_tcp_ca_cong_avoid(struct sock *sk, u32 ack, u32 acked)
{}

static void bpf_tcp_ca_set_state(struct sock *sk, u8 new_state)
{}

static void bpf_tcp_ca_cwnd_event(struct sock *sk, enum tcp_ca_event ev)
{}

static void bpf_tcp_ca_in_ack_event(struct sock *sk, u32 flags)
{}

static void bpf_tcp_ca_pkts_acked(struct sock *sk, const struct ack_sample *sample)
{}

static u32 bpf_tcp_ca_min_tso_segs(struct sock *sk)
{}

static void bpf_tcp_ca_cong_control(struct sock *sk, u32 ack, int flag,
				    const struct rate_sample *rs)
{}

static u32 bpf_tcp_ca_undo_cwnd(struct sock *sk)
{}

static u32 bpf_tcp_ca_sndbuf_expand(struct sock *sk)
{}

static void __bpf_tcp_ca_init(struct sock *sk)
{}

static void __bpf_tcp_ca_release(struct sock *sk)
{}

static struct tcp_congestion_ops __bpf_ops_tcp_congestion_ops =;

static struct bpf_struct_ops bpf_tcp_congestion_ops =;

static int __init bpf_tcp_ca_kfunc_init(void)
{}
late_initcall(bpf_tcp_ca_kfunc_init);