summaryrefslogtreecommitdiffstats
path: root/doc/networking-profile.html
blob: b72a02542c8ba442e6d71d159e364ef2b8924f86 (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
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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>networking-profile.html</title>
<style>
@import 'https://fonts.googleapis.com/css?family=Droid+Sans+Mono|Open+Sans:400,400i,600,600i';

* {
    overflow: visible !important;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    box-decoration-break: clone;
}

html, body {
    background: #FFF;
    font-family: "Open Sans", "Segoe UI", Arial, freesans, sans-serif;
    font-size: 10px;
    line-height: 1.4;
    color: #333;
    word-wrap: break-word;
	hyphens: auto;
}

hr {
    margin-top: 20px;
    margin-bottom: 20px;
    border: 0;
    border-top: 4px solid #EEE;
}

code {
    padding: .1em .4em;
    display: inline-block;
    background-color: #f9f2f4;
    color: #c7254e;
    border-radius: 3px;
    border: 0 none;
    font: 9px "Droid Sans Mono", Consolas, "Liberation Mono", Menlo, "Courier New", Courier, monospace;
    line-height: 1.2;
    hyphens: manual;
}

pre code {
    padding: 15px;
    display: block;
    background-color: #F9F9F9;
    color: #555;
    font-size: 10px;
    box-shadow: inset -1px -1px 0 rgba(0, 0, 0, .08);
    word-wrap: normal;
}

/* replace light background for some hljs themes */
code.github-css,
code.github-gist-css,
code.tomorrow-css,
code.default-css,
code.googlecode-css,
code.ascetic-css,
code.color-brewer-css,
code.grayscale-css,
code.idea-css,
code.vs-css,
code.xcode-css {
    background-color: #F9F9F9 !important;
}

blockquote {
    padding: 10px;
    margin-left: 0;
    color: #666;
    border: 0 none;
    border-left: 4px solid #EEE;
}

blockquote p:last-child,
blockquote ul:last-child,
blockquote ol:last-child {
    margin-bottom: 0;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
    background-color: #FFF;
    width: 100%;
    max-width: 100%;
    margin-bottom: 20px;
    border: 1px solid #DDD;
}

table div {
    page-break-inside: avoid;
}

th, td {
    text-align: left;
}

table > thead > tr > th,
table > tbody > tr > th,
table > tfoot > tr > th,
table > thead > tr > td,
table > tbody > tr > td,
table > tfoot > tr > td {
    padding: 8px 14px;
    vertical-align: top;
    border-top: 1px solid #DDD;
}

table > caption + thead > tr:first-child > th,
table > colgroup + thead > tr:first-child > th,
table > thead:first-child > tr:first-child > th,
table > caption + thead > tr:first-child > td,
table > colgroup + thead > tr:first-child > td,
table > thead:first-child > tr:first-child > td {
    border-top: 0;
}

table > tbody + tbody {
    border-top: 2px solid #DDD;
}

table table {
    background-color: #FFF;
}

table > thead > tr > th,
table > tbody > tr > th,
table > tfoot > tr > th,
table > thead > tr > td,
table > tbody > tr > td,
table > tfoot > tr > td {
    border: 1px solid #DDD;
}

table > thead > tr > th,
table > thead > tr > td {
    border-bottom-width: 2px;
    text-align: center;
    vertical-align: middle;
    font-weight: bold;
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 90%;
}

table > tbody > tr:nth-of-type(odd) {
    background-color: #F9F9F9;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: inherit;
    font-weight: normal;
    line-height: 1.1;
    color: #111;
    margin-top: 20px;
    margin-bottom: 10px;
    padding: 0;
    page-break-after: avoid;
}

h1, h2 {
    border-bottom: 1px solid #EEE;
    padding-bottom: 7px;
    margin-top: 10px;
    margin-bottom: 12px;
}

h1 {
    font-size: 22px;
}

h2 {
    font-size: 17px;
}

h3 {
    font-size: 15px;
}

h4 {
    font-size: 11px;
}

h5, h6 {
    font-size: 10px;
    font-weight: bold;
    color: #666;
}

p {
    margin: 0 0 10px;
}

input[type="checkbox"] {
    margin-right: 6px;
    position: relative;
    bottom: 1px;
}

ul,
ol {
    margin-top: 0;
    margin-bottom: 10px;
    padding-left: 20px;
}

ul li,
ol li {
    margin-bottom: 2px;
}

dl {
    margin-top: 0;
    margin-bottom: 20px;
}

dt {
    font-weight: bold;
}

dd {
    margin-left: 0;
}

a,
a:visited {
    text-decoration: none;
    color: #4078C0;
}

.new-page,
.page-break,
.next-page,
.page-end {
    page-break-before: always;
}

#pageHeader,
#pageHeader a,
#pageHeader a:visited {
    color: #777;
}

