linux/net/xdp/xskmap.c

// SPDX-License-Identifier: GPL-2.0
/* XSKMAP used for AF_XDP sockets
 * Copyright(c) 2018 Intel Corporation.
 */

#include <linux/bpf.h>
#include <linux/filter.h>
#include <net/xdp_sock.h>
#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/btf_ids.h>

#include "xsk.h"

static struct xsk_map_node *xsk_map_node_alloc(struct xsk_map *map,
					       struct xdp_sock __rcu **map_entry)
{}

static void xsk_map_node_free(struct xsk_map_node *node)
{}

static void xsk_map_sock_add(struct xdp_sock *xs, struct xsk_map_node *node)
{}

static void xsk_map_sock_delete(struct xdp_sock *xs,
				struct xdp_sock __rcu **map_entry)
{}

static struct bpf_map *xsk_map_alloc(union bpf_attr *attr)
{}

static u64 xsk_map_mem_usage(const struct bpf_map *map)
{}

static void xsk_map_free(struct bpf_map *map)
{}

static int xsk_map_get_next_key(struct bpf_map *map, void *key, void *next_key)
{}

static int xsk_map_gen_lookup(struct bpf_map *map, struct bpf_insn *insn_buf)
{}

/* Elements are kept alive by RCU; either by rcu_read_lock() (from syscall) or
 * by local_bh_disable() (from XDP calls inside NAPI). The
 * rcu_read_lock_bh_held() below makes lockdep accept both.
 */
static void *__xsk_map_lookup_elem(struct bpf_map *map, u32 key)
{}

static void *xsk_map_lookup_elem(struct bpf_map *map, void *key)
{}

static void *xsk_map_lookup_elem_sys_only(struct bpf_map *map, void *key)
{}

static long xsk_map_update_elem(struct bpf_map *map, void *key, void *value,
				u64 map_flags)
{}

static long xsk_map_delete_elem(struct bpf_map *map, void *key)
{}

static long xsk_map_redirect(struct bpf_map *map, u64 index, u64 flags)
{}

void xsk_map_try_sock_delete(struct xsk_map *map, struct xdp_sock *xs,
			     struct xdp_sock __rcu **map_entry)
{}

static bool xsk_map_meta_equal(const struct bpf_map *meta0,
			       const struct bpf_map *meta1)
{}

BTF_ID_LIST_SINGLE(xsk_map_btf_ids, struct, xsk_map)
const struct bpf_map_ops xsk_map_ops =;