summaryrefslogtreecommitdiffstats
path: root/samples/bpf/hbm.h
blob: f0963ed6a5620dbb8d29a66105294b17c5f264d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* SPDX-License-Identifier: GPL-2.0
 *
 * Copyright (c) 2019 Facebook
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of version 2 of the GNU General Public
 * License as published by the Free Software Foundation.
 *
 * Include file for Host Bandwidth Management (HBM) programs
 */
struct hbm_vqueue {
	struct bpf_spin_lock lock;
	/* 4 byte hole */
	unsigned long long lasttime;	/* In ns */
	int credit;			/* In bytes */
	unsigned int rate;		/* In bytes per NS << 20 */
};

struct hbm_queue_stats {
	unsigned long rate;		/* in Mbps*/
	unsigned long stats:1,		/* get HBM stats (marked, dropped,..) */
		loopback:1,		/* also limit flows using loopback */
		no_cn:1;		/* do not use cn flags */
	unsigned long long pkts_marked;
	unsigned long long bytes_marked;
	unsigned long long pkts_dropped;
	unsigned long long bytes_dropped;
	unsigned long long pkts_total;
	unsigned long long bytes_total;
	unsigned long long firstPacketTime;
	unsigned long long lastPacketTime;
	unsigned long long pkts_ecn_ce;
	unsigned long long returnValCount[4];
	unsigned long long sum_cwnd;
	unsigned long long sum_rtt;
	unsigned long long sum_cwnd_cnt;
	long long sum_credit;
};