#pageHeader span {
    vertical-align: middle;
}

#pageFooter {
    border-top: 1px solid #EEE;
    padding-top: 5px;
    color: #777;
    font-size: 80%;
}
#pageFooter a,
#pageFooter a:visited {
    color: #777;
}

/**
 * Your markdown-themeable-pdf custom styles
 *
 * The default file can be found in the folder ~/.atom/packages/markdown-themeable-pdf/templates
 * The base css file can be found in the folder ~/.atom/packages/markdown-themeable-pdf/css
 * The current highlight.js css file can be found in the folder ~/.atom/packages/markdown-themeable-pdf/node_modules/highlight.js/styles
 */

/*
html, body {
	color: red;
}
*/

/**
 * GitHub Gist Theme
 * Author : Louis Barranqueiro - https://github.com/LouisBarranqueiro
 */

.hljs {
  display: block;
  background: white;
  padding: 0.5em;
  color: #333333;
  overflow-x: auto;
}

.hljs-comment,
.hljs-meta {
  color: #969896;
}

.hljs-string,
.hljs-variable,
.hljs-template-variable,
.hljs-strong,
.hljs-emphasis,
.hljs-quote {
  color: #df5000;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-type {
  color: #a71d5d;
}

.hljs-literal,
.hljs-symbol,
.hljs-bullet,
.hljs-attribute {
  color: #0086b3;
}

.hljs-section,
.hljs-name {
  color: #63a35c;
}

.hljs-tag {
  color: #333333;
}

.hljs-title,
.hljs-attr,
.hljs-selector-id,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo {
  color: #795da3;
}

.hljs-addition {
  color: #55a532;
  background-color: #eaffea;
}

.hljs-deletion {
  color: #bd2c00;
  background-color: #ffecec;
}

.hljs-link {
  text-decoration: underline;
}

pre { white-space: pre-wrap !important; word-break: break-word !important; overflow: hidden !important;}
</style>
</head>
<body>
<div id="pageContent">
<h1 id="enea-linux-networking-profile">ENEA LINUX NETWORKING PROFILE</h1>
<p>Technology trends show that Linux-based Operating Systems have increased their
presence in the area of high-performance networking applications. While there
are no standardized ways of programatically accessing hardware offload
capabilities, several paradigms co-exist in Linux ecosystem to address this
specific need (e.g. USDPAA, DPDK, ODP etc.) Networking Profile in Enea Linux is
a framework for anyone attempting to implement high-performance networking
applications on various hardware platforms. It aims to bring in place all
necessary building blocks which facilitate efficient development of Linux-based
solutions on top of network accelerated hardware platforms. As different
hardware platforms have distinct data-path acceleration solutions, Networking
Profile implementation is very dependent on underlying hardware capabilities.</p>
<p>This document tries to describe the implementation details, changes, additions,
kernel configurations and tunings Enea made in order to achieve highly
optimized Linux distributions for networking applications.</p>
<p>The following paragraphs focus on Enea Linux Networking Profile on DPAA-based
QorIQ platforms, illustrating the implementation and changes on NXP P2041rdb
target.</p>
<pre><code>Table of Content
-------------------------------------------
1. Supported Targets
2. Real-Time Performance
------- 2.1 Kernel Modifications
------- 2.2 CPU-Isolation with partrt
------- 2.3 Latency Benchmarks
3. USDPAA Usage
------- 3.1 Packages
------- 3.2 Prepare Target
------- 3.3 Device Trees
------- 3.4 Boot Parameters
------- 3.5 Boot Instructions P2041RDB
------- 3.6 Run Reflector
------- 3.7 Run SRA
------- 3.8 Throughput using USDPAA
</code></pre>
<h2 id="1-supported-targets">1. Supported Targets</h2>
<p>Enea Linux Networking Profile has initially been tested on p2041rdb.</p>
<!--
        Table 1.1 Functionally verified targets
| Target   | Reflector App | SRIO | SRIO RCW available?
| ---      | ---           | ---  | ---                |
| p2041rdb | OK            | Yes  | Yes*

\* RCW that supports SRIO has to be created in code warrior or copied from the
  SRA User Guide [NXP-SDK], see section 3.1.
