net/rds/rds.h

Source file repositories/reference/linux-study-clean/net/rds/rds.h

File Facts

System
Linux kernel
Corpus path
net/rds/rds.h
Extension
.h
Size
32242 bytes
Lines
1051
Domain
Networking Core
Bucket
Sockets, Protocols, Packet Path, And Network Policy
Inferred role
Networking Core: implementation source
Status
source implementation candidate

Why This File Exists

Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.

Dependency Surface

Detected Declarations

Annotated Snippet

struct rds_cong_map {
	struct rb_node		m_rb_node;
	struct in6_addr		m_addr;
	wait_queue_head_t	m_waitq;
	struct list_head	m_conn_list;
	unsigned long		m_page_addrs[RDS_CONG_MAP_PAGES];
};


/*
 * This is how we will track the connection state:
 * A connection is always in one of the following
 * states. Updates to the state are atomic and imply
 * a memory barrier.
 */
enum {
	RDS_CONN_DOWN = 0,
	RDS_CONN_CONNECTING,
	RDS_CONN_DISCONNECTING,
	RDS_CONN_UP,
	RDS_CONN_RESETTING,
	RDS_CONN_ERROR,
};

/* Bits for c_flags */
#define RDS_LL_SEND_FULL	0
#define RDS_RECONNECT_PENDING	1
#define RDS_IN_XMIT		2
#define RDS_RECV_REFILL		3
#define	RDS_DESTROY_PENDING	4

/* Max number of multipaths per RDS connection. Must be a power of 2 */
#define	RDS_MPATH_WORKERS	8
#define	RDS_MPATH_HASH(rs, n) (jhash_1word(ntohs((rs)->rs_bound_port), \
			       (rs)->rs_hash_initval) & ((n) - 1))

#define IS_CANONICAL(laddr, faddr) (htonl(laddr) < htonl(faddr))

/* Per mpath connection state */
struct rds_conn_path {
	struct rds_connection	*cp_conn;
	struct rds_message	*cp_xmit_rm;
	unsigned long		cp_xmit_sg;
	unsigned int		cp_xmit_hdr_off;
	unsigned int		cp_xmit_data_off;
	unsigned int		cp_xmit_atomic_sent;
	unsigned int		cp_xmit_rdma_sent;
	unsigned int		cp_xmit_data_sent;

	spinlock_t		cp_lock;		/* protect msg queues */
	u64			cp_next_tx_seq;
	struct list_head	cp_send_queue;
	struct list_head	cp_retrans;

	u64			cp_next_rx_seq;

	void			*cp_transport_data;

	struct workqueue_struct	*cp_wq;
	atomic_t		cp_state;
	unsigned long		cp_send_gen;
	unsigned long		cp_flags;
	unsigned long		cp_reconnect_jiffies;
	struct delayed_work	cp_send_w;
	struct delayed_work	cp_recv_w;
	struct delayed_work	cp_conn_w;
	struct work_struct	cp_down_w;
	struct mutex		cp_cm_lock;	/* protect cp_state & cm */
	wait_queue_head_t	cp_waitq;

	unsigned int		cp_unacked_packets;
	unsigned int		cp_unacked_bytes;
	unsigned int		cp_index;
};

/* One rds_connection per RDS address pair */
struct rds_connection {
	struct hlist_node	c_hash_node;
	struct in6_addr		c_laddr;
	struct in6_addr		c_faddr;
	int			c_dev_if; /* ifindex used for this conn */
	int			c_bound_if; /* ifindex of c_laddr */
	unsigned int		c_loopback:1,
				c_isv6:1,
				c_ping_triggered:1,
				c_pad_to_32:29;
	int			c_npaths;
	bool			c_with_sport_idx;
	struct rds_connection	*c_passive;
	struct rds_transport	*c_trans;

Annotation

Implementation Notes