Skip to content
This repository was archived by the owner on Nov 19, 2025. It is now read-only.

Commit 0ddc101

Browse files
committed
finalize sched_probe and musher intergration
1 parent 28b10e8 commit 0ddc101

File tree

11 files changed

+2211
-1304
lines changed

11 files changed

+2211
-1304
lines changed

error

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,5 @@
11
DESCEND objtool
22
CALL scripts/checksyscalls.sh
33
CHK include/generated/compile.h
4-
CC net/mptcp/mptcp_rtt.o
5-
net/mptcp/mptcp_rtt.c: In function ‘rtt_get_subflow_from_selectors’:
6-
net/mptcp/mptcp_rtt.c:194:32: error: ‘sk’ undeclared (first use in this function); did you mean ‘skb’?
7-
194 | if (mptcp_is_def_unavailable(sk)) {
8-
| ^~
9-
| skb
10-
net/mptcp/mptcp_rtt.c:194:32: note: each undeclared identifier is reported only once for each function it appears in
11-
net/mptcp/mptcp_rtt.c: In function ‘rtt_get_available_subflow’:
12-
net/mptcp/mptcp_rtt.c:302:3: error: implicit declaration of function ‘mptcp_for_each_sk’; did you mean ‘mptcp_for_each_sub’? [-Werror=implicit-function-declaration]
13-
302 | mptcp_for_each_sk(mpcb, sk) {
14-
| ^~~~~~~~~~~~~~~~~
15-
| mptcp_for_each_sub
16-
net/mptcp/mptcp_rtt.c:302:30: error: expected ‘;’ before ‘{’ token
17-
302 | mptcp_for_each_sk(mpcb, sk) {
18-
| ^~
19-
| ;
20-
net/mptcp/mptcp_rtt.c: In function ‘mptcp_rcv_buf_optimization’:
21-
net/mptcp/mptcp_rtt.c:387:2: error: implicit declaration of function ‘mptcp_for_each_tp’; did you mean ‘mptcp_for_each_sub’? [-Werror=implicit-function-declaration]
22-
387 | mptcp_for_each_tp(tp->mpcb, tp_it) {
23-
| ^~~~~~~~~~~~~~~~~
24-
| mptcp_for_each_sub
25-
net/mptcp/mptcp_rtt.c:387:36: error: expected ‘;’ before ‘{’ token
26-
387 | mptcp_for_each_tp(tp->mpcb, tp_it) {
27-
| ^~
28-
| ;
29-
net/mptcp/mptcp_rtt.c:384:6: error: label ‘retrans’ used but not defined
30-
384 | goto retrans;
31-
| ^~~~
32-
net/mptcp/mptcp_rtt.c:434:1: error: control reaches end of non-void function [-Werror=return-type]
33-
434 | }
34-
| ^
35-
cc1: some warnings being treated as errors
36-
make[2]: *** [scripts/Makefile.build:304: net/mptcp/mptcp_rtt.o] Error 1
37-
make[1]: *** [scripts/Makefile.build:544: net/mptcp] Error 2
38-
make[1]: *** Waiting for unfinished jobs....
39-
make: *** [Makefile:1070: net] Error 2
40-
make: *** Waiting for unfinished jobs....
4+
CC net/mptcp/mptcp_ratio.o
5+
CC [M] net/mptcp/mptcp_sched_probe.o

error1

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
DESCEND objtool
2+
CALL scripts/checksyscalls.sh
3+
CHK include/generated/compile.h
4+
CC net/mptcp/mptcp_ratio.o
5+
CC [M] net/mptcp/mptcp_sched_probe.o
6+
net/mptcp/mptcp_ratio.c: In function ‘mptcp_ratio_next_segment’:
7+
net/mptcp/mptcp_ratio.c:817:12: error: ‘struct tcp_sock’ has no member named ‘rate_est_val’
8+
817 | tp_it->rate_est_val += subflow_rate64;
9+
| ^~
10+
net/mptcp/mptcp_ratio.c:818:12: error: ‘struct tcp_sock’ has no member named ‘rate_est_cnt’
11+
818 | tp_it->rate_est_cnt++;
12+
| ^~
13+
net/mptcp/mptcp_ratio.c:858:9: error: implicit declaration of function ‘mptcp_for_each_sk’; did you mean ‘mptcp_for_each_sub’? [-Werror=implicit-function-declaration]
14+
858 | mptcp_for_each_sk(mpcb, sk_it) {
15+
| ^~~~~~~~~~~~~~~~~
16+
| mptcp_for_each_sub
17+
net/mptcp/mptcp_ratio.c:858:33: error: ‘sk_it’ undeclared (first use in this function)
18+
858 | mptcp_for_each_sk(mpcb, sk_it) {
19+
| ^~~~~
20+
net/mptcp/mptcp_ratio.c:858:33: note: each undeclared identifier is reported only once for each function it appears in
21+
net/mptcp/mptcp_ratio.c:858:39: error: expected ‘;’ before ‘{’ token
22+
858 | mptcp_for_each_sk(mpcb, sk_it) {
23+
| ^~
24+
| ;
25+
net/mptcp/mptcp_ratio.c:908:43: error: expected ‘;’ before ‘{’ token
26+
908 | mptcp_for_each_sk(mpcb, sk_it) {
27+
| ^~
28+
| ;
29+
net/mptcp/mptcp_ratio.c:949:13: error: expected ‘}’ before ‘else’
30+
949 | else
31+
| ^~~~
32+
net/mptcp/mptcp_ratio.c:1022:28: error: ‘struct tcp_sock’ has no member named ‘buffer_trigger_threshold’
33+
1022 | meta_tp->buffer_trigger_threshold = 0;
34+
| ^~
35+
net/mptcp/mptcp_ratio.c:1023:51: error: expected ‘;’ before ‘{’ token
36+
1023 | mptcp_for_each_sk(mpcb, sk_it) {
37+
| ^~
38+
| ;
39+
net/mptcp/mptcp_ratio.c:1035:51: error: expected ‘;’ before ‘{’ token
40+
1035 | mptcp_for_each_sk(mpcb, sk_it) {
41+
| ^~
42+
| ;
43+
net/mptcp/mptcp_ratio.c:1244:47: error: expected ‘;’ before ‘{’ token
44+
1244 | mptcp_for_each_sk(mpcb, sk_it) {
45+
| ^~
46+
| ;
47+
net/mptcp/mptcp_ratio.c:1258:49: error: ‘struct tcp_sock’ has no member named ‘buffer_trigger_threshold’
48+
1258 | } else if (buffer_diff < meta_tp->buffer_trigger_threshold) {
49+
| ^~
50+
net/mptcp/mptcp_ratio.c:1294:51: error: expected ‘;’ before ‘{’ token
51+
1294 | mptcp_for_each_sk(mpcb, sk_it) {
52+
| ^~
53+
| ;
54+
net/mptcp/mptcp_ratio.c:1328:45: error: ‘struct tcp_sock’ has no member named ‘last_rate_search_start’
55+
1328 | last_rate += meta_tp->last_rate_search_start[iter];
56+
| ^~
57+
net/mptcp/mptcp_ratio.c:1505:36: error: expected ‘;’ before ‘{’ token
58+
1505 | mptcp_for_each_sk(mpcb, sk_it) {
59+
| ^~
60+
| ;
61+
net/mptcp/mptcp_ratio.c:1515:39: error: expected ‘;’ before ‘{’ token
62+
1515 | mptcp_for_each_sk(mpcb, sk_it) {
63+
| ^~
64+
| ;
65+
net/mptcp/mptcp_ratio.c:1331:1: warning: label ‘nosearch’ defined but not used [-Wunused-label]
66+
1331 | nosearch:
67+
| ^~~~~~~~
68+
net/mptcp/mptcp_ratio.c:1289:7: error: label ‘search_start’ used but not defined
69+
1289 | goto search_start;
70+
| ^~~~
71+
net/mptcp/mptcp_ratio.c:382:9: warning: unused variable ‘completion_times’ [-Wunused-variable]
72+
382 | int completion_times[2] = {0, 0};
73+
| ^~~~~~~~~~~~~~~~
74+
net/mptcp/mptcp_ratio.c:379:19: warning: unused variable ‘diff_last’ [-Wunused-variable]
75+
379 | int diff_ref, diff_last, threshold_cnt;
76+
| ^~~~~~~~~
77+
net/mptcp/mptcp_ratio.c:379:9: warning: unused variable ‘diff_ref’ [-Wunused-variable]
78+
379 | int diff_ref, diff_last, threshold_cnt;
79+
| ^~~~~~~~
80+
net/mptcp/mptcp_ratio.c:376:24: warning: unused variable ‘rate_search_100’ [-Wunused-variable]
81+
376 | u32 rate_search_0, rate_search_100, buffer_total, init_buffer_total, trigger_threshold;
82+
| ^~~~~~~~~~~~~~~
83+
net/mptcp/mptcp_ratio.c:376:9: warning: unused variable ‘rate_search_0’ [-Wunused-variable]
84+
376 | u32 rate_search_0, rate_search_100, buffer_total, init_buffer_total, trigger_threshold;
85+
| ^~~~~~~~~~~~~
86+
net/mptcp/mptcp_ratio.c:375:140: warning: unused variable ‘curr_diff’ [-Wunused-variable]
87+
375 | u32 total_rate, rate_ad, rate_ac, ref_rate, last_rate, best_rate, best_ratio, in_search, last_trigger_tstamp, thresh_cnt_reset, qSize, curr_diff, count_set_init_rate, init_rate;
88+
| ^~~~~~~~~
89+
net/mptcp/mptcp_ratio.c:375:133: warning: unused variable ‘qSize’ [-Wunused-variable]
90+
375 | u32 total_rate, rate_ad, rate_ac, ref_rate, last_rate, best_rate, best_ratio, in_search, last_trigger_tstamp, thresh_cnt_reset, qSize, curr_diff, count_set_init_rate, init_rate;
91+
| ^~~~~
92+
net/mptcp/mptcp_ratio.c:375:115: warning: unused variable ‘thresh_cnt_reset’ [-Wunused-variable]
93+
375 | u32 total_rate, rate_ad, rate_ac, ref_rate, last_rate, best_rate, best_ratio, in_search, last_trigger_tstamp, thresh_cnt_reset, qSize, curr_diff, count_set_init_rate, init_rate;
94+
| ^~~~~~~~~~~~~~~~
95+
net/mptcp/mptcp_ratio.c:375:71: warning: unused variable ‘best_ratio’ [-Wunused-variable]
96+
375 | u32 total_rate, rate_ad, rate_ac, ref_rate, last_rate, best_rate, best_ratio, in_search, last_trigger_tstamp, thresh_cnt_reset, qSize, curr_diff, count_set_init_rate, init_rate;
97+
| ^~~~~~~~~~
98+
net/mptcp/mptcp_ratio.c:375:60: warning: unused variable ‘best_rate’ [-Wunused-variable]
99+
375 | u32 total_rate, rate_ad, rate_ac, ref_rate, last_rate, best_rate, best_ratio, in_search, last_trigger_tstamp, thresh_cnt_reset, qSize, curr_diff, count_set_init_rate, init_rate;
100+
| ^~~~~~~~~
101+
net/mptcp/mptcp_ratio.c:375:39: warning: unused variable ‘ref_rate’ [-Wunused-variable]
102+
375 | u32 total_rate, rate_ad, rate_ac, ref_rate, last_rate, best_rate, best_ratio, in_search, last_trigger_tstamp, thresh_cnt_reset, qSize, curr_diff, count_set_init_rate, init_rate;
103+
| ^~~~~~~~
104+
net/mptcp/mptcp_ratio.c:373:11: warning: unused variable ‘ip_5’ [-Wunused-variable]
105+
373 | char *ip_5 = "192.168.2.10";
106+
| ^~~~
107+
net/mptcp/mptcp_ratio.c:372:11: warning: unused variable ‘ip_60’ [-Wunused-variable]
108+
372 | char *ip_60 = "192.168.2.11";
109+
| ^~~~~
110+
net/mptcp/mptcp_ratio.c:370:54: warning: unused variable ‘i’ [-Wunused-variable]
111+
370 | unsigned char iter = 0, full_subs = 0, counter = 0, i = 0;
112+
| ^
113+
net/mptcp/mptcp_ratio.c: At top level:
114+
net/mptcp/mptcp_ratio.c:1529:5: warning: data definition has no type or storage class
115+
1529 | iter = 0;
116+
| ^~~~
117+
net/mptcp/mptcp_ratio.c:1529:5: error: type defaults to ‘int’ in declaration of ‘iter’ [-Werror=implicit-int]
118+
net/mptcp/mptcp_ratio.c:1530:5: error: return type defaults to ‘int’ [-Werror=return-type]
119+
1530 | mptcp_for_each_sk(mpcb, sk_it) {
120+
| ^~~~~~~~~~~~~~~~~
121+
net/mptcp/mptcp_ratio.c:1530:5: error: function declaration isn’t a prototype [-Werror=strict-prototypes]
122+
net/mptcp/mptcp_ratio.c: In function ‘mptcp_for_each_sk’:
123+
net/mptcp/mptcp_ratio.c:1531:33: error: ‘sprobe’ undeclared (first use in this function); did you mean ‘uprobe’?
124+
1531 | mptcp_sched_probe_init(&sprobe);
125+
| ^~~~~~
126+
| uprobe
127+
net/mptcp/mptcp_ratio.c:1534:46: error: ‘skb’ undeclared (first use in this function)
128+
1534 | if (!mptcp_ratio_is_available(sk_it, skb, false, cwnd_limited)) sprobe.temp_unavailable = true;
129+
| ^~~
130+
net/mptcp/mptcp_ratio.c:1534:39: warning: passing argument 1 of ‘mptcp_ratio_is_available’ makes pointer from integer without a cast [-Wint-conversion]
131+
1534 | if (!mptcp_ratio_is_available(sk_it, skb, false, cwnd_limited)) sprobe.temp_unavailable = true;
132+
| ^~~~~
133+
| |
134+
| int
135+
net/mptcp/mptcp_ratio.c:53:51: note: expected ‘struct sock *’ but argument is of type ‘int’
136+
53 | static bool mptcp_ratio_is_available(struct sock *sk, const struct sk_buff *skb,
137+
| ~~~~~~~~~~~~~^~
138+
net/mptcp/mptcp_ratio.c:1536:13: error: ‘choose_sk’ undeclared (first use in this function)
139+
1536 | if (choose_sk == sk_it) {
140+
| ^~~~~~~~~
141+
net/mptcp/mptcp_ratio.c:1537:55: error: ‘sched_probe_id’ undeclared (first use in this function)
142+
1537 | mptcp_sched_probe_log_hook(&sprobe, true, sched_probe_id, sk_it);
143+
| ^~~~~~~~~~~~~~
144+
net/mptcp/mptcp_ratio.c:1537:71: warning: passing argument 4 of ‘mptcp_sched_probe_log_hook’ makes pointer from integer without a cast [-Wint-conversion]
145+
1537 | mptcp_sched_probe_log_hook(&sprobe, true, sched_probe_id, sk_it);
146+
| ^~~~~
147+
| |
148+
| int
149+
In file included from net/mptcp/mptcp_ratio.c:4:
150+
./include/net/mptcp.h:979:34: note: expected ‘struct sock *’ but argument is of type ‘int’
151+
979 | extern struct mptcp_sched_probe* mptcp_sched_probe_log_hook(struct mptcp_sched_probe* sprobe, bool selected, unsigned long sched_probe_id, struct sock *sk);
152+
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
153+
net/mptcp/mptcp_ratio.c:1539:73: warning: passing argument 4 of ‘mptcp_sched_probe_log_hook’ makes pointer from integer without a cast [-Wint-conversion]
154+
1539 | else mptcp_sched_probe_log_hook(&sprobe, false, sched_probe_id, sk_it);
155+
| ^~~~~
156+
| |
157+
| int
158+
In file included from net/mptcp/mptcp_ratio.c:4:
159+
./include/net/mptcp.h:979:34: note: expected ‘struct sock *’ but argument is of type ‘int’
160+
979 | extern struct mptcp_sched_probe* mptcp_sched_probe_log_hook(struct mptcp_sched_probe* sprobe, bool selected, unsigned long sched_probe_id, struct sock *sk);
161+
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
162+
net/mptcp/mptcp_ratio.c: At top level:
163+
net/mptcp/mptcp_ratio.c:1542:2: error: expected identifier or ‘(’ before ‘return’
164+
1542 | return NULL;
165+
| ^~~~~~
166+
net/mptcp/mptcp_ratio.c:1543:1: error: expected identifier or ‘(’ before ‘}’ token
167+
1543 | }
168+
| ^
169+
net/mptcp/mptcp_ratio.c: In function ‘mptcp_for_each_sk’:
170+
net/mptcp/mptcp_ratio.c:1540:5: error: control reaches end of non-void function [-Werror=return-type]
171+
1540 | }
172+
| ^
173+
net/mptcp/mptcp_ratio.c: In function ‘mptcp_ratio_next_segment’:
174+
net/mptcp/mptcp_ratio.c:1527:2: error: control reaches end of non-void function [-Werror=return-type]
175+
1527 | }
176+
| ^
177+
cc1: some warnings being treated as errors
178+
make[2]: *** [scripts/Makefile.build:304: net/mptcp/mptcp_ratio.o] Error 1
179+
make[2]: *** Waiting for unfinished jobs....
180+
net/mptcp/mptcp_sched_probe.c: In function ‘log_tcp_params’:
181+
net/mptcp/mptcp_sched_probe.c:179:51: error: ‘const struct tcp_rack’ has no member named ‘reord’
182+
179 | p->rack_reord = (tp->rack).reord;
183+
| ^
184+
make[2]: *** [scripts/Makefile.build:310: net/mptcp/mptcp_sched_probe.o] Error 1
185+
make[1]: *** [scripts/Makefile.build:544: net/mptcp] Error 2
186+
make[1]: *** Waiting for unfinished jobs....
187+
make: *** [Makefile:1070: net] Error 2
188+
make: *** Waiting for unfinished jobs....

include/linux/tcp.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,9 @@ struct tcp_sock {
282282
u32 end_seq; /* Ending TCP sequence of the skb */
283283
u32 last_delivered; /* tp->delivered at last reo_wnd adj */
284284
u8 reo_wnd_steps; /* Allowed reordering window */
285+
/*Phuc*/
286+
u8 reord; /* reordering detected */
287+
/****/
285288
#define TCP_RACK_RECOVERY_THRESH 16
286289
u8 reo_wnd_persist:5, /* No. of recovery since last adj */
287290
dsack_seen:1, /* Whether DSACK seen after last adj */
@@ -510,9 +513,13 @@ struct tcp_sock {
510513
u32 last_ratio;
511514
u64 prev_tx_bytes;
512515
u64 prev_tstamp;
516+
u32 rate_est_val;
517+
u32 rate_est_cnt;
518+
u32 last_rate_search_start[3]; /* 3 because that's the search trigger threshold */
513519
u32 init_buffer_size[2];
514520
u32 last_buffer_size[2];
515521
u8 buffer_threshold_cnt;
522+
s32 buffer_trigger_threshold;
516523
ratio_search_state search_state;
517524
//u8 buf_size_acc;
518525
struct sock *prev_sk;

include/net/mptcp.h

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,11 @@ struct mptcp_cb {
351351
u32 orig_window_clamp;
352352

353353
struct tcp_info *master_info;
354+
355+
/* swetank */
356+
u32 cnt_in_order;
357+
u32 cnt_out_of_order;
358+
/* end:swetankk */
354359
};
355360

356361
#define MPTCP_VERSION_0 0
@@ -467,6 +472,18 @@ extern bool mptcp_init_failed;
467472
#define MPTCPHDR_INF 0x08
468473
#define MPTCP_REINJECT 0x10 /* Did we reinject this segment? */
469474

475+
/* swetankk */
476+
#define MPTCP_SCHED_PROBE
477+
#ifdef CONFIG_MPTCP_QUEUE_PROBE
478+
#define MPTCP_QUEUE_PROBE
479+
#endif
480+
481+
#ifdef MPTCP_QUEUE_PROBE
482+
#define MPTCP_RCV_QUEUE 0x00
483+
#define MPTCP_OFO_QUEUE 0x01
484+
#endif
485+
/* end: swetankk */
486+
470487
struct mptcp_option {
471488
__u8 kind;
472489
__u8 len;
@@ -655,6 +672,35 @@ struct mp_prio {
655672
__u8 addr_id;
656673
} __attribute__((__packed__));
657674

675+
/* swetankk */
676+
#ifdef MPTCP_SCHED_PROBE
677+
struct mptcp_sched_probe {
678+
unsigned long id;
679+
struct sock *sk;
680+
bool selector_reject;
681+
bool found_unused_reject;
682+
bool def_unavailable;
683+
bool temp_unavailable;
684+
bool srtt_reject;
685+
bool selected;
686+
int split;
687+
int skblen;
688+
u32 tx_bytes;
689+
u32 trans_start;
690+
};
691+
#endif
692+
#ifdef MPTCP_QUEUE_PROBE
693+
struct mptcp_queue_probe {
694+
u8 q_id;
695+
struct tcp_sock *meta_tp;
696+
u32 skb_seq;
697+
u32 skb_end_seq;
698+
u8 op_id;
699+
u32 q_size;
700+
};
701+
#endif
702+
/* end:swetankk */
703+
658704
static inline int mptcp_sub_len_dss(const struct mp_dss *m, const int csum)
659705
{
660706
return 4 + m->A * (4 + m->a * 4) + m->M * (10 + m->m * 4 + csum * 2);
@@ -927,6 +973,15 @@ bool subflow_is_backup(const struct tcp_sock *tp);
927973
struct sock *get_available_subflow(struct sock *meta_sk, struct sk_buff *skb,
928974
bool zero_wnd_test);
929975
extern struct mptcp_sched_ops mptcp_sched_default;
976+
/* swetankk */
977+
#ifdef MPTCP_SCHED_PROBE
978+
extern void mptcp_sched_probe_init(struct mptcp_sched_probe *sprobe);
979+
extern struct mptcp_sched_probe* mptcp_sched_probe_log_hook(struct mptcp_sched_probe* sprobe, bool selected, unsigned long sched_probe_id, struct sock *sk);
980+
#endif
981+
#ifdef MPTCP_QUEUE_PROBE
982+
extern struct mptcp_queue_probe* mptcp_queue_probe_log_hook(u8 q_id, struct tcp_sock *meta_tp, struct sk_buff *skb, u8 op_id);
983+
#endif
984+
/* end: swetankk */
930985

931986
/* Initializes function-pointers and MPTCP-flags */
932987
static inline void mptcp_init_tcp_sock(struct sock *sk)

0 commit comments

Comments
 (0)