-->
<h2 id="2-improving-real-time-performance">2. Improving Real-Time Performance</h2>
<!--
FIXME/WIP! need to add nohz and test.
-->
<h3 id="21-kernel-modifications">2.1 Kernel Modifications</h3>
<p>When modifying a kernel for high-performance and low-latency applications there
are several aspects to take into consideration. In the <a href="http://linuxrealtime.org/index.php/Main_Page">Enea Linux Real-Time
Guide</a> a thorough investigation
and explanation of how to optimize Linux for low latency is given. Below is a
short description of kernel features added specifically to Enea Linux
Networking Profile in order to enhance real-time performance.</p>
<pre><code>        Table 2.1 Added kernel features and their properties.
</code></pre>
<table>
<thead>
<tr>
<th>Change</th>
<th>Reason</th>
</tr>
</thead>
<tbody>
<tr>
<td>RCU priority boosting -&gt; cfg/rcu_boost.cfg</td>
<td>Give low priority readers a higher priority to keep them from blocking tasks of higher prority. [RCU]</td>
</tr>
<tr>
<td>Offload RCU callback Processing -&gt; cfg/rcu_nocb</td>
<td>To reduce OS jitter, enable offloading of RCU callback processing to kernel threads. The rcu_nocbs boot parameter is used to define the set of CPUs to be offloaded.</td>
</tr>
<tr>
<td>Hotplug CPU -&gt; cfg/hotplug_cpu.cfg</td>
<td>Allows CPUs to be added to/removed from a live kernel. [HOTPLUG]</td>
</tr>
</tbody>
</table>
<!-- Adaptive-ticks CPU - cfg/nohz.cfg              Avoid scheduling clock interruptd for CPUs running a single task. [NOHZ] -->
<h4 id="211-boot-parameters">2.1.1 Boot Parameters</h4>
<!--
**TBD/FIXME:** Boot parameters for nohz_full and isolcpus.
-->
<p><strong>From [KERN-PARA]:</strong></p>
<!--
nohz=           [KNL] Boottime enable/disable dynamic ticks
                Valid arguments: on, off
                Default: on
-->
<pre><code>
rcu_nocbs=      [KNL]
                In kernels built with CONFIG_RCU_NOCB_CPU=y, set
                the specified list of CPUs to be no-callback CPUs.
                Invocation of these CPUs' RCU callbacks will
                be offloaded to &quot;rcuox/N&quot; kthreads created for
                that purpose, where &quot;x&quot; is &quot;b&quot; for RCU-bh, &quot;p&quot;
                for RCU-preempt, and &quot;s&quot; for RCU-sched, and &quot;N&quot;
                is the CPU number.  This reduces OS jitter on the
                offloaded CPUs, which can be useful for HPC and
                real-time workloads.  It can also improve energy
                efficiency for asymmetric multiprocessors.

isolcpus=       [KNL,SMP] Isolate CPUs from the general scheduler.
                Format:
                &lt;cpu number&gt;,...,&lt;cpu number&gt;
                or
                &lt;cpu number&gt;-&lt;cpu number&gt;
                (must be a positive range in ascending order)
                or a mixture
                &lt;cpu number&gt;,...,&lt;cpu number&gt;-&lt;cpu number&gt;

                This option can be used to specify one or more CPUs
                to isolate from the general SMP balancing and scheduling
                algorithms. You can move a process onto or off an
                &quot;isolated&quot; CPU via the CPU affinity syscalls or cpuset.
                &lt;cpu number&gt; begins at 0 and the maximum value is
                &quot;number of CPUs in system - 1&quot;.

                This option is the preferred way to isolate CPUs. The
                alternative -- manually setting the CPU mask of all
                tasks in the system -- can cause problems and
                suboptimal load balancer performance.
</code></pre>
<h3 id="22-cpu-isolation-with-partrt">2.2 Cpu-isolation with partrt</h3>
<p>A tool called partrt is included in the networking profile to divide an SMP
Linux system into partitions. A description of the tool can be found in the
<a href="http://linuxrealtime.org/index.php/Improving_the_Real-Time_Properties#The_CPU_Partitioning_Tool_-_partrt">Linux Real-Time
Guide</a>.</p>
<h3 id="23-latency-benchmarks">2.3 Latency Benchmarks</h3>
<p>The cyclictest suite [CYCLIC] is a measurement of system latency used in many
projects. As a comparison the measurement was applied to Enea Linux 6.0
Standard, and to Enea Linux Networking profile to investigate the impact of the
changes to the system.</p>
<p>Below <em>cyclictest</em> is tested on the two different systems, average and
maximum latency are presented in the tables below, first the test on the
standard profile and after the results on the networking profile are shown. It
is also combined with <em>stress</em> [STRESS] to show system performance under
different type of loads.</p>
<!--
FIXME!
 **Enea Linux 6.0 Standard System Info**
 - Kernel size:
 - Root-fs size:

