summaryrefslogtreecommitdiffstats
path: root/doc/book-enea-nfv-access-platform-guide/doc/benchmarks.xml
blob: fa461fab6ac6b21383fc4d9c86fd0a17861844e9 (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
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<chapter id="benchmarks">
  <title>Benchmarks</title>

  <section id="hw-setup">
    <title>Hardware Setup</title>

    <para>The following table describes all the needed prequisites for an apt
    hardware setup:</para>

    <table>
      <title>Hardware Setup</title>

      <tgroup cols="2">
        <colspec align="left" />

        <thead>
          <row>
            <entry align="center">Item</entry>

            <entry align="center">Description</entry>
          </row>
        </thead>

        <tbody>
          <row>
            <entry align="left">Server Platform</entry>

            <entry align="left">Supermicro X10SDV-4C-TLN2F
            http://www.supermicro.com/products/motherboard/xeon/d/X10SDV-4C-TLN2F.cfm</entry>
          </row>

          <row>
            <entry align="left">ARCH</entry>

            <entry>x86-64</entry>
          </row>

          <row>
            <entry align="left">Processor</entry>

            <entry>1 x Intel Xeon D-1521 (Broadwell), 4 cores, 8
            hyper-threaded cores per processor</entry>
          </row>

          <row>
            <entry align="left">CPU freq</entry>

            <entry>2.40 GHz</entry>
          </row>

          <row>
            <entry align="left">RAM</entry>

            <entry>16GB</entry>
          </row>

          <row>
            <entry align="left">Network</entry>

            <entry>Dual integrated 10G ports</entry>
          </row>

          <row>
            <entry align="left">Storage</entry>

            <entry>Samsung 850 Pro 128GB SSD</entry>
          </row>
        </tbody>
      </tgroup>
    </table>

    <para>Generic tests configuration:</para>

    <itemizedlist>
      <listitem>
        <para>All tests use one port, one core and one Rx/TX queue for fast
        path traffic.</para>
      </listitem>
    </itemizedlist>
  </section>

  <section id="bios">
    <title>BIOS Settings</title>

    <para>The table below details the BIOS settings for which the default
    values were changed when doing performance measurements.</para>

    <table>
      <title>BIOS Settings</title>

      <tgroup cols="4">
        <colspec align="left" />

        <thead>
          <row>
            <entry align="center">Menu Path</entry>

            <entry align="center">Setting Name</entry>

            <entry align="center">Enea NFV Access value</entry>

            <entry align="center">BIOS Default value</entry>
          </row>
        </thead>

        <tbody>
          <row>
            <entry align="left">CPU Configuration</entry>

            <entry align="left">Direct Cache Access (DCA)</entry>

            <entry>Enable</entry>

            <entry>Auto</entry>
          </row>

          <row>
            <entry>CPU Configuration / Advanced Power Management
            Configuration</entry>

            <entry align="left">EIST (P-States)</entry>

            <entry>Disable</entry>

            <entry>Enable</entry>
          </row>

          <row>
            <entry>CPU Configuration / Advanced Power Management Configuration
            / CPU C State Control</entry>

            <entry align="left">CPU C State</entry>

            <entry>Disable</entry>

            <entry>Enable</entry>
          </row>

          <row>
            <entry>CPU Configuration / Advanced Power Management Configuration
            / CPU Advanced PM Turning / Energy Perf BIAS</entry>

            <entry align="left">Energy Performance Tuning</entry>

            <entry>Disable</entry>

            <entry>Enable</entry>
          </row>

          <row>
            <entry>CPU Configuration / Advanced Power Management Configuration
            / CPU Advanced PM Turning / Energy Perf BIAS</entry>

            <entry align="left">Energy Performance BIAS Setting</entry>

            <entry>Performance</entry>

            <entry>Balanced Performance</entry>
          </row>

          <row>
            <entry>CPU Configuration / Advanced Power Management Configuration
            / CPU Advanced PM Turning / Energy Perf BIAS</entry>

            <entry align="left">Power/Performance Switch</entry>

            <entry>Disable</entry>

            <entry>Enable</entry>
          </row>

          <row>
            <entry>CPU Configuration / Advanced Power Management Configuration
            / CPU Advanced PM Turning / Program PowerCTL _MSR</entry>

            <entry align="left">Energy Efficient Turbo</entry>

            <entry>Disable</entry>

            <entry>Enable</entry>
          </row>

          <row>
            <entry>Chipset Configuration / North Bridge / IIO
            Configuration</entry>

            <entry align="left">EV DFX Features</entry>

            <entry>Enable</entry>

            <entry>Disable</entry>
          </row>

          <row>
            <entry>Chipset Configuration / North Bridge / Memory
            Configuration</entry>

            <entry align="left">Enforce POR</entry>

            <entry>Disable</entry>

            <entry>Enable</entry>
          </row>

          <row>
            <entry>Chipset Configuration / North Bridge / Memory
            Configuration</entry>

            <entry align="left">Memory Frequency</entry>

            <entry>2400</entry>

            <entry>Auto</entry>
          </row>

          <row>
            <entry>Chipset Configuration / North Bridge / Memory
            Configuration</entry>

            <entry align="left">DRAM RAPL Baseline</entry>

            <entry>Disable</entry>

            <entry>DRAM RAPL Mode 1</entry>
          </row>
        </tbody>
      </tgroup>
    </table>
  </section>

  <section id="use-cases">
    <title>Use Cases</title>

    <section id="docker-benchmarks">
      <title>Docker related benchmarks</title>

      <section>
        <title>Forward traffic in Docker</title>

        <para>Benchmarking traffic forwarding using testpmd in a Docker
        container.</para>

        <para>Pktgen is used to generate UDP traffic that will reach testpmd,
        running in a Docker image. It will then be forwarded back to source on
        the return trip (Forwarding).</para>

        <para>This test measures:</para>

        <itemizedlist>
          <listitem>
            <para>pktgen TX, RX in packets per second (pps) and Mbps</para>
          </listitem>

          <listitem>
            <para>testpmd TX, RX in packets per second (pps)</para>
          </listitem>

          <listitem>
            <para>divide testpmd RX / pktgen TX in pps to obtain throughput in
            percentages (%)</para>
          </listitem>
        </itemizedlist>

        <section id="usecase-one">
          <title>Test Setup for Target 1</title>

          <para>Start by following the steps below:</para>

          <para>SSD boot using the following <literal>grub.cfg</literal>
          entry: <programlisting>linux (hd0,gpt3)/boot/bzImage root=/dev/sda3 ip=dhcp nohz_full=1-7 /
isolcpus=1-7 rcu-nocbs=1-7 rcu_nocb_poll intel_pstate=disable /
clocksource=tsc tsc=reliable nohpet nosoftlockup intel_idle.max_cstate=0 /
processor.max_cstate=0 mce=ignore_ce audit=0 nmi_watchdog=0 iommu=pt /
intel_iommu=on  hugepagesz=1GB hugepages=8 default_hugepagesz=1GB /
hugepagesz=2M hugepages=2048 vfio_iommu_type1.allow_unsafe_interrupts=1</programlisting></para>

          <para>Kill unnecessary services:<programlisting>killall ovsdb-server ovs-vswitchd
rm -rf /etc/openvswitch/*
mkdir -p /var/run/openvswitch</programlisting>Mount hugepages and configure
          DPDK:<programlisting>mkdir -p /mnt/huge
mount -t hugetlbfs nodev /mnt/huge
modprobe igb_uio
dpdk-devbind --bind=igb_uio 0000:03:00.0</programlisting>Run
          pktgen:<programlisting>cd /usr/share/apps/pktgen/
./pktgen -c 0xF -n 1 -- -P -m "[3:2].0"</programlisting>In the pktgen console
          run:<programlisting>str</programlisting>To change framesize for
          pktgen, from [64, 128, 256, 512]:<programlisting>set 0 size &amp;lt;number&amp;gt;</programlisting></para>
        </section>

        <section id="usecase-two">
          <title>Test Setup for Target 2</title>

          <para>Start by following the steps below:</para>

          <para>SSD boot using the following <literal>grub.cfg</literal>
          entry:</para>

          <programlisting>linux (hd0,gpt3)/boot/bzImage root=/dev/sda3 ip=dhcp nohz_full=1-7 /
isolcpus=1-7 rcu-nocbs=1-7 rcu_nocb_poll intel_pstate=disable /
clocksource=tsc tsc=reliable nohpet nosoftlockup intel_idle.max_cstate=0 /
processor.max_cstate=0 mce=ignore_ce audit=0 nmi_watchdog=0 iommu=pt /
intel_iommu=on  hugepagesz=1GB hugepages=8 default_hugepagesz=1GB /
hugepagesz=2M hugepages=2048 vfio_iommu_type1.allow_unsafe_interrupts=1</programlisting>

          <para>It is expected to have Docker/guest image on target. Configure
          the OVS bridge:<programlisting># OVS old config clean-up
killall ovsdb-server ovs-vswitchd
rm -rf /etc/openvswitch/*
mkdir -p /var/run/openvswitch

# Mount hugepages and bind interfaces to dpdk
mkdir -p /mnt/huge
mount -t hugetlbfs nodev /mnt/huge
modprobe igb_uio
dpdk-devbind --bind=igb_uio 0000:03:00.0

# configure openvswitch with DPDK
export DB_SOCK=/var/run/openvswitch/db.sock
ovsdb-tool create /etc/openvswitch/conf.db /
/usr/share/openvswitch/vswitch.ovsschema
ovsdb-server --remote=punix:$DB_SOCK /
--remote=db:Open_vSwitch,Open_vSwitch,manager_options --pidfile --detach
ovs-vsctl --no-wait init
ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-lcore-mask=0x10
ovs-vsctl --no-wait set Open_vSwitch . other_config:pmd-cpu-mask=0xc
ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-socket-mem=2048
ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true
ovs-vswitchd unix:$DB_SOCK --pidfile --detach /
--log-file=/var/log/openvswitch/ovs-vswitchd.log

ovs-vsctl add-br ovsbr0 -- set bridge ovsbr0 datapath_type=netdev
ovs-vsctl add-port ovsbr0 vhost-user1 /
-- set Interface vhost-user1 type=dpdkvhostuser ofport_request=1
ovs-vsctl add-port ovsbr0 dpdk0 -- set Interface /
dpdk0 type=dpdk options:dpdk-devargs=0000:03:00.0 ofport_request=2

# configure static flows
ovs-ofctl del-flows ovsbr0
ovs-ofctl add-flow ovsbr0 in_port=1,action=output:2
ovs-ofctl add-flow ovsbr0 in_port=2,action=output:1</programlisting>Import a
          Docker container:<programlisting>docker import enea-image-virtualization-guest-qemux86-64.tar.gz el7_guest</programlisting>Start
          the Docker container:<programlisting>docker run -it --rm -v /var/run/openvswitch/:/var/run/openvswitch/ /
-v /mnt/huge:/mnt/huge el7_guest /bin/bash</programlisting>Start the testpmd
          application in Docker:<programlisting>testpmd -c 0x30 -n 2 --file-prefix prog1  --socket-mem 512 --no-pci /
--vdev=virtio_user0,path=/var/run/openvswitch/vhost-user1 /
-d /usr/lib/librte_pmd_virtio.so.1.1  -- --burst 64 --disable-hw-vlan /
--disable-rss  -i --portmask=0x1 --coremask=0x20  --nb-cores=1 /
--rxq=1 --txq=1 --txd=512 --rxd=512 --txqflags=0xf00 --port-topology=chained</programlisting>To
          start traffic <emphasis role="bold">forwarding</emphasis>, run the
          following command in testpmd CLI:<programlisting>start</programlisting>To
          start traffic but in <emphasis role="bold">termination</emphasis>
          mode (no traffic sent on TX), run following command in testpmd
          CLI:<programlisting>set fwd rxonly
start</programlisting><table>
              <title>Results in forwarding mode</title>

              <tgroup cols="8">
                <tbody>
                  <row>
                    <entry align="center"><emphasis
                    role="bold">Bytes</emphasis></entry>

                    <entry align="center"><emphasis role="bold">pktgen pps
                    TX</emphasis></entry>

                    <entry align="center"><emphasis role="bold">pktgen MBits/s
                    TX</emphasis></entry>

                    <entry align="center"><emphasis role="bold">pktgen pps
                    RX</emphasis></entry>

                    <entry align="center"><emphasis role="bold">pktgen MBits/s
                    RX</emphasis></entry>

                    <entry align="center"><emphasis role="bold">testpmd pps
                    RX</emphasis></entry>

                    <entry align="center"><emphasis role="bold">testpmd pps
                    TX</emphasis></entry>

                    <entry align="center"><emphasis role="bold">throughput
                    (%)</emphasis></entry>
                  </row>

                  <row>
                    <entry role="bold"><emphasis
                    role="bold">64</emphasis></entry>

                    <entry>14890993</entry>

                    <entry>10006</entry>

                    <entry>7706039</entry>

                    <entry>5178</entry>

                    <entry>7692807</entry>

                    <entry>7692864</entry>

                    <entry>51.74%</entry>
                  </row>

                  <row>
                    <entry><emphasis role="bold">128</emphasis></entry>

                    <entry>8435104</entry>

                    <entry>9999</entry>

                    <entry>7689458</entry>

                    <entry>9060</entry>

                    <entry>7684962</entry>

                    <entry>7684904</entry>

                    <entry>90.6%</entry>
                  </row>

                  <row>
                    <entry role="bold"><emphasis
                    role="bold">256</emphasis></entry>

                    <entry>4532384</entry>

                    <entry>9999</entry>

                    <entry>4532386</entry>

                    <entry>9998</entry>

                    <entry>4532403</entry>

                    <entry>4532403</entry>

                    <entry>99.9%</entry>
                  </row>
                </tbody>
              </tgroup>
            </table><table>
              <title>Results in termination mode</title>

              <tgroup cols="4">
                <tbody>
                  <row>
                    <entry align="center"><emphasis
                    role="bold">Bytes</emphasis></entry>

                    <entry align="center"><emphasis role="bold">pktgen pps
                    TX</emphasis></entry>

                    <entry align="center"><emphasis role="bold">testpmd pps
                    RX</emphasis></entry>

                    <entry align="center"><emphasis role="bold">throughput
                    (%)</emphasis></entry>
                  </row>

                  <row>
                    <entry role="bold"><emphasis
                    role="bold">64</emphasis></entry>

                    <entry>14890993</entry>

                    <entry>7330403</entry>

                    <entry>49,2%</entry>
                  </row>

                  <row>
                    <entry><emphasis role="bold">128</emphasis></entry>

                    <entry>8435104</entry>

                    <entry>7330379</entry>

                    <entry>86,9%</entry>
                  </row>

                  <row>
                    <entry role="bold"><emphasis
                    role="bold">256</emphasis></entry>

                    <entry>4532484</entry>

                    <entry>4532407</entry>

                    <entry>99,9%</entry>
                  </row>
                </tbody>
              </tgroup>
            </table></para>
        </section>
      </section>

      <section id="usecase-three-four">
        <title>Forward traffic from Docker to another Docker on the same
        host</title>

        <para>Benchmark a combo test using testpmd running in two Docker
        instances, one which Forwards traffic to the second one, which
        Terminates it.</para>

        <para>Packets are generated with pktgen and TX-d to the first testpmd,
        which will RX and Forward them to the second testpmd, which will RX
        and terminate them.</para>

        <para>Measurements are made in:</para>

        <itemizedlist>
          <listitem>
            <para>pktgen TX in pps and Mbits/s</para>
          </listitem>

          <listitem>
            <para>testpmd TX and RX pps in Docker1</para>
          </listitem>

          <listitem>
            <para>testpmd RX pps in Docker2</para>
          </listitem>
        </itemizedlist>

        <para>Throughput found as a percent, by dividing Docker2 <emphasis
        role="bold">testpmd RX pps</emphasis> by <emphasis role="bold">pktgen
        TX pps</emphasis>.</para>

        <section id="target-one-usecase-three">
          <title>Test Setup for Target 1</title>

          <para>Start by following the steps below:</para>

          <para>SSD boot using the following <literal>grub.cfg</literal>
          entry:</para>

          <programlisting>linux (hd0,gpt3)/boot/bzImage root=/dev/sda3 ip=dhcp nohz_full=1-7 /
isolcpus=1-7 rcu-nocbs=1-7 rcu_nocb_poll intel_pstate=disable /
clocksource=tsc tsc=reliable nohpet nosoftlockup intel_idle.max_cstate=0 /
processor.max_cstate=0 mce=ignore_ce audit=0 nmi_watchdog=0 iommu=pt /
intel_iommu=on  hugepagesz=1GB hugepages=8 default_hugepagesz=1GB /
hugepagesz=2M hugepages=2048 vfio_iommu_type1.allow_unsafe_interrupts=1</programlisting>

          <para>Configure DPDK:<programlisting>mkdir -p /mnt/huge
mount -t hugetlbfs nodev /mnt/huge
modprobe igb_uio
dpdk-devbind --bind=igb_uio 0000:03:00.0</programlisting>Run
          pktgen:<programlisting>cd /usr/share/apps/pktgen/
./pktgen -c 0xF -n 1 -- -P -m "[3:2].0"</programlisting>Choose one of the
          values from [64, 128, 256, 512] to change the packet
          size:<programlisting>set 0 size &lt;number&gt;</programlisting></para>
        </section>

        <section id="target-two-usecase-four">
          <title>Test Setup for Target 2</title>

          <para>Start by following the steps below:</para>

          <para>SSD boot using the following <literal>grub.cfg</literal>
          entry:</para>

          <programlisting>linux (hd0,gpt3)/boot/bzImage root=/dev/sda3 ip=dhcp nohz_full=1-7 /
isolcpus=1-7 rcu-nocbs=1-7 rcu_nocb_poll intel_pstate=disable /
clocksource=tsc tsc=reliable nohpet nosoftlockup intel_idle.max_cstate=0 /
processor.max_cstate=0 mce=ignore_ce audit=0 nmi_watchdog=0 /
iommu=pt intel_iommu=on  hugepagesz=1GB hugepages=8 default_hugepagesz=1GB /
hugepagesz=2M hugepages=2048 vfio_iommu_type1.allow_unsafe_interrupts=1</programlisting>

          <para><programlisting>killall ovsdb-server ovs-vswitchd
rm -rf /etc/openvswitch/*
mkdir -p /var/run/openvswitch</programlisting>Configure DPDK:<programlisting>mkdir -p /mnt/huge
mount -t hugetlbfs nodev /mnt/huge
modprobe igb_uio
dpdk-devbind --bind=igb_uio 0000:03:00.0</programlisting>Configure the OVS
          bridge:<programlisting>export DB_SOCK=/var/run/openvswitch/db.sock
ovsdb-tool create /etc/openvswitch/conf.db /
/usr/share/openvswitch/vswitch.ovsschema
ovsdb-server --remote=punix:$DB_SOCK /
--remote=db:Open_vSwitch,Open_vSwitch,manager_options --pidfile --detach
ovs-vsctl --no-wait init
ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-lcore-mask=0x10
ovs-vsctl --no-wait set Open_vSwitch . other_config:pmd-cpu-mask=0xcc
ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-socket-mem=2048
ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true
ovs-vswitchd unix:$DB_SOCK --pidfile --detach /
--log-file=/var/log/openvswitch/ovs-vswitchd.log
ovs-vsctl add-br ovsbr0 -- set bridge ovsbr0 datapath_type=netdev
ovs-vsctl add-port ovsbr0 vhost-user1 -- set Interface /
vhost-user1 type=dpdkvhostuser ofport_request=1
ovs-vsctl add-port ovsbr0 vhost-user2 -- set Interface /
vhost-user2 type=dpdkvhostuser ofport_request=2
ovs-vsctl add-port ovsbr0 dpdk0 -- set Interface dpdk0 /
type=dpdk options:dpdk-devargs=0000:03:00.0 ofport_request=3
ovs-ofctl del-flows ovsbr0
ovs-ofctl add-flow ovsbr0 in_port=3,action=output:2
ovs-ofctl add-flow ovsbr0 in_port=2,action=output:1</programlisting>Import a
          Docker container:<programlisting>docker import enea-image-virtualization-guest-qemux86-64.tar.gz el7_guest</programlisting>Start
          the first Docker:<programlisting>docker run -it --rm --cpuset-cpus=4,5 /
-v /var/run/openvswitch/:/var/run/openvswitch/ /
-v /mnt/huge:/mnt/huge el7_guest /bin/bash</programlisting>Start the testpmd
          application in Docker1:<programlisting>testpmd -c 0x30 -n 2 --file-prefix prog1  --socket-mem 512 --no-pci /
--vdev=virtio_user0,path=/var/run/openvswitch/vhost-user1 /
-d /usr/lib/librte_pmd_virtio.so.1.1 -- --burst 64 --disable-hw-vlan /
--disable-rss  -i --portmask=0x1 --coremask=0x20  --nb-cores=1 /
--rxq=1 --txq=1 --txd=512 --rxd=512 --txqflags=0xf00 --port-topology=chained</programlisting>Configure
          it in termination mode:<programlisting>set fwd rxonly</programlisting>Run
          the testpmd application:<programlisting>start</programlisting>Open a
          new console to the host and start the second Docker
          instance:<programlisting>docker run -it --rm --cpuset-cpus=0,1 -v /var/run/openvswitch/:/var/run/openvswitch/ /
-v /mnt/huge:/mnt/huge el7_guest /bin/bash</programlisting>In the second
          container start testpmd:<programlisting>testpmd -c 0x0F --file-prefix prog2 --socket-mem 512 --no-pci /
--vdev=virtio_user0,path=/var/run/openvswitch/vhost-user2 /
-d /usr/lib/librte_pmd_virtio.so.1.1 -- -i --disable-hw-vlan</programlisting>Run
          the TestPmd application in the second Docker:<programlisting>testpmd -c 0x3 -n 2 --file-prefix prog2  --socket-mem 512 --no-pci /
--vdev=virtio_user0,path=/var/run/openvswitch/vhost-user2 /
-d /usr/lib/librte_pmd_virtio.so.1.1 -- --burst 64 --disable-hw-vlan /
--disable-rss  -i --portmask=0x1 --coremask=0x2  --nb-cores=1 --rxq=1 /
--txq=1 --txd=512 --rxd=512 --txqflags=0xf00 --port-topology=chained</programlisting>In
          the testpmd shell, run:<programlisting>start</programlisting>Start
          pktgen traffic by running the following command in pktgen
          CLI:<programlisting>start 0</programlisting>To record traffic
          results:<programlisting>show port stats 0</programlisting>This
          should be used in testpmd applications.</para>

          <table>
            <title>Results</title>

            <tgroup cols="5">
              <tbody>
                <row>
                  <entry align="center"><emphasis
                  role="bold">Bytes</emphasis></entry>

                  <entry align="center"><emphasis role="bold">Target 1 -
                  pktgen pps TX</emphasis></entry>

                  <entry align="center"><emphasis role="bold">Target 2 -
                  (forwarding) testpmd pps RX</emphasis></entry>

                  <entry align="center"><emphasis role="bold">Target 2 -
                  (forwarding) testpmd pps TX</emphasis></entry>

                  <entry align="center"><emphasis role="bold">Target 2 -
                  (termination) testpmd pps RX</emphasis></entry>
                </row>

                <row>
                  <entry role="bold"><emphasis
                  role="bold">64</emphasis></entry>

                  <entry>14844628</entry>

                  <entry>5643565</entry>

                  <entry>3459922</entry>

                  <entry>3457326</entry>
                </row>

                <row>
                  <entry><emphasis role="bold">128</emphasis></entry>

                  <entry>8496962</entry>

                  <entry>5667860</entry>

                  <entry>3436811</entry>

                  <entry>3438918</entry>
                </row>

                <row>
                  <entry role="bold"><emphasis
                  role="bold">256</emphasis></entry>

                  <entry>4532372</entry>

                  <entry>4532362</entry>

                  <entry>3456623</entry>

                  <entry>3457115</entry>
                </row>

                <row>
                  <entry><emphasis role="bold">512</emphasis></entry>

                  <entry>2367641</entry>

                  <entry>2349450</entry>

                  <entry>2349450</entry>

                  <entry>2349446</entry>
                </row>
              </tbody>
            </tgroup>
          </table>
        </section>
      </section>
    </section>

    <section id="vm-benchmarks">
      <title>VM related benchmarks</title>

      <section id="usecase-four">
        <title>Forward/termination traffic in one VM</title>

        <para>Benchmarking traffic (UDP) forwarding and termination using
        testpmd in a virtual machine.</para>

        <para>The Pktgen application is used to generate traffic that will
        reach testpmd running on a virtual machine, and be forwarded back to
        source on the return trip. With the same setup a second measurement
        will be done with traffic termination in the virtual machine.</para>

        <para>This test case measures:</para>

        <itemizedlist>
          <listitem>
            <para>pktgen TX, RX in packets per second (pps) and Mbps</para>
          </listitem>

          <listitem>
            <para>testpmd TX, RX in packets per second (pps)</para>
          </listitem>

          <listitem>
            <para>divide <emphasis role="bold">testpmd RX</emphasis> by
            <emphasis role="bold">pktgen TX</emphasis> in pps to obtain the
            throughput in percentages (%)</para>
          </listitem>
        </itemizedlist>

        <section id="targetone-usecasefour">
          <title>Test Setup for Target 1</title>

          <para>Start with the steps below:</para>

          <para>SSD boot using the following <literal>grub.cfg
          </literal>entry: <programlisting>linux (hd0,gpt3)/boot/bzImage root=/dev/sda3 ip=dhcp nohz_full=1-7 /
isolcpus=1-7 rcu-nocbs=1-7 rcu_nocb_poll intel_pstate=disable /
clocksource=tsc tsc=reliable nohpet nosoftlockup intel_idle.max_cstate=0 /
processor.max_cstate=0 mce=ignore_ce audit=0 nmi_watchdog=0 iommu=pt /
intel_iommu=on hugepagesz=1GB hugepages=8 default_hugepagesz=1GB /
hugepagesz=2M hugepages=2048 vfio_iommu_type1.allow_unsafe_interrupts=1</programlisting></para>

          <para>Kill unnecessary services: <programlisting>killall ovsdb-server ovs-vswitchd
rm -rf /etc/openvswitch/*
mkdir -p /var/run/openvswitch</programlisting>Configure DPDK:<programlisting>mkdir -p /mnt/huge
mount -t hugetlbfs nodev /mnt/huge
modprobe igb_uio
dpdk-devbind --bind=igb_uio 0000:03:00.0</programlisting>Run
          pktgen:<programlisting>cd /usr/share/apps/pktgen/
./pktgen -c 0x7 -n 4 --proc-type auto --socket-mem 256 /
-w 0000:03:00.0 -- -P -m "[1:2].0"</programlisting>Set pktgen frame size to
          use from [64, 128, 256, 512]:<programlisting>set 0 size 64</programlisting></para>
        </section>

        <section id="targettwo-usecasefive">
          <title>Test Setup for Target 2</title>

          <para>Start by following the steps below:</para>

          <para>SSD boot using the following <literal>grub.cfg</literal>
          entry: <programlisting>linux (hd0,gpt3)/boot/bzImage root=/dev/sda3 ip=dhcp nohz_full=1-7 /
isolcpus=1-7 rcu-nocbs=1-7 rcu_nocb_poll intel_pstate=disable /
clocksource=tsc tsc=reliable nohpet nosoftlockup intel_idle.max_cstate=0 /
processor.max_cstate=0 mce=ignore_ce audit=0 nmi_watchdog=0 iommu=pt /
intel_iommu=on  hugepagesz=1GB hugepages=8 default_hugepagesz=1GB /
hugepagesz=2M hugepages=2048 vfio_iommu_type1.allow_unsafe_interrupts=1</programlisting>Kill
          unnecessary services: <programlisting>killall ovsdb-server ovs-vswitchd
rm -rf /etc/openvswitch/*
mkdir -p /var/run/openvswitch</programlisting>Configure DPDK:<programlisting>mkdir -p /mnt/huge
mount -t hugetlbfs nodev /mnt/huge
modprobe igb_uio
dpdk-devbind --bind=igb_uio 0000:03:00.0</programlisting>Configure
          OVS:<programlisting>export DB_SOCK=/var/run/openvswitch/db.sock
ovsdb-tool create /etc/openvswitch/conf.db /
/usr/share/openvswitch/vswitch.ovsschema
ovsdb-server --remote=punix:$DB_SOCK /
--remote=db:Open_vSwitch,Open_vSwitch,manager_options --pidfile --detach
ovs-vsctl --no-wait init
ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-lcore-mask=0x10
ovs-vsctl --no-wait set Open_vSwitch . other_config:pmd-cpu-mask=0xc
ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-socket-mem=2048
ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true
ovs-vswitchd unix:$DB_SOCK --pidfile --detach /
--log-file=/var/log/openvswitch/ovs-vswitchd.log

ovs-vsctl add-br ovsbr0 -- set bridge ovsbr0 datapath_type=netdev
ovs-vsctl add-port ovsbr0 vhost-user1 /
-- set Interface vhost-user1 type=dpdkvhostuser -- set Interface /
vhost-user1 ofport_request=2
ovs-vsctl add-port ovsbr0 dpdk0 -- set Interface dpdk0 /
type=dpdk options:dpdk-devargs=0000:03:00.0 /
-- set Interface dpdk0 ofport_request=1
chmod 777 /var/run/openvswitch/vhost-user1

ovs-ofctl del-flows ovsbr0
ovs-ofctl add-flow ovsbr0 in_port=1,action=output:2
ovs-ofctl add-flow ovsbr0 in_port=2,action=output:1</programlisting>Launch
          QEMU:<programlisting>taskset -c 0,1 qemu-system-x86_64 -cpu host,+invtsc,migratable=no /
-M q35 -smp cores=2,sockets=1 -vcpu 0,affinity=0 -vcpu 1,affinity=1 /
-enable-kvm -nographic -realtime mlock=on -kernel /mnt/qemu/bzImage /
-drive file=/mnt/qemu/enea-image-virtualization-guest-qemux86-64.ext4,/
if=virtio,format=raw -m 4096 -object memory-backend-file,id=mem,/
size=4096M,mem-path=/mnt/huge,share=on -numa node,memdev=mem /
-mem-prealloc -chardev socket,id=char0,path=/var/run/openvswitch/vhost-user1 /
-netdev type=vhost-user,id=mynet1,chardev=char0,vhostforce /
-device virtio-net-pci,mac=52:54:00:00:00:01,netdev=mynet1,/
mrg_rxbuf=on,rx_queue_size=1024,csum=off,gso=off,guest_tso4=off,/
guest_tso6=off,guest_ecn=off -append 'root=/dev/vda console=ttyS0 /
hugepagesz=2M hugepages=1024 isolcpus=1 nohz_full=1 rcu_nocbs=1 /
irqaffinity=0 rcu_nocb_poll intel_pstate=disable intel_idle.max_cstate=0 /
processor.max_cstate=0 mce=ignore_ce audit=0'</programlisting>Inside QEMU,
          configure DPDK: <programlisting>mkdir -p /mnt/huge
mount -t hugetlbfs nodev /mnt/huge
modprobe igb_uio
dpdk-devbind --bind=igb_uio 0000:00:02.0</programlisting>Inside QEMU, run
          testpmd: <programlisting>testpmd -c 0x3 -n 2 -d librte_pmd_virtio.so.1.1  /
-- --burst 64 --disable-hw-vlan --disable-rss  -i --portmask=0x1 /
--coremask=0x2  --nb-cores=1 --rxq=1 --txq=1 --txd=512 --rxd=512 /
--txqflags=0xf00 --port-topology=chained</programlisting>For the <emphasis
          role="bold">Forwarding test</emphasis>, start testpmd
          directly:<programlisting>start</programlisting>For the <emphasis
          role="bold">Termination test</emphasis>, set testpmd to only
          receive, then start it:<programlisting>set fwd rxonly
start</programlisting>On target 1, you may start pktgen traffic
          now:<programlisting>start 0</programlisting>On target 2, use this
          command to refresh the testpmd display and note the highest
          values:<programlisting>show port stats 0</programlisting>To stop
          traffic from pktgen, in order to choose a different frame
          size:<programlisting>stop 0</programlisting>To clear numbers in
          testpmd:<programlisting>clear port stats
show port stats 0</programlisting><table>
              <title>Results in forwarding mode</title>

              <tgroup cols="8">
                <tbody>
                  <row>
                    <entry align="center"><emphasis
                    role="bold">Bytes</emphasis></entry>

                    <entry align="center"><emphasis role="bold">pktgen pps
                    RX</emphasis></entry>

                    <entry align="center"><emphasis role="bold">pktgen pps
                    TX</emphasis></entry>

                    <entry align="center"><emphasis role="bold">testpmd pps
                    RX</emphasis></entry>

                    <entry align="center"><emphasis role="bold">testpmd pps
                    TX</emphasis></entry>

                    <entry align="center"><emphasis role="bold">pktgen MBits/s
                    RX</emphasis></entry>

                    <entry align="center"><emphasis role="bold">pktgen MBits/s
                    TX</emphasis></entry>

                    <entry align="center"><emphasis role="bold">throughput
                    (%)</emphasis></entry>
                  </row>

                  <row>
                    <entry role="bold"><emphasis
                    role="bold">64</emphasis></entry>

                    <entry>7755769</entry>

                    <entry>14858714</entry>

                    <entry>7755447</entry>

                    <entry>7755447</entry>

                    <entry>5207</entry>

                    <entry>9984</entry>

                    <entry>52.2</entry>
                  </row>

                  <row>
                    <entry><emphasis role="bold">128</emphasis></entry>

                    <entry>7714626</entry>

                    <entry>8435184</entry>

                    <entry>7520349</entry>

                    <entry>6932520</entry>

                    <entry>8204</entry>

                    <entry>9986</entry>

                    <entry>82.1</entry>
                  </row>

                  <row>
                    <entry role="bold"><emphasis
                    role="bold">256</emphasis></entry>

                    <entry>4528847</entry>

                    <entry>4528854</entry>

                    <entry>4529030</entry>

                    <entry>4529034</entry>

                    <entry>9999</entry>

                    <entry>9999</entry>

                    <entry>99.9</entry>
                  </row>
                </tbody>
              </tgroup>
            </table><table>
              <title>Results in termination mode</title>

              <tgroup cols="5">
                <tbody>
                  <row>
                    <entry align="center"><emphasis
                    role="bold">Bytes</emphasis></entry>

                    <entry align="center"><emphasis role="bold">pktgen pps
                    TX</emphasis></entry>

                    <entry align="center"><emphasis role="bold">testpmd pps
                    RX</emphasis></entry>

                    <entry align="center"><emphasis role="bold">pktgen MBits/s
                    TX</emphasis></entry>

                    <entry align="center"><emphasis role="bold">throughput
                    (%)</emphasis></entry>
                  </row>

                  <row>
                    <entry role="bold"><emphasis
                    role="bold">64</emphasis></entry>

                    <entry>15138992</entry>

                    <entry>7290663</entry>

                    <entry>10063</entry>

                    <entry>48.2</entry>
                  </row>

                  <row>
                    <entry><emphasis role="bold">128</emphasis></entry>

                    <entry>8426825</entry>

                    <entry>6902646</entry>

                    <entry>9977</entry>

                    <entry>81.9</entry>
                  </row>

                  <row>
                    <entry role="bold"><emphasis
                    role="bold">256</emphasis></entry>

                    <entry>4528957</entry>

                    <entry>4528912</entry>

                    <entry>9999</entry>

                    <entry>100</entry>
                  </row>
                </tbody>
              </tgroup>
            </table></para>
        </section>
      </section>

      <section id="usecase-six">
        <title>Forward traffic between two VMs</title>

        <para>Benchmark a combo test using two virtual machines, the first
        with traffic forwarding to the second, which terminates it.</para>

        <para>Measurements are made in:</para>

        <itemizedlist>
          <listitem>
            <para>pktgen TX in pps and Mbits/s</para>
          </listitem>

          <listitem>
            <para>testpmd TX and RX pps in VM1</para>
          </listitem>

          <listitem>
            <para>testpmd RX pps in VM2</para>
          </listitem>

          <listitem>
            <para>throughput in percents, by dividing<emphasis role="bold">
            VM2 testpmd RX pps</emphasis> by <emphasis role="bold">pktgen TX
            pps</emphasis></para>
          </listitem>
        </itemizedlist>

        <section id="targetone-usecase-five">
          <title>Test Setup for Target 1</title>

          <para>Start by doing the following:</para>

          <para>SSD boot using the following <literal>grub.cfg</literal>
          entry: <programlisting>linux (hd0,gpt3)/boot/bzImage root=/dev/sda3 ip=dhcp nohz_full=1-7 /
isolcpus=1-7 rcu-nocbs=1-7 rcu_nocb_poll intel_pstate=disable /
clocksource=tsc tsc=reliable nohpet nosoftlockup intel_idle.max_cstate=0 /
processor.max_cstate=0 mce=ignore_ce audit=0 nmi_watchdog=0 iommu=pt /
intel_iommu=on  hugepagesz=1GB hugepages=8 default_hugepagesz=1GB /
hugepagesz=2M hugepages=2048 vfio_iommu_type1.allow_unsafe_interrupts=1</programlisting>Kill
          Services:<programlisting>killall ovsdb-server ovs-vswitchd
rm -rf /etc/openvswitch/*
mkdir -p /var/run/openvswitch</programlisting>Configure DPDK:<programlisting>mkdir -p /mnt/huge
mount -t hugetlbfs nodev /mnt/huge
modprobe igb_uio
dpdk-devbind --bind=igb_uio 0000:03:00.0</programlisting>Run
          pktgen:<programlisting>cd /usr/share/apps/pktgen/
./pktgen -c 0x7 -n 4 --proc-type auto --socket-mem 256 /
-w 0000:03:00.0 -- -P -m "[1:2].0"</programlisting>Set pktgen frame size to
          use from [64, 128, 256, 512]:<programlisting>set 0 size 64</programlisting></para>
        </section>

        <section id="targettwo-usecase-six">
          <title>Test Setup for Target 2</title>

          <para>Start by doing the following:</para>

          <para>SSD boot using the following <literal>grub.cfg</literal>
          entry: <programlisting>linux (hd0,gpt3)/boot/bzImage root=/dev/sda3 ip=dhcp nohz_full=1-7 /
isolcpus=1-7 rcu-nocbs=1-7 rcu_nocb_poll intel_pstate=disable /
clocksource=tsc tsc=reliable nohpet nosoftlockup intel_idle.max_cstate=0 /
processor.max_cstate=0 mce=ignore_ce audit=0 nmi_watchdog=0 iommu=pt /
intel_iommu=on  hugepagesz=1GB hugepages=8 default_hugepagesz=1GB /
hugepagesz=2M hugepages=2048 vfio_iommu_type1.allow_unsafe_interrupts=1</programlisting>Kill
          Services:<programlisting>killall ovsdb-server ovs-vswitchd
rm -rf /etc/openvswitch/*
mkdir -p /var/run/openvswitch</programlisting>Configure DPDK:<programlisting>mkdir -p /mnt/huge
mount -t hugetlbfs nodev /mnt/huge
modprobe igb_uio
dpdk-devbind --bind=igb_uio 0000:03:00.0</programlisting>Configure
          OVS:<programlisting>export DB_SOCK=/var/run/openvswitch/db.sock
ovsdb-tool create /etc/openvswitch/conf.db /
/usr/share/openvswitch/vswitch.ovsschema
ovsdb-server --remote=punix:$DB_SOCK /
--remote=db:Open_vSwitch,Open_vSwitch,manager_options --pidfile --detach
ovs-vsctl --no-wait init
ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-lcore-mask=0x10
ovs-vsctl --no-wait set Open_vSwitch . other_config:pmd-cpu-mask=0xc
ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-socket-mem=2048
ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true
ovs-vswitchd unix:$DB_SOCK --pidfile /
--detach --log-file=/var/log/openvswitch/ovs-vswitchd.log


ovs-vsctl add-br ovsbr0 -- set bridge ovsbr0 datapath_type=netdev
ovs-vsctl add-port ovsbr0 dpdk0 /
-- set Interface dpdk0 type=dpdk options:dpdk-devargs=0000:03:00.0 ofport_request=1
ovs-vsctl add-port ovsbr0 vhost-user1 /
-- set Interface vhost-user1 type=dpdkvhostuser ofport_request=2
ovs-vsctl add-port ovsbr0 vhost-user2 /
-- set Interface vhost-user2 type=dpdkvhostuser ofport_request=3


ovs-ofctl del-flows ovsbr0
ovs-ofctl add-flow ovsbr0 in_port=1,action=output:2
ovs-ofctl add-flow ovsbr0 in_port=2,action=output:3</programlisting>Launch
          first QEMU instance, VM1:<programlisting>taskset -c 0,1 qemu-system-x86_64 -cpu host,+invtsc,migratable=no -M q35 /
-smp cores=2,sockets=1 -vcpu 0,affinity=0 -vcpu 1,affinity=1 -enable-kvm /
-nographic -realtime mlock=on -kernel /home/root/qemu/bzImage /
-drive file=/home/root/qemu/enea-image-virtualization-guest-qemux86-64.ext4,/
if=virtio,format=raw -m 2048 -object memory-backend-file,id=mem,/
size=2048M,mem-path=/mnt/huge,share=on -numa node,memdev=mem /
-mem-prealloc -chardev socket,id=char0,path=/var/run/openvswitch/vhost-user1 /
-netdev type=vhost-user,id=mynet1,chardev=char0,vhostforce /
-device virtio-net-pci,mac=52:54:00:00:00:01,netdev=mynet1,/
mrg_rxbuf=on,rx_queue_size=1024,csum=off,gso=off,guest_tso4=off,/
guest_tso6=off,guest_ecn=off -append 'root=/dev/vda console=ttyS0 /
hugepagesz=2M hugepages=512 isolcpus=1 nohz_full=1 rcu_nocbs=1 /
irqaffinity=0 rcu_nocb_poll intel_pstate=disable intel_idle.max_cstate=0 /
processor.max_cstate=0 mce=ignore_ce audit=0'</programlisting>Connect to
          Target 2 through a new SSH session and run a second QEMU instance
          (to get its own console, separate from instance VM1). We shall call
          this VM2:<programlisting>taskset -c 4,5 qemu-system-x86_64 -cpu host,+invtsc,migratable=no /
-M q35 -smp cores=2,sockets=1 -vcpu 0,affinity=4 -vcpu 1,affinity=5 /
-enable-kvm -nographic -realtime mlock=on -kernel /home/root/qemu2/bzImage /
-drive file=/home/root/qemu2/enea-image-virtualization-guest-qemux86-64.ext4,/
if=virtio,format=raw -m 2048 -object memory-backend-file,id=mem,size=2048M,/
mem-path=/mnt/huge,share=on -numa node,memdev=mem -mem-prealloc /
-chardev socket,id=char1,path=/var/run/openvswitch/vhost-user2 /
-netdev type=vhost-user,id=mynet1,chardev=char1,vhostforce /
-device virtio-net-pci,mac=52:54:00:00:00:02,netdev=mynet1,/
mrg_rxbuf=on,rx_queue_size=1024,csum=off,gso=off,guest_tso4=off,/
guest_tso6=off,guest_ecn=off -append 'root=/dev/vda console=ttyS0 /
hugepagesz=2M hugepages=512 isolcpus=1 nohz_full=1 rcu_nocbs=1 /
irqaffinity=0 rcu_nocb_poll intel_pstate=disable intel_idle.max_cstate=0 /
processor.max_cstate=0 mce=ignore_ce audit=0'</programlisting>Configure DPDK
          inside VM1:<programlisting>mkdir -p /mnt/huge
mount -t hugetlbfs nodev /mnt/huge
modprobe igb_uio
dpdk-devbind --bind=igb_uio 0000:00:02.0</programlisting>Run testpmd inside
          VM1:<programlisting>testpmd -c 0x3 -n 2 -d librte_pmd_virtio.so.1.1  /
-- --burst 64 --disable-hw-vlan --disable-rss  -i /
--portmask=0x1 --coremask=0x2  --nb-cores=1 --rxq=1 /
--txq=1 --txd=512 --rxd=512 --txqflags=0xf00 --port-topology=chained</programlisting>Start
          testpmd inside VM1:<programlisting>start</programlisting>Configure
          DPDK inside VM2:<programlisting>mkdir -p /mnt/huge
mount -t hugetlbfs nodev /mnt/huge
modprobe igb_uio
dpdk-devbind --bind=igb_uio 0000:00:02.0</programlisting>Run testpmd inside
          VM2:<programlisting>testpmd -c 0x3 -n 2 -d librte_pmd_virtio.so.1.1  /
-- --burst 64 --disable-hw-vlan --disable-rss -i --portmask=0x1 /
--coremask=0x2  --nb-cores=1 --rxq=1 --txq=1 --txd=512 /
--rxd=512 --txqflags=0xf00 --port-topology=chained</programlisting>Set VM2 for
          termination and start testpmd:<programlisting>set fwd rxonly
start</programlisting>On target 1, start pktgen traffic:<programlisting>start 0</programlisting>Use
          this command to refresh testpmd display in VM1 and VM2 and note the
          highest values:<programlisting>show port stats 0</programlisting>To
          stop traffic from pktgen, in order to choose a different frame
          size:<programlisting>stop 0</programlisting>To clear numbers in
          testpmd:<programlisting>clear port stats
show port stats 0</programlisting>For VM1, we record the stats relevant for
          <emphasis role="bold">forwarding</emphasis>:</para>

          <itemizedlist>
            <listitem>
              <para>RX, TX in pps</para>
            </listitem>
          </itemizedlist>

          <para>Only Rx-pps and Tx-pps numbers are important here, they change
          every time stats are displayed as long as there is traffic. Run the
          command a few times and pick the best (maximum) values seen.</para>

          <para>For VM2, we record the stats relevant for <emphasis
          role="bold">termination</emphasis>:</para>

          <itemizedlist>
            <listitem>
              <para>RX in pps (TX will be 0)</para>
            </listitem>
          </itemizedlist>

          <para>For pktgen, we record only the TX side, because flow is
          terminated, with no RX traffic reaching pktgen:</para>

          <itemizedlist>
            <listitem>
              <para>TX in pps and Mbit/s</para>
            </listitem>
          </itemizedlist>

          <table>
            <title>Results in forwarding mode</title>

            <tgroup cols="7">
              <tbody>
                <row>
                  <entry align="center"><emphasis
                  role="bold">Bytes</emphasis></entry>

                  <entry align="center"><emphasis role="bold">pktgen pps
                  TX</emphasis></entry>

                  <entry align="center"><emphasis role="bold">VM1 testpmd pps
                  RX</emphasis></entry>

                  <entry align="center"><emphasis role="bold">VM1 testpmd pps
                  TX</emphasis></entry>

                  <entry align="center"><emphasis role="bold">VM2 testpmd pps
                  RX</emphasis></entry>

                  <entry align="center"><emphasis role="bold">pktgen MBits/s
                  TX</emphasis></entry>

                  <entry align="center"><emphasis role="bold">throughput
                  (%)</emphasis></entry>
                </row>

                <row>
                  <entry role="bold"><emphasis
                  role="bold">64</emphasis></entry>

                  <entry>14845113</entry>

                  <entry>6826540</entry>

                  <entry>5389680</entry>

                  <entry>5383577</entry>

                  <entry>9975</entry>

                  <entry>36.2</entry>
                </row>

                <row>
                  <entry><emphasis role="bold">128</emphasis></entry>

                  <entry>8426683</entry>

                  <entry>6825857</entry>

                  <entry>5386971</entry>

                  <entry>5384530</entry>

                  <entry>9976</entry>

                  <entry>63.9</entry>
                </row>

                <row>
                  <entry role="bold"><emphasis
                  role="bold">256</emphasis></entry>

                  <entry>4528894</entry>

                  <entry>4507975</entry>

                  <entry>4507958</entry>

                  <entry>4532457</entry>

                  <entry>9999</entry>

                  <entry>100</entry>
                </row>
              </tbody>
            </tgroup>
          </table>
        </section>
      </section>
    </section>
  </section>
</chapter>