-
Notifications
You must be signed in to change notification settings - Fork 10
/
rc.h
50 lines (40 loc) · 1.05 KB
/
rc.h
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
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef __RC_H__
#define __RC_H__
#include <linux/ktime.h>
#include <linux/spinlock.h>
#include <linux/skbuff.h>
#include "params.h"
#include "rl.h"
struct iso_rc_stats {
u64 num_marked;
u64 num_rx;
};
enum iso_rc {
RC_FAST_RECOVERY,
RC_AI,
};
/* Rate controller specific state */
struct iso_rc_state {
u64 rfair;
u64 rfair_target;
enum iso_rc state;
u64 alpha;
int count;
struct iso_rc_stats __percpu *stats;
ktime_t last_rfair_change_time;
ktime_t last_rfair_decrease_time;
ktime_t last_feedback_time;
spinlock_t spinlock;
};
void iso_rc_init(struct iso_rc_state *);
inline int iso_rc_tx(struct iso_rc_state *, struct sk_buff *);
inline int iso_rc_rx(struct iso_rc_state *, struct sk_buff *);
/* We might have to be more "generic" as ai/md are specific */
inline void iso_rc_do_ai(struct iso_rc_state *);
inline void iso_rc_do_md(struct iso_rc_state *);
inline void iso_rc_do_alpha(struct iso_rc_state *);
void iso_rc_show(struct iso_rc_state *, struct seq_file *);
#endif /* __RC_H__ */
/* Local Variables: */
/* indent-tabs-mode:t */
/* End: */