**Enea Linux 6.0 Networking Profile System Info**
 - Kernel size:
 - Root-fs size:
-->
<pre><code>    Command: Cyclictest with no stress
</code></pre>
<table>
<thead>
<tr>
<th>CPU #</th>
<th>P</th>
<th>I</th>
<th>C_std</th>
<th>Avg_std (us)</th>
<th>Max_std (us)</th>
<th>C_net</th>
<th>Avg_net (us)</th>
<th>Max_net (us)</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>99</td>
<td>1000</td>
<td>100000</td>
<td>9</td>
<td>24</td>
<td>100000</td>
<td>6</td>
<td>11</td>
</tr>
<tr>
<td>1</td>
<td>99</td>
<td>1500</td>
<td>66817</td>
<td>9</td>
<td>21</td>
<td>66812</td>
<td>6</td>
<td>12</td>
</tr>
<tr>
<td>2</td>
<td>99</td>
<td>2000</td>
<td>50208</td>
<td>9</td>
<td>23</td>
<td>50106</td>
<td>6</td>
<td>18</td>
</tr>
<tr>
<td>3</td>
<td>99</td>
<td>2500</td>
<td>40083</td>
<td>9</td>
<td>14</td>
<td>40082</td>
<td>6</td>
<td>10</td>
</tr>
</tbody>
</table>
<pre><code>    Command: cyclictest with hdd stress:
    # stress -d 4 --hdd-bytes 1M &amp;
</code></pre>
<table>
<thead>
<tr>
<th>CPU #</th>
<th>P</th>
<th>I</th>
<th>C_std</th>
<th>Avg_std (us)</th>
<th>Max_std (us)</th>
<th>C_net</th>
<th>Avg_net (us)</th>
<th>Max_net (us)</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>99</td>
<td>1000</td>
<td>100000</td>
<td>14</td>
<td>223</td>
<td>100000</td>
<td>11</td>
<td>77</td>
</tr>
<tr>
<td>1</td>
<td>99</td>
<td>1500</td>
<td>66820</td>
<td>14</td>
<td>231</td>
<td>66745</td>
<td>11</td>
<td>100</td>
</tr>
<tr>
<td>2</td>
<td>99</td>
<td>2000</td>
<td>50109</td>
<td>14</td>
<td>186</td>
<td>50055</td>
<td>11</td>
<td>76</td>
</tr>
<tr>
<td>3</td>
<td>99</td>
<td>2500</td>
<td>40083</td>
<td>14</td>
<td>176</td>
<td>40041</td>
<td>11</td>
<td>81</td>
</tr>
</tbody>
</table>
<pre><code>    Command: cyclictest with vm stress:
    # stress -m 4 --vm-bytes 4096 &amp;
</code></pre>
<table>
<thead>
<tr>
<th>CPU #</th>
<th>P</th>
<th>I</th>
<th>C_std</th>
<th>Avg_std (us)</th>
<th>Max_std (us)</th>
<th>C_net</th>
<th>Avg_net (us)</th>
<th>Max_net (us)</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>99</td>
<td>1000</td>
<td>100000</td>
<td>5</td>
<td>20</td>
<td>100000</td>
<td>3</td>
<td>15</td>
</tr>
<tr>
<td>1</td>
<td>99</td>
<td>1500</td>
<td>66818</td>
<td>6</td>
<td>14</td>
<td>66739</td>
<td>3</td>
<td>7</td>
</tr>
<tr>
<td>2</td>
<td>99</td>
<td>1500</td>
<td>50109</td>
<td>6</td>
<td>14</td>
<td>50103</td>
<td>3</td>
<td>9</td>
</tr>
<tr>
<td>3</td>
<td>99</td>
<td>1500</td>
<td>40079</td>
<td>6</td>
<td>14</td>
<td>40081</td>
<td>3</td>
<td>6</td>
</tr>
</tbody>
</table>
<pre><code>    Command: cyclictest with full stress trial 1:
    # stress -c 4 -i 4 -m 4 --vm-bytes 4096 -d 4 --hdd-bytes 4096 &amp;
