-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDPDK笔记.html
957 lines (948 loc) · 27 KB
/
DPDK笔记.html
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
<!DOCTYPE html>
<html data-markdown-preview-plus-context="html-export">
<head>
<meta charset="utf-8" />
<title>DPDK笔记</title>
<style>.emoji {
max-width: 1em !important;
}
del {
text-decoration: none;
position: relative;
}
del::after {
border-bottom: 1px solid black;
content: '';
left: 0;
position: absolute;
right: 0;
top: 50%;
}
ul.contains-task-list li.task-list-item {
position: relative;
list-style-type: none;
}
ul.contains-task-list li.task-list-item input.task-list-item-checkbox {
position: absolute;
transform: translateX(-100%);
width: 30px;
}
span.critic.comment {
position: relative;
}
span.critic.comment::before {
content: '\1f4ac';
position: initial;
}
span.critic.comment > span {
display: none;
}
span.critic.comment:hover > span {
display: initial;
position: absolute;
top: 100%;
left: 0;
border: 1px solid;
border-radius: 5px;
max-height: 4em;
overflow: auto;
}
span.critic.comment:focus > span {
display: initial;
text-decoration: underline;
position: initial;
top: auto;
left: auto;
border: initial;
border-radius: initial;
}
table {
border-collapse: collapse;
border-spacing: 0;
background-color: transparent;
}
body {
padding: 2em;
font-size: 1.2em;
color: #abb2bf;
background-color: #282c34;
overflow: auto;
}
body > :first-child,
body > div.update-preview > :first-child {
margin-top: 0;
}
body > p,
body > div.update-preview > p {
margin-top: 0;
margin-bottom: 1.5em;
}
body > ul,
body > div.update-preview > ul,
body > ol,
body > div.update-preview > ol {
margin-bottom: 1.5em;
}
h1,
h2,
h3,
h4,
h5,
h6 {
line-height: 1.2;
margin-top: 1.5em;
margin-bottom: 0.5em;
color: #ffffff;
}
h1 {
font-size: 2.4em;
font-weight: 300;
}
h2 {
font-size: 1.8em;
font-weight: 400;
}
h3 {
font-size: 1.5em;
font-weight: 500;
}
h4 {
font-size: 1.2em;
font-weight: 600;
}
h5 {
font-size: 1.1em;
font-weight: 600;
}
h6 {
font-size: 1em;
font-weight: 600;
}
strong {
color: #ffffff;
}
del {
color: #7c879c;
}
a,
a code {
color: #528bff;
}
img {
max-width: 100%;
}
blockquote {
margin: 1.5em 0;
font-size: inherit;
color: #7c879c;
border-color: #4b5362;
border-width: 4px;
}
hr {
margin: 3em 0;
border-top: 2px dashed #4b5362;
background: none;
}
table {
margin: 1.5em 0;
}
th {
color: #ffffff;
}
th,
td {
padding: 0.66em 1em;
border: 1px solid #4b5362;
}
code {
color: #ffffff;
background-color: #3a3f4b;
}
pre.editor-colors {
margin: 1.5em 0;
padding: 1em;
font-size: 0.92em;
border-radius: 3px;
background-color: #31363f;
}
kbd {
color: #ffffff;
border: 1px solid #4b5362;
border-bottom: 2px solid #3e4451;
background-color: #3a3f4b;
}
.bracket-matcher .region {
border-bottom: 1px dotted lime;
position: absolute;
}
.line-number.bracket-matcher.bracket-matcher {
color: #abb2bf;
background-color: #3a3f4b;
}
.spell-check-misspelling .region {
border-bottom: 2px dotted rgba(255, 51, 51, 0.75);
}
.spell-check-corrections {
width: 25em !important;
}
pre.editor-colors {
background-color: #282c34;
color: #abb2bf;
}
pre.editor-colors .line.cursor-line {
background-color: rgba(153, 187, 255, 0.04);
}
pre.editor-colors .invisible {
color: #abb2bf;
}
pre.editor-colors .cursor {
border-left: 2px solid #528bff;
}
pre.editor-colors .selection .region {
background-color: #3e4451;
}
pre.editor-colors .bracket-matcher .region {
border-bottom: 1px solid #528bff;
box-sizing: border-box;
}
pre.editor-colors .invisible-character {
color: rgba(171, 178, 191, 0.15);
}
pre.editor-colors .indent-guide {
color: rgba(171, 178, 191, 0.15);
}
pre.editor-colors .wrap-guide {
background-color: rgba(171, 178, 191, 0.15);
}
pre.editor-colors .find-result .region.region.region,
pre.editor-colors .current-result .region.region.region {
border-radius: 2px;
background-color: rgba(82, 139, 255, 0.24);
transition: border-color 0.4s;
}
pre.editor-colors .find-result .region.region.region {
border: 2px solid transparent;
}
pre.editor-colors .current-result .region.region.region {
border: 2px solid #528bff;
transition-duration: .1s;
}
pre.editor-colors .gutter .line-number {
color: #636d83;
-webkit-font-smoothing: antialiased;
}
pre.editor-colors .gutter .line-number.cursor-line {
color: #abb2bf;
background-color: #3a3f4b;
}
pre.editor-colors .gutter .line-number.cursor-line-no-selection {
background-color: transparent;
}
pre.editor-colors .gutter .line-number .icon-right {
color: #abb2bf;
}
pre.editor-colors .gutter:not(.git-diff-icon) .line-number.git-line-removed.git-line-removed::before {
bottom: -3px;
}
pre.editor-colors .gutter:not(.git-diff-icon) .line-number.git-line-removed::after {
content: "";
position: absolute;
left: 0px;
bottom: 0px;
width: 25px;
border-bottom: 1px dotted rgba(224, 82, 82, 0.5);
pointer-events: none;
}
pre.editor-colors .gutter .line-number.folded,
pre.editor-colors .gutter .line-number:after,
pre.editor-colors .fold-marker:after {
color: #abb2bf;
}
.syntax--comment {
color: #5c6370;
font-style: italic;
}
.syntax--comment .syntax--markup.syntax--link {
color: #5c6370;
}
.syntax--entity.syntax--name.syntax--type {
color: #e5c07b;
}
.syntax--entity.syntax--other.syntax--inherited-class {
color: #e5c07b;
}
.syntax--keyword {
color: #c678dd;
}
.syntax--keyword.syntax--control {
color: #c678dd;
}
.syntax--keyword.syntax--operator {
color: #c678dd;
}
.syntax--keyword.syntax--other.syntax--special-method {
color: #61afef;
}
.syntax--keyword.syntax--other.syntax--unit {
color: #d19a66;
}
.syntax--storage {
color: #c678dd;
}
.syntax--storage.syntax--type.syntax--annotation,
.syntax--storage.syntax--type.syntax--primitive {
color: #c678dd;
}
.syntax--storage.syntax--modifier.syntax--package,
.syntax--storage.syntax--modifier.syntax--import {
color: #abb2bf;
}
.syntax--constant {
color: #d19a66;
}
.syntax--constant.syntax--variable {
color: #d19a66;
}
.syntax--constant.syntax--character.syntax--escape {
color: #56b6c2;
}
.syntax--constant.syntax--numeric {
color: #d19a66;
}
.syntax--constant.syntax--other.syntax--color {
color: #56b6c2;
}
.syntax--constant.syntax--other.syntax--symbol {
color: #56b6c2;
}
.syntax--variable {
color: #e06c75;
}
.syntax--variable.syntax--interpolation {
color: #be5046;
}
.syntax--variable.syntax--parameter {
color: #abb2bf;
}
.syntax--string {
color: #98c379;
}
.syntax--string > .syntax--source,
.syntax--string .syntax--embedded {
color: #abb2bf;
}
.syntax--string.syntax--regexp {
color: #56b6c2;
}
.syntax--string.syntax--regexp .syntax--source.syntax--ruby.syntax--embedded {
color: #e5c07b;
}
.syntax--string.syntax--other.syntax--link {
color: #e06c75;
}
.syntax--punctuation.syntax--definition.syntax--comment {
color: #5c6370;
}
.syntax--punctuation.syntax--definition.syntax--method-parameters,
.syntax--punctuation.syntax--definition.syntax--function-parameters,
.syntax--punctuation.syntax--definition.syntax--parameters,
.syntax--punctuation.syntax--definition.syntax--separator,
.syntax--punctuation.syntax--definition.syntax--seperator,
.syntax--punctuation.syntax--definition.syntax--array {
color: #abb2bf;
}
.syntax--punctuation.syntax--definition.syntax--heading,
.syntax--punctuation.syntax--definition.syntax--identity {
color: #61afef;
}
.syntax--punctuation.syntax--definition.syntax--bold {
color: #e5c07b;
font-weight: bold;
}
.syntax--punctuation.syntax--definition.syntax--italic {
color: #c678dd;
font-style: italic;
}
.syntax--punctuation.syntax--section.syntax--embedded {
color: #be5046;
}
.syntax--punctuation.syntax--section.syntax--method,
.syntax--punctuation.syntax--section.syntax--class,
.syntax--punctuation.syntax--section.syntax--inner-class {
color: #abb2bf;
}
.syntax--support.syntax--class {
color: #e5c07b;
}
.syntax--support.syntax--type {
color: #56b6c2;
}
.syntax--support.syntax--function {
color: #56b6c2;
}
.syntax--support.syntax--function.syntax--any-method {
color: #61afef;
}
.syntax--entity.syntax--name.syntax--function {
color: #61afef;
}
.syntax--entity.syntax--name.syntax--class,
.syntax--entity.syntax--name.syntax--type.syntax--class {
color: #e5c07b;
}
.syntax--entity.syntax--name.syntax--section {
color: #61afef;
}
.syntax--entity.syntax--name.syntax--tag {
color: #e06c75;
}
.syntax--entity.syntax--other.syntax--attribute-name {
color: #d19a66;
}
.syntax--entity.syntax--other.syntax--attribute-name.syntax--id {
color: #61afef;
}
.syntax--meta.syntax--class {
color: #e5c07b;
}
.syntax--meta.syntax--class.syntax--body {
color: #abb2bf;
}
.syntax--meta.syntax--method-call,
.syntax--meta.syntax--method {
color: #abb2bf;
}
.syntax--meta.syntax--definition.syntax--variable {
color: #e06c75;
}
.syntax--meta.syntax--link {
color: #d19a66;
}
.syntax--meta.syntax--require {
color: #61afef;
}
.syntax--meta.syntax--selector {
color: #c678dd;
}
.syntax--meta.syntax--separator {
color: #abb2bf;
}
.syntax--meta.syntax--tag {
color: #abb2bf;
}
.syntax--underline {
text-decoration: underline;
}
.syntax--none {
color: #abb2bf;
}
.syntax--invalid.syntax--deprecated {
color: #523d14 !important;
background-color: #e0c285 !important;
}
.syntax--invalid.syntax--illegal {
color: white !important;
background-color: #e05252 !important;
}
.syntax--markup.syntax--bold {
color: #d19a66;
font-weight: bold;
}
.syntax--markup.syntax--changed {
color: #c678dd;
}
.syntax--markup.syntax--deleted {
color: #e06c75;
}
.syntax--markup.syntax--italic {
color: #c678dd;
font-style: italic;
}
.syntax--markup.syntax--heading {
color: #e06c75;
}
.syntax--markup.syntax--heading .syntax--punctuation.syntax--definition.syntax--heading {
color: #61afef;
}
.syntax--markup.syntax--link {
color: #56b6c2;
}
.syntax--markup.syntax--inserted {
color: #98c379;
}
.syntax--markup.syntax--quote {
color: #d19a66;
}
.syntax--markup.syntax--raw {
color: #98c379;
}
.syntax--source.syntax--cs .syntax--keyword.syntax--operator {
color: #c678dd;
}
.syntax--source.syntax--css .syntax--property-name,
.syntax--source.syntax--css .syntax--property-value {
color: #828997;
}
.syntax--source.syntax--css .syntax--property-name.syntax--support,
.syntax--source.syntax--css .syntax--property-value.syntax--support {
color: #abb2bf;
}
.syntax--source.syntax--elixir .syntax--source.syntax--embedded.syntax--source {
color: #abb2bf;
}
.syntax--source.syntax--elixir .syntax--constant.syntax--language,
.syntax--source.syntax--elixir .syntax--constant.syntax--numeric,
.syntax--source.syntax--elixir .syntax--constant.syntax--definition {
color: #61afef;
}
.syntax--source.syntax--elixir .syntax--variable.syntax--definition,
.syntax--source.syntax--elixir .syntax--variable.syntax--anonymous {
color: #c678dd;
}
.syntax--source.syntax--elixir .syntax--parameter.syntax--variable.syntax--function {
color: #d19a66;
font-style: italic;
}
.syntax--source.syntax--elixir .syntax--quoted {
color: #98c379;
}
.syntax--source.syntax--elixir .syntax--keyword.syntax--special-method,
.syntax--source.syntax--elixir .syntax--embedded.syntax--section,
.syntax--source.syntax--elixir .syntax--embedded.syntax--source.syntax--empty {
color: #e06c75;
}
.syntax--source.syntax--elixir .syntax--readwrite.syntax--module .syntax--punctuation {
color: #e06c75;
}
.syntax--source.syntax--elixir .syntax--regexp.syntax--section,
.syntax--source.syntax--elixir .syntax--regexp.syntax--string {
color: #be5046;
}
.syntax--source.syntax--elixir .syntax--separator,
.syntax--source.syntax--elixir .syntax--keyword.syntax--operator {
color: #d19a66;
}
.syntax--source.syntax--elixir .syntax--variable.syntax--constant {
color: #e5c07b;
}
.syntax--source.syntax--elixir .syntax--array,
.syntax--source.syntax--elixir .syntax--scope,
.syntax--source.syntax--elixir .syntax--section {
color: #828997;
}
.syntax--source.syntax--gfm .syntax--markup {
-webkit-font-smoothing: auto;
}
.syntax--source.syntax--gfm .syntax--link .syntax--entity {
color: #61afef;
}
.syntax--source.syntax--ini .syntax--keyword.syntax--other.syntax--definition.syntax--ini {
color: #e06c75;
}
.syntax--source.syntax--java .syntax--storage.syntax--modifier.syntax--import {
color: #e5c07b;
}
.syntax--source.syntax--java .syntax--storage.syntax--type {
color: #e5c07b;
}
.syntax--source.syntax--java .syntax--keyword.syntax--operator.syntax--instanceof {
color: #c678dd;
}
.syntax--source.syntax--java-properties .syntax--meta.syntax--key-pair {
color: #e06c75;
}
.syntax--source.syntax--java-properties .syntax--meta.syntax--key-pair > .syntax--punctuation {
color: #abb2bf;
}
.syntax--source.syntax--ts .syntax--keyword.syntax--operator {
color: #56b6c2;
}
.syntax--source.syntax--flow .syntax--keyword.syntax--operator {
color: #56b6c2;
}
.syntax--source.syntax--json .syntax--meta.syntax--structure.syntax--dictionary.syntax--json > .syntax--string.syntax--quoted.syntax--json {
color: #e06c75;
}
.syntax--source.syntax--json .syntax--meta.syntax--structure.syntax--dictionary.syntax--json > .syntax--string.syntax--quoted.syntax--json > .syntax--punctuation.syntax--string {
color: #e06c75;
}
.syntax--source.syntax--json .syntax--meta.syntax--structure.syntax--dictionary.syntax--json > .syntax--value.syntax--json > .syntax--string.syntax--quoted.syntax--json,
.syntax--source.syntax--json .syntax--meta.syntax--structure.syntax--array.syntax--json > .syntax--value.syntax--json > .syntax--string.syntax--quoted.syntax--json,
.syntax--source.syntax--json .syntax--meta.syntax--structure.syntax--dictionary.syntax--json > .syntax--value.syntax--json > .syntax--string.syntax--quoted.syntax--json > .syntax--punctuation,
.syntax--source.syntax--json .syntax--meta.syntax--structure.syntax--array.syntax--json > .syntax--value.syntax--json > .syntax--string.syntax--quoted.syntax--json > .syntax--punctuation {
color: #98c379;
}
.syntax--source.syntax--json .syntax--meta.syntax--structure.syntax--dictionary.syntax--json > .syntax--constant.syntax--language.syntax--json,
.syntax--source.syntax--json .syntax--meta.syntax--structure.syntax--array.syntax--json > .syntax--constant.syntax--language.syntax--json {
color: #56b6c2;
}
.syntax--ng.syntax--interpolation {
color: #e06c75;
}
.syntax--ng.syntax--interpolation.syntax--begin,
.syntax--ng.syntax--interpolation.syntax--end {
color: #61afef;
}
.syntax--ng.syntax--interpolation .syntax--function {
color: #e06c75;
}
.syntax--ng.syntax--interpolation .syntax--function.syntax--begin,
.syntax--ng.syntax--interpolation .syntax--function.syntax--end {
color: #61afef;
}
.syntax--ng.syntax--interpolation .syntax--bool {
color: #d19a66;
}
.syntax--ng.syntax--interpolation .syntax--bracket {
color: #abb2bf;
}
.syntax--ng.syntax--pipe,
.syntax--ng.syntax--operator {
color: #abb2bf;
}
.syntax--ng.syntax--tag {
color: #56b6c2;
}
.syntax--ng.syntax--attribute-with-value .syntax--attribute-name {
color: #e5c07b;
}
.syntax--ng.syntax--attribute-with-value .syntax--string {
color: #c678dd;
}
.syntax--ng.syntax--attribute-with-value .syntax--string.syntax--begin,
.syntax--ng.syntax--attribute-with-value .syntax--string.syntax--end {
color: #abb2bf;
}
.syntax--source.syntax--php .syntax--class.syntax--bracket {
color: #abb2bf;
}
/*
This defines styling rules for syntax classes.
See the naming conventions for a list of syntax classes:
https://flight-manual.atom.io/hacking-atom/sections/syntax-naming-conventions
When styling rules conflict:
- The last rule overrides previous rules.
- The rule with most classes and pseudo-classes overrides the last rule.
*/
.syntax--keyword {
color: #c678dd;
}
.syntax--keyword.syntax--type {
color: #56b6c2;
}
.syntax--keyword.syntax--function {
color: #e06c75;
}
.syntax--keyword.syntax--variable {
color: #e06c75;
}
.syntax--entity {
color: #abb2bf;
}
.syntax--entity.syntax--parameter {
color: #abb2bf;
}
.syntax--entity.syntax--support {
color: #e06c75;
}
.syntax--entity.syntax--decorator:last-child {
color: #61afef;
}
.syntax--entity.syntax--label {
text-decoration: underline;
}
.syntax--entity.syntax--function {
color: #61afef;
}
.syntax--entity.syntax--operator {
color: #61afef;
}
.syntax--entity.syntax--operator.syntax--symbolic {
color: #abb2bf;
}
.syntax--entity.syntax--type {
color: #56b6c2;
}
.syntax--entity.syntax--tag {
color: #e06c75;
}
.syntax--entity.syntax--attribute {
color: #d19a66;
}
.syntax--punctuation {
color: #abb2bf;
}
.syntax--punctuation.syntax--accessor {
color: #abb2bf;
}
.syntax--punctuation.syntax--accessor.syntax--member,
.syntax--punctuation.syntax--accessor.syntax--scope {
color: #c678dd;
}
.syntax--punctuation.syntax--embedded {
color: #c678dd;
}
.syntax--string {
color: #98c379;
}
.syntax--string.syntax--immutable {
color: #98c379;
}
.syntax--string.syntax--part {
color: #56b6c2;
}
.syntax--string.syntax--interpolation {
color: #c678dd;
}
.syntax--string.syntax--regexp {
color: #98c379;
}
.syntax--string.syntax--regexp.syntax--language {
color: #c678dd;
}
.syntax--string.syntax--regexp.syntax--variable {
color: #61afef;
}
.syntax--string.syntax--regexp.syntax--punctuation {
color: #c678dd;
}
.syntax--constant {
color: #d19a66;
}
.syntax--constant.syntax--character {
color: #98c379;
}
.syntax--constant.syntax--character.syntax--escape {
color: #98c379;
}
.syntax--constant.syntax--character.syntax--code {
color: #56b6c2;
}
.syntax--text {
color: #abb2bf;
}
.syntax--markup.syntax--heading {
color: #e06c75;
}
.syntax--markup.syntax--list.syntax--punctuation {
color: #e06c75;
}
.syntax--markup.syntax--quote {
color: #5c6370;
font-style: italic;
}
.syntax--markup.syntax--bold {
color: #d19a66;
font-weight: bold;
}
.syntax--markup.syntax--italic {
color: #c678dd;
font-style: italic;
}
.syntax--markup.syntax--underline {
color: #56b6c2;
text-decoration: underline;
}
.syntax--markup.syntax--strike {
color: #e06c75;
}
.syntax--markup.syntax--raw {
color: #98c379;
}
.syntax--markup.syntax--link {
color: #56b6c2;
}
.syntax--markup.syntax--alt {
color: #61afef;
}
.syntax--markup.syntax--inserted {
color: #98c379;
}
.syntax--markup.syntax--inserted .syntax--punctuation {
color: #98c379;
}
.syntax--markup.syntax--highlighted {
color: #98c379;
}
.syntax--markup.syntax--highlighted .syntax--punctuation {
color: #98c379;
}
.syntax--markup.syntax--deleted {
color: #e06c75;
}
.syntax--markup.syntax--deleted .syntax--punctuation {
color: #e06c75;
}
.syntax--markup.syntax--changed {
color: #c678dd;
}
.syntax--markup.syntax--changed .syntax--punctuation {
color: #c678dd;
}
.syntax--markup.syntax--commented {
color: #5c6370;
}
.syntax--markup.syntax--commented .syntax--punctuation {
color: #5c6370;
}
.syntax--comment {
color: #5c6370;
font-style: italic;
}
.syntax--comment.syntax--caption {
color: #6a7181;
font-weight: bold;
}
.syntax--comment.syntax--term {
color: #707989;
}
.syntax--comment.syntax--punctuation {
color: #5c6370;
font-weight: normal;
}
.syntax--invalid:not(.syntax--punctuation).syntax--illegal {
color: white !important;
background-color: #e05252 !important;
}
.syntax--invalid:not(.syntax--punctuation).syntax--deprecated {
color: #523d14 !important;
background-color: #e0c285 !important;
}
.syntax--source.syntax--css .syntax--entity.syntax--function {
color: #828997;
}
.syntax--source.syntax--css .syntax--entity.syntax--function.syntax--support {
color: #56b6c2;
}
.syntax--source.syntax--css .syntax--entity.syntax--selector {
color: #d19a66;
}
.syntax--source.syntax--css .syntax--entity.syntax--selector.syntax--tag {
color: #e06c75;
}
.syntax--source.syntax--css .syntax--entity.syntax--selector.syntax--id {
color: #61afef;
}
.syntax--source.syntax--css .syntax--entity.syntax--property {
color: #828997;
}
.syntax--source.syntax--css .syntax--entity.syntax--property.syntax--support {
color: #abb2bf;
}
.syntax--source.syntax--css .syntax--entity.syntax--variable {
color: #e06c75;
}
.syntax--source.syntax--css .syntax--constant {
color: #828997;
}
.syntax--source.syntax--css .syntax--constant.syntax--support {
color: #abb2bf;
}
.syntax--source.syntax--css .syntax--constant.syntax--numeric {
color: #d19a66;
}
.syntax--source.syntax--css .syntax--constant.syntax--media {
color: #d19a66;
}
.syntax--source.syntax--css .syntax--constant.syntax--color {
color: #d19a66;
}
.syntax--source.syntax--css .syntax--constant.syntax--offset {
color: #abb2bf;
}
.syntax--source.syntax--css .syntax--constant.syntax--attribute-value {
color: #98c379;
}
.syntax--source.syntax--css .syntax--punctuation.syntax--selector {
color: #d19a66;
}
.syntax--source.syntax--css .syntax--punctuation.syntax--selector.syntax--wildcard {
color: #e06c75;
}
.syntax--source.syntax--css .syntax--punctuation.syntax--selector.syntax--id {
color: #61afef;
}
.syntax--source.syntax--css .syntax--punctuation.syntax--selector.syntax--attribute {
color: #abb2bf;
}
/*
* Your Stylesheet
*
* This stylesheet is loaded when Atom starts up and is reloaded automatically
* when it is changed and saved.
*
* Add your own CSS or Less to fully customize Atom.
* If you are unfamiliar with Less, you can read more about it here:
* http://lesscss.org
*/
/*
* Examples
* (To see them, uncomment and save)
*/
</style>
</head>
<body>
<h1>DPDK笔记</h1>
<h4>名词解释</h4>
<p>(1)NUMA
<a href="https://zhuanlan.zhihu.com/p/62795773">https://zhuanlan.zhihu.com/p/62795773</a></p>
<h5>1.报文处理模式</h5>
<ul>
<li>DPDK 支持 Run to Completion 和 Pipeline 两种报文处理模式,用户可以依据需求灵活选择,或者混合使用。Run to Completion 是一种水平调度方式,利用网卡的多队列,将报文分发给多个 CPU 核处理,每个核均独立处理到达该队列的报文,资源分配相对固定,减少了报文在核间的传递开销,可以随着核的数目灵活扩展处理能力;Pipeline 模式则通过共享环在核间传递数据报文或消息,将系统处理任务分解到不同的 CPU 核上处理,通过任务分发来减少处理等待时延。</li>
</ul>
<h4>2.内存管理–巨页</h4>
<ul>
<li>
<p>处理器的内存管理包含两个概念:物理内存和虚拟内存。Linux操作系统里面整个物理内存按帧(frames)来进行管理,虚拟内存按照页(page)来进行管理。内存管理单元(MMU)完成从虚拟内存地址到物理内存地址的转换。内存管理单元进行地址转换需要的信息保存在一个叫页表(page table)的数据结构里面,页表查找是一种极其耗时的操作。为了减少页表的查找过程,Intel处理器实现了一块缓存来保存查找结果,这块缓存被称为TLB(Translation Lookaside Buffer),它保存了虚拟地址到物理地址的映射关系。所有虚拟地址在转换为物理地址以前,处理器会首先在TLB中查找是否已经存在有效的映射关系,如果没有发现有效的映射,也就是TLS miss,处理器再进行页表的查找。页表的查找过程对性能影响极大,因此需要尽量减少TLB miss的发生。</p>
</li>
<li>
<p>x86处理器硬件在缺省配置下,页的大小是4K,但也可以支持更大的页表尺寸,例如2M或1G的页表。使用了大页表功能后,一个TLB表项可以指向更大的内存区域,这样可以大幅减少TLB miss的发生。早期的Linux并没有利用x86硬件提供的大页表功能,仅在Linux内核2.6.33以后的版本,应用软件才可以使用大页表功能,具体的介绍可以参见Linux的大页表文件系统(hugetlbfs)特性。</p>
</li>
<li>
<p>DPDK则利用大页技术,所有的内存都是从HugePage里分配,实现对内存池(mempool)的管理,并预先分配好同样大小的mbuf,供每一个数据包使用。</p>
</li>
</ul>
<h4>3.报文轮询处理</h4>
<ul>
<li>
<p>传统网卡的报文接收/发送过程中,网卡硬件收到网络报文,或发送完网络报文后,需要发送中断到CPU,通知应用软件有网络报文需要处理。在x86处理器上,一次中断处理需要将处理器的状态寄存器保存到堆栈,并运行中断服务程序,最后再将保存的状态寄存器信息从堆栈中恢复。整个过程需要至少300个处理器时钟周期。对于高性能网络处理应用,频繁的中断处理开销极大降低了网络应用程序的性能。</p>
</li>
<li>
<p>为了减少中断处理开销,DPDK使用了轮询技术来处理网络报文。网卡收到报文后,直接将报文保存到处理器cache中(有DDIO(Direct Data I/O)技术的情况下),或者保存到内存中(没有DDIO技术的情况下),并设置报文到达的标志位。应用软件则周期性地轮询报文到达的标志位,检测是否有新报文需要处理。整个过程中完全没有中断处理过程,因此应用程序的网络报文处理能力得以极大提升。</p>
</li>
</ul>
<h4>4.CPU亲和–绑核处理</h4>
<ul>
<li>
<p>现代操作系统都是基于分时调用方式来实现任务调度,多个进程或线程在多核处理器的
某一个核上不断地交替执行。每次切换过程,都需要将处理器的状态寄存器保存在堆栈中,并恢复当前进程的状态信息,这对系统其实是一种处理开销。将一个线程固定一个核上运行,可以消除切换带来的额外开销。另外将进程或者线程迁移到多核处理器的其它核上进行运行时,处理器缓存中的数据也需要进行清除,导致处理器缓存的利用效果降低。</p>
</li>
<li>
<p>CPU亲和技术,就是将某个进程或者线程绑定到特定的一个或者多个核上执行,而不被迁移到其它核上运行,这样就保证了专用程序的性能。</p>
</li>
<li>
<p>DPDK使用了Linux pthread库,在系统中把相应的线程和CPU进行亲和性绑定, 然后相应的线程尽可能使用独立的资源进行相关的数据处理。</p>
</li>
</ul>
<h4>5.操作系统OS对DPDK的影响</h4>
<ul>
<li>
<p>在10G端口上64Byte报文的线速到达率为14.88Mpps,如果实现零丢包的线速处理,每个报文的平均处理速度应该小于1/14.48Mpps=67us,DPDK应用的网卡收发包队列长度缺省配置为128,网卡队列填充满的时间是128*67=8579us。也就是说,DPDK的业务进程,如果被操作系统中断超过8579us,就会导致网卡收发报的队列被充满,无法接收新的报文,从而导致丢包。而操作系统的中断服务程序、后台服务程序、以及任务调度程序都会导致DPDK的应用程序被打断。</p>
</li>
<li>
<p>在NFV应用场景下,Host机器上和Guest机器上都运行着操作系统,由此带来了两级的操作任务调度。DPDK应用程序(NFV中的VNF)均运行在虚拟机上,操作系统带来的影响会更加明显。
为了实现DPDK应用程序的零丢包,需要对操作系统进行适当的配置,减少操作系统的对DPDK应用程序的干扰。</p>
</li>
<li>
<p>操作系统配置的总体思路是:
将运行DPDK应用运行的处理器核进行隔离,减少干扰;
停用不需要的后台服务程序。将不需要的中断,转移到其它处理器核上处理;
对于不能转移的中断,减少中断的次数。</p>
</li>
</ul>
<h6>操作思路</h6>
<ul>
<li>见svn–基础学习–《中国电信DPDK技术白皮书v1.0》3.2.2</li>
</ul>
</body>
</html>