aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_mytcp.h
blob: ff70d94a6a4705e57aa3a355f4ce48f4c9d035e2 (plain) (blame)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * TCP mytcp congestion control interface
 */
#ifndef __TCP_mytcp_H
#define __TCP_mytcp_H 1

//extern int mytcp_flow_num;	//****the num of mytcp flow*****//

/* mytcp variables */
struct mytcp {
	u32	beg_snd_nxt;	/* right edge during last RTT */
	u32	beg_snd_cwnd;	/* saves the size of the cwnd */
	u8	doing_mytcp_now;/* if true, do mytcp for this RTT */
//	u16	count_i;		/* # of RTTs measured within last RTT */
//	u32	RTT_i;		/* min of RTTs measured within last RTT (in usec) */
//	u32 RTT_i_last;
//	u32	sum_RTT_i;
//	u32 rtt_of_this_packet;
//	u32 standard_rtt;
//	u32	sum_RTT_i_last;
	u32 cwnd_last;
	u32 one_full_ronund_send;
	u32 threshold;
//	u16	num_i;
//	u16 full_pipe_flag;
	u32 cwnd_hold;

	u16 full_flag_1;
	u16 full_flag_2;
	u16 full_flag_3;
	u16 cong_flag;
	u32 queue_last;
	u32 queue_now;
	u16 cntRTT;
	int loss_cnt;
	u16 throughput_now;
	u16 max_queue_within_t;
	u16 min_queue_within_t;
	u16 mytcp_max_driver_queue;
	u16 mytcp_min_driver_queue;
//	u16 max_queue_last;
	u16 max_queue_first;
	u16 max_queue_now;
	u16 cwnd_first;
	u16 min_last;
	u64 time_last;
	u64 time_now;
	u16 min_queue;
	u16 inflight_2pre;
	u16 inflight_1pre;
	u16 inflight_now;
//	u16 slow_start_end;
//	u32 slow_start_end_cwnd;
//	u32	minRTT;	
	u32 min_rtt;
	u32	baseRTT;
//	u16 queue_update;
//	u16	num_i_last;
//	u32 average_RTT_i;
//	u32 average_RTT_i_last;
//	u32	i_interval_stamp;	/* the min of all mytcp RTT measurements seen (in usec) */
//	u16	start_indicator;
//	u16 update;
};

void tcp_mytcp_init(struct sock *sk);
void tcp_mytcp_state(struct sock *sk, u8 ca_state);
void tcp_mytcp_pkts_acked(struct sock *sk, const struct ack_sample *sample);
void tcp_mytcp_cwnd_event(struct sock *sk, enum tcp_ca_event event);
size_t tcp_mytcp_get_info(struct sock *sk, u32 ext, int *attr,
			  union tcp_cc_info *info);

#endif	/* __TCP_mytcp_H */