</code></pre>
<table>
<thead>
<tr>
<th>CPU #</th>
<th>P</th>
<th>I</th>
<th>C_std</th>
<th>Avg_std (us)</th>
<th>Max_std (us)</th>
<th>C_net</th>
<th>Avg_net (us)</th>
<th>Max_net (us)</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>99</td>
<td>1000</td>
<td>99808</td>
<td>7</td>
<td>93</td>
<td>99815</td>
<td>6</td>
<td>58</td>
</tr>
<tr>
<td>1</td>
<td>99</td>
<td>1500</td>
<td>66733</td>
<td>9</td>
<td>105</td>
<td>66739</td>
<td>6</td>
<td>54</td>
</tr>
<tr>
<td>2</td>
<td>99</td>
<td>2000</td>
<td>50039</td>
<td>9</td>
<td>79</td>
<td>50039</td>
<td>7</td>
<td>61</td>
</tr>
<tr>
<td>3</td>
<td>99</td>
<td>2500</td>
<td>40016</td>
<td>10</td>
<td>83</td>
<td>40032</td>
<td>6</td>
<td>57</td>
</tr>
</tbody>
</table>
<pre><code>    Command: cyclictest with full stress trial 2:
    # stress -c 4 -i 4 -m 4 --vm-bytes 4096 -d 4 --hdd-bytes 1M &amp;
</code></pre>
<table>
<thead>
<tr>
<th>CPU #</th>
<th>P</th>
<th>I</th>
<th>C_std</th>
<th>Avg_std (us)</th>
<th>Max_std (us)</th>
<th>C_net</th>
<th>Avg_net (us)</th>
<th>Max_net (us)</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>99</td>
<td>1000</td>
<td>100000</td>
<td>13</td>
<td>201</td>
<td>100000</td>
<td>10</td>
<td>87</td>
</tr>
<tr>
<td>1</td>
<td>99</td>
<td>1500</td>
<td>66646</td>
<td>11</td>
<td>186</td>
<td>66685</td>
<td>9</td>
<td>85</td>
</tr>
<tr>
<td>2</td>
<td>99</td>
<td>2000</td>
<td>49969</td>
<td>10</td>
<td>195</td>
<td>49998</td>
<td>10</td>
<td>70</td>
</tr>
<tr>
<td>3</td>
<td>99</td>
<td>2500</td>
<td>39960</td>
<td>11</td>
<td>112</td>
<td>39992</td>
<td>10</td>
<td>90</td>
</tr>
</tbody>
</table>
<h2 id="3-usdpaa-usage">3. USDPAA Usage</h2>
<p>The need for predictive and good performance for networking systems is
critical. One way of achieving greater performance is for user-space to avoid
interactions with the kernel. The kernel is responsible for hardware
acceleration allocation and scheduling. By using frameworks such as
USDPAA[NXP-SDK] and DPDK[DPDK] control over certain hardware can be given
to user-space. USDPAA is specific to NXP/Freescale's QoriQ platforms, for more
information please see their guide to USDPAA [NXP-SDK].</p>
<p>In the guides below, an example of how to prepare a p2041rdb target with SRIO
and ethernet through USDPAA is given.</p>
<h3 id="31-packages">3.1 Packages</h3>
<p>The networking profile supports and includes all packages necessary for
software support of USDPAA. If another image is created the below listed
packages are relevant to include (all available in meta-fsl-ppc and
meta-freescale) in order to add support for USDPAA and some example applications.</p>
<pre><code>    * usdpaa
    * usdpaa-apps
    * fmc
    * fmlib
    * flib
    * eth-config
</code></pre>
<h3 id="32-prepare-target">3.2 Prepare Target</h3>
<p>The SRIO application needs us to boot with a RCW and board configuration that
allows usage of the PCI extender port. The below examples are specific to
p2041rdb, but similar steps can be taken for other targets where SRIO is not
enabled by default.</p>
<h4 id="321-reset-control-word-rcw">3.2.1 Reset Control Word (RCW)</h4>
<p>The reset control word must configure the serial-deserializer (SERDES) bus for
SRIO. This can be done by either a predefined binary/setting, or can be created
in Code Warrior [CW].</p>
<p>The RCW used in this example was given in the NXP/Freescale SRA User Guide of
[NXP-SDK].</p>
<p>To program the RCW to target from u-boot follow the steps below:</p>
<pre><code>=&gt; tftp 1000000 &lt;path-2-file&gt;/RR_RS_0x02.bin

