aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/atm/tonga.h
diff options
context:
space:
mode:
authorMaxime Chevallier <maxime.chevallier@bootlin.com>2019-04-30 09:14:27 -0400
committerDavid S. Miller <davem@davemloft.net>2019-05-01 17:13:14 -0400
commit84e90b0b51aabb5cb73a366368b956df37d7cedc (patch)
treeac54f44039a24b8e6c03c53e3115efcae4fd7277 /drivers/atm/tonga.h
parent6f16a4652262c2a27a241b30039c11ae01586641 (diff)
net: mvpp2: cls: Use a bitfield to represent the flow_type
As of today, the classification code is used only for RSS. We split the incoming traffic into multiple flows, that correspond to the ethtool flow_type parameter. We don't want to use the ethtool flow definitions such as TCP_V4_FLOW, for several reason : - We want to decorrelate the driver code from ethtool as much as possible, so that we can easily use other interfaces such as tc flower, - We want the flow_type to be a bitfield, so that we can match flows embedded into each other, such as TCP4 which is a subset of IP4. This commit does the conversion to the newer type. Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/atm/tonga.h')
0 files changed, 0 insertions, 0 deletions
liblitmus.git/commit/bin/rtspin.c?h=wip-bbb-cache-test&id=7b709ceb7d2191fc552ab70bc1365b47120c634c'>7b709ce
4eb2e8f
7b709ce











ff0f490

7b709ce


ff0f490








7b709ce



































4eb2e8f






7b709ce


4eb2e8f
7b709ce




















4eb2e8f
a7b6bd9


a7b6bd9


5ca18ac
a7b6bd9



7b709ce
ff0f490
4eb2e8f
a7b6bd9


4eb2e8f

a7b6bd9













7b709ce


ff0f490
4eb2e8f


ff0f490

4eb2e8f


a7b6bd9









4eb2e8f
ff0f490

7b709ce





a7b6bd9
4eb2e8f
5ca18ac




a7b6bd9








7b709ce
a7b6bd9




7b709ce
5ca18ac
4eb2e8f
a7b6bd9
4eb2e8f



a7b6bd9
6d41814
a7b6bd9


4eb2e8f
a7b6bd9





7b709ce
a7b6bd9


5ca18ac
a7b6bd9



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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251










                     
 









                                                          






                                               










                                                                                      
                      











                                     

                                             


                                   








                                                       



































                                                        






                                                 


                                  
                           




















                                                                                            
                          


                                


                    
                                  



                        
                          
                            
                        


                                           

                           













                                                             


                                      
                         


                                                                       

                                        


                                    









                                                   
 

                                 





                                   
                              
                                            




                                           








                                                                
 




                                                                          
 
                                                                     
 
                    



                                                           
 
                      


                                        
                                                     





                                                          
 


                                             
                                                                 



                 
#include <sys/time.h>

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>


#include "litmus.h"
#include "common.h"


static double cputime()
{
	struct timespec ts;
	int err;
	err = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts);
	if (err != 0)
		perror("clock_gettime");
	return (ts.tv_sec + 1E-9 * ts.tv_nsec);
}

static double wctime()
{
	struct timeval tv;
	gettimeofday(&tv, NULL);
	return (tv.tv_sec + 1E-6 * tv.tv_usec);
}

void usage(char *error) {
	fprintf(stderr, "Error: %s\n", error);
	fprintf(stderr,
		"Usage: rt_spin [-w] [-p PARTITION] [-c CLASS] WCET PERIOD DURATION\n"
		"       rt_spin -l\n");
	exit(1);
}

#define NUMS 4096
static int num[NUMS];
static double loop_length = 1.0;
static char* progname;

static int loop_once(void)
{
	int i, j = 0;
	for (i = 0; i < NUMS; i++)
		j += num[i]++;
	return j;
}

static int loop_for(double exec_time)
{
	double t = 0;
	int tmp = 0;	
/*	while (t + loop_length < exec_time) {
		tmp += loop_once();
		t += loop_length;
	}
*/
	double start = cputime();
	double now = cputime();
	while (now + loop_length < start + exec_time) {
		tmp += loop_once();
		t += loop_length;
		now = cputime();
	}

	return tmp;
}

static void fine_tune(double interval)
{
	double start, end, delta;

	start = wctime();
	loop_for(interval);
	end = wctime();
	delta = (end - start - interval) / interval;
	if (delta != 0)
		loop_length = loop_length / (1 - delta);
}

static void configure_loop(void)
{
	double start;

	/* prime cache */
	loop_once();
	loop_once();
	loop_once();

	/* measure */
	start = wctime();
	loop_once(); /* hope we didn't get preempted  */
	loop_length = wctime();
	loop_length -= start;

	/* fine tune */
	fine_tune(0.1);
	fine_tune(0.1);
	fine_tune(0.1);
}

static void show_loop_length(void)
{
	printf("%s/%d: loop_length=%f (%ldus)\n",
	       progname, getpid(), loop_length,
	       (long) (loop_length * 1000000));
}

static void debug_delay_loop(void)
{
	double start, end, delay;
	show_loop_length();
	while (1) {
		for (delay = 0.5; delay > 0.01; delay -= 0.01) {
			start = wctime();
			loop_for(delay);
			end = wctime();
			printf("%6.4fs: looped for %10.8fs, delta=%11.8fs, error=%7.4f%%\n",
			       delay,
			       end - start,
			       end - start - delay,
			       100 * (end - start - delay) / delay);
		}
	}
}

static int job(double exec_time)
{
	loop_for(exec_time);
	sleep_next_period();
	return 0;
}

#define OPTSTR "p:c:wld:v"

int main(int argc, char** argv) 
{
	int ret;
	lt_t wcet;