linux/include/net/rps.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef _NET_RPS_H
#define _NET_RPS_H

#include <linux/types.h>
#include <linux/static_key.h>
#include <net/sock.h>
#include <net/hotdata.h>

#ifdef CONFIG_RPS

extern struct static_key_false rps_needed;
extern struct static_key_false rfs_needed;

/*
 * This structure holds an RPS map which can be of variable length.  The
 * map is an array of CPUs.
 */
struct rps_map {};
#define RPS_MAP_SIZE(_num)

/*
 * The rps_dev_flow structure contains the mapping of a flow to a CPU, the
 * tail pointer for that CPU's input queue at the time of last enqueue, and
 * a hardware filter index.
 */
struct rps_dev_flow {};
#define RPS_NO_FILTER

/*
 * The rps_dev_flow_table structure contains a table of flow mappings.
 */
struct rps_dev_flow_table {};
#define RPS_DEV_FLOW_TABLE_SIZE(_num)

/*
 * The rps_sock_flow_table contains mappings of flows to the last CPU
 * on which they were processed by the application (set in recvmsg).
 * Each entry is a 32bit value. Upper part is the high-order bits
 * of flow hash, lower part is CPU number.
 * rps_cpu_mask is used to partition the space, depending on number of
 * possible CPUs : rps_cpu_mask = roundup_pow_of_two(nr_cpu_ids) - 1
 * For example, if 64 CPUs are possible, rps_cpu_mask = 0x3f,
 * meaning we use 32-6=26 bits for the hash.
 */
struct rps_sock_flow_table {};
#define RPS_SOCK_FLOW_TABLE_SIZE(_num)

#define RPS_NO_CPU

static inline void rps_record_sock_flow(struct rps_sock_flow_table *table,
					u32 hash)
{}

#endif /* CONFIG_RPS */

static inline void sock_rps_record_flow_hash(__u32 hash)
{}

static inline void sock_rps_record_flow(const struct sock *sk)
{}

static inline u32 rps_input_queue_tail_incr(struct softnet_data *sd)
{}

static inline void rps_input_queue_tail_save(u32 *dest, u32 tail)
{}

static inline void rps_input_queue_head_add(struct softnet_data *sd, int val)
{}

static inline void rps_input_queue_head_incr(struct softnet_data *sd)
{}

#endif /* _NET_RPS_H */