=&gt; md 0xec000000
ec000000: aa55aa55 010e0100 12600000 00000000 .U.U.....`......
ec000010: 241c0000 00000000 248e40c0 c3c02000 $.......$.@... .
ec000020: de800000 40000000 00000000 00000000 ....@...........
ec000030: 00000000 d0030f07 00000000 00000000 ................
ec000040: 00000000 00000000 091380c0 000009c4 ................
ec000050: 09000010 00000000 091380c0 000009c4 ................
ec000060: 09000014 00000000 091380c0 000009c4 ................
ec000070: 09000018 81d00000 091380c0 000009c4 ................
ec000080: 890b0050 00000002 091380c0 000009c4 ...P............
ec000090: 890b0054 00000002 091380c0 000009c4 ...T............
ec0000a0: 890b0058 00000002 091380c0 000009c4 ...X............
ec0000b0: 890b005c 00000002 091380c0 000009c4 ...\............
ec0000c0: 890b0090 00000002 091380c0 000009c4 ................
ec0000d0: 890b0094 00000002 091380c0 000009c4 ................
ec0000e0: 890b0098 00000002 091380c0 000009c4 ................
ec0000f0: 890b009c 00000002 091380c0 000009c4 ................

=&gt; protect off 0xec000000 +$filesize
Un-Protected 1 sectors
=&gt; erase 0xec000000 +$filesize

. done
Erased 1 sectors

=&gt; cp.b 1000000 0xec000000 $filesize
Copy to Flash... 9done

=&gt; protect on 0xec000000 +$filesize
Protected 1 sectors

=&gt; md 0xec000000
ec000000: aa55aa55 010e0100 12600000 00000000 .U.U.....`......
ec000010: 241c0000 00000000 088040c0 c3c02000 $.........@... .
ec000020: de800000 40000000 00000000 00000000 ....@...........
ec000030: 00000000 d0030f07 00000000 00000000 ................
ec000040: 00000000 00000000 091380c0 000009c4 ................
ec000050: 09000010 00000000 091380c0 000009c4 ................
ec000060: 09000014 00000000 091380c0 000009c4 ................
ec000070: 09000018 81d00000 091380c0 000009c4 ................
ec000080: 890b0050 00000002 091380c0 000009c4 ...P............
ec000090: 890b0054 00000002 091380c0 000009c4 ...T............
ec0000a0: 890b0058 00000002 091380c0 000009c4 ...X............
ec0000b0: 890b005c 00000002 091380c0 000009c4 ...\............
ec0000c0: 890b0090 00000002 091380c0 000009c4 ................
ec0000d0: 890b0094 00000002 091380c0 000009c4 ................
ec0000e0: 890b0098 00000002 091380c0 000009c4 ................
ec0000f0: 890b009c 00000002 091380c0 000009c4 ................
=&gt;
</code></pre>
<p>In order to obtain specific hardware settings, some multiplexers need to be
set. Descriptions of these can be obtained by typing <strong>cpld -h</strong> in u-boot,
information about the peripherals are also available in the board's respective
user guide. For SRIO on the p2041rdb target the following settings are
necessary.</p>
<pre><code>cpld_cmd lane_mux 6 0
cpld_cmd lane_mux a 0
cpld_cmd lane_mux c 0
cpld_cmd lane_mux d 0
</code></pre>
<h3 id="33-device-trees">3.3 Device Trees</h3>
<p>USDPAA enabled targets have very specific device trees, this is because instead
of handing over hardware to the linux kernel, it is managed by the DPAA
framework.</p>
<p>The networking profile includes a custom device-tree
(<machine>-usdpaa-enea.dtb), currently defined for p2041rdb. It gives one
ethernet interface to the kernel while the rest belongs to DPAA.</p>
<p>Available and tested device-trees for p2041rdb:</p>
<ul>
<li>uImage-p2041rdb-usdpaa-enea.dtb       EL custom interface, gives one interface to the linux kernel and remaining to DPAA.</li>
</ul>
<h3 id="34-boot-parameters">3.4 Boot Parameters</h3>
<p>USDPAA demands some custom boot arguments. If not given, or if given improperly
the USDPAA applications will not be usable. The NXP/Freescale manual covers these arguments, however might be misdirecting since the documentation in several places are, rather than target agnostic, specific instructions that are only applicable to certain targets. If unsure, one can consult the benchmarking
chapter of the NXP/Freescale SDK documentation that include more exact steps per
tested targets.</p>
<p>For our purposes of testing SRIO and the reflector application we only need the
'usdpaa_mem' boot argument. If the reserved memory is too large, it will cause
segmentation faults.</p>
<pre><code>    Table 4.1 'usdpaa_mem=?'
</code></pre>
<table>
<thead>
<tr>
<th>TARGET</th>
<th>usdpaa_mem</th>
</tr>
</thead>
<tbody>
<tr>
<td>p2041rdb</td>
<td>=&lt; 64M</td>
</tr>
</tbody>
</table>
<h3 id="35-boot-instructions-p2041rdb">3.5 Boot instructions P2041RDB</h3>
<p>Below are instructions on how to boot a p2041rdb board with usdpaa enabled.</p>
<h4 id="351-boot-over-nfs-server">3.5.1 Boot over NFS server</h4>
<pre><code>tftp 1000000 uImage-p2041rdb.bin
tftp c00000 uImage-p2041rdb-usdpaa-enea.dtb

setenv bootargs root=/dev/nfs
nfsroot=172.21.3.8:/unix/enea_linux_rootfs/&lt;folder-path&gt; rw ip=dhcp
console=ttyS0,115200 memmap=16M$0xf7000000 mem=4080M max_addr=f6ffffff
usdpaa_mem=64M

bootm 1000000 - c00000
</code></pre>
<h4 id="352-ram-boot">3.5.2 RAM Boot</h4>
<pre><code>tftp 1000000 uImage-p2041rdb.bin
tftp 2000000 uImage-p2041rdb-usdpaa.dtb
tftp 5000000 enea-image-networking-p2041rdb.ext2.gz.u-boot

setenv bootargs root=/dev/ram rw console=ttyS0,115200 ramdisk_size=10000000
log_buf_len=128K usdpaa_mem=64M

bootm 0x1000000 0x5000000 0x2000000
</code></pre>
<h3 id="36-run-reflector">3.6 Run Reflector</h3>
<p>Reflector is a demo application from NXP/Freescale that through ethernet
recieves a package and sends it back to with switched source-destination IP
addresses switched.</p>
<p>In order to test reflector an ethernet cable must be connected between either
two p2041rdb targets or between a work-PC and the p2041rdb target.</p>
<p>Connect two targets by ethernet and do the following steps to test connection
with usdpaa:</p>
<ol>
<li>Boot Board A with uImage-p2041rdb-uspdaa-enea.dtb</li>
<li>Boot Board B with uImage-p2041rdb.dtb</li>
<li>On board A do the following:</li>
</ol>
<pre><code>        # Configure what ethernet ports that should be used by dpaa
        $ vi config-p2041rdb.xml
        &lt;cfgdata&gt;
          &lt;config&gt;
            &lt;engine name=&quot;fm0&quot;&gt;
              &lt;port type=&quot;MAC&quot; number=&quot;2&quot;
policy=&quot;hash_ipsec_src_dst_spi_policy1&quot;/&gt;
              &lt;port type=&quot;MAC&quot; number=&quot;3&quot;
policy=&quot;hash_ipsec_src_dst_spi_policy2&quot;/&gt;
              &lt;port type=&quot;MAC&quot; number=&quot;4&quot;
policy=&quot;hash_ipsec_src_dst_spi_policy3&quot;/&gt;
              &lt;port type=&quot;MAC&quot; number=&quot;5&quot;
policy=&quot;hash_ipsec_src_dst_spi_policy4&quot;/&gt;
            &lt;/engine&gt;
          &lt;/config&gt;
        &lt;/cfgdata&gt;

        $ fmc -c config-p2041rdb.xml -p /usr/etc/usdpaa_policy_hash_ipv4.xml -a

        # start reflector and check the ethernet ports:
        $ reflector
        reflector&gt; ifconfig
</code></pre>
<ol start="4">
<li>On board B do the following:</li>
</ol>
<pre><code>        # Configure the network interface to which you connected the ethernet
          cable, by choosing an ip- and MAC address.
        $ ifconfig -a
        $ ifconfig &lt;eth-x&gt; 192.168.0.10 netmask 255.255.255.0 up

        # Configure to connect to the hw address
        $ arp -s 192.168.0.11 &lt;hw-address&gt; -i &lt;eth-x&gt;

        # Ping Board A
        $ ping 192.168.0.11
</code></pre>
<h3 id="37-run-sra">3.7 Run SRA</h3>
<p>The user space drivers from NXP/Freescale support usage of SRIO from linux user
space. The SRA application is a demo application from NXP/Freescale that can
implement writing from one SRIO interface to another, avioding kernel
interaction by using DMA (direct memory access) memory management. More
information on the drivers can be found in the NXP/freescale SDK [NXP-SDK].</p>
<p>In the test run below two boards are prepared with SRIO interfaces. Both boards
are initialized with a memory setting that sets the different SRIO memory
spaces to different values. Then data from Board A's <em>Write-prepapration space</em>
is written to Board B's <em>Map space</em>.</p>
<pre><code>        # start the srio application
        $ sra

        # setup board B (receiver)
        sra&gt; sra -attr port1 win_attr 1 nwrite nread

        # set local memory to data predefined in 0x100000
        sra&gt; sra -op port1 1 0 0 s 0x100000

        # read to view what is written to port 1
        sra&gt; sra -op port1 1 0 0 p 0x100000


        # setup board A (transmitter)
        sra&gt; sra -attr port1 win_attr 1 nwrite nread

        # set local memory and then read to confirm
        sra&gt; sra -op port1 1 0 0 s 0x100000
        sra&gt; sra -op port1 1 0 0 p 0x100000

        # write what is in 'write preparing space' to outbound
        sra&gt; sra -op port1 1 0 0 w 0x100000

        # confirm on board B that 'write preparation space' from board A is written in
        # 'map space'
        sra&gt; sra -op port1 1 0 0 p 0x100000
</code></pre>
<pre><code>          Board A                                 Board B
        +-------------------+                   +-------------------+
        | Map space         |           +------&gt;| Map space         |
        +-------------------+           |       +-------------------+
        | Read data space   |           |       | Read data space   |
        +-------------------+  outbound |       +-------------------+
        | write preparation |-----------+       | write preparation |
        | space             |                   | space             |
        +-------------------+                   +-------------------+
        | reserved space    |                   | reserved space    |
        +-------------------+                   +-------------------+

Image 3.1 SRIO memory space
</code></pre>
<h3 id="38-throughput-using-usdpaa">3.8 Throughput using USDPAA</h3>
<p>To show some of the power of using the USDPAA framework a test of the
throughput over a 10G ethernet link was tested and the results are presented
below.</p>
<p>The tool used for performance measuring was Spirent Test Center which is used as
a packet generator along with the “Spirent Test Center” application, version
4.33. The test targets are connected to the Spirent Test Center through 10G
Ethernet ports(XAUI-RISER card). On Enea Linux 6.0 a the USDPAA reflector was
used as a packet forwarding application. The resulting Throughput performance measured with spirent can be seen in image 3.2 below.</p>
<!--![alt text](./throughput_p2041rdb_networking.png =250x)-->
<img src="img/throughput_p2041rdb_networking.png" alt="Drawing" style="width: 500px;"/>
<pre><code>Image 3.2 Throughput on p2041rdb over a 10G ethernet port using USDPAA.
x-axis shows the frame size in bytes, and y-axis the aggregated throughput in
megabits per second.
</code></pre>
<hr>
<hr>
<p>[NXP-SDK] QorIQ SDK 1.9 Documentation -
https://freescale.sdlproducts.com/LiveContent/web/pub.xql?c=t&amp;action=home&amp;pub=QorIQ_SDK_1.9&amp;lang=en-US#addHistory=true&amp;filename=GUID-81837065-81AD-449B-8572-E96C3EED636F.xml&amp;docid=GUID-81837065-81AD-449B-8572-E96C3EED636F&amp;inner_id=&amp;tid=&amp;query=&amp;scope=&amp;resource=&amp;toc=false&amp;eventType=lcContent.loadHome</p>
<p>[KERN-PARA] Kernel Parameters, https://www.kernel.org/doc/Documentation/kernel-parameters.txt</p>
<p>[RCU] Paul McKenney, <em>Priority-Boosting RCU Read-Side Critical Section</em>, https://lwn.net/Articles/220677/</p>
<!--
[NOHZ] https://www.kernel.org/doc/Documentation/timers/NO_HZ.txt
-->
<p>[HOTPLUG] https://www.kernel.org/doc/Documentation/cpu-hotplug.txt</p>
<p>[DPDK] http://dpdk.org/</p>
<p>[CYCLIC] https://rt.wiki.kernel.org/index.php/Cyclictest</p>
<p>[STRESS] http://linux.die.net/man/1/stresshttp://linux.die.net/man/1/stress</p>
<p>[CW] http://www.nxp.com/products/software-and-tools/software-development-tools/codewarrior-development-tools:CW_HOME</p>

</div></body>
</html>