DPDK logo

Elixir Cross Referencer

   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
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
Pktgen - Traffic Generator powered by Intel's DPDK
=====================================================

**Pktgen is a traffic generator powered by Intel's DPDK at wire rate traffic with 64 byte frames.**

** (Pktgen) Sounds like 'Packet-Gen'**

**=== Modifications ===**
 - 3.0.12  - Map port/queue pair stats to the correct lcore.
 - 3.0.11  - Fix compile problem with 16.04
 - 3.0.10  - Added the 'pdump <portlist>' command to hex dump the first packet to be
             send on the given ports. Only the single packet mode is supported.
 - 3.0.09  - Add Fix for PCAP corruption.
 - 3.0.08  - Add Lua support for rnd and latency commands.
             Now if latency is enable on a port then getting the stats will get
             the latency values via lua table.
 - 3.0.07  - Fixed crash on exit when using more then one core per port.
 - 3.0.06  - Fix PCI null pointer when using virtual devices.
             Removed the C11 constructs to compile on C99 compilers.
             Fix the bug of old packets after changes for new run.
             The problem is DPDK holds on to the mbufs in the TX done queue
             and those can not be changed. With 16.07 we can find all of the mbufs
             and changed them to correct format/sizes.
 - 3.0.05  - New Latency/Jitter page 'page latency'
             Need to adjust the packet size to 96 to allow for latency timestamp.
             type: page latency
                   latency 0 on
                   set 0 size 96
                   start 0
 - 3.0.04  - Display reported the wrong rate in Mbits because the counters were not
             including the FCS bytes in the value as it was before.
             Minor cleanup of the code for formating.
 - 3.0.03  - General clean up of scripts
             Add support for share library builds
             Clean up formating
             Add PCI info screen
             GUI 1.0 support
 - 3.0.02  - Fix up the IPv6 address macros for musl libc support
             Fix the missing pthread.h include in lua socket header.
             Add the rnd lua support APIs
             Fix the checksum issue with rnd changes.
 - 3.0.01  - Fixed the Range sequence and VLAN problem.
 - 3.0.00  - Fixed code to ifdef the imcasts counters that were deprecated.
 - 2.9.18  - Fix the range command to set IP proto value and be able to save that value.
 - 2.9.17  - Fix PCAP crash when using multiple tx queues.
 - 2.9.16  - Fix include problems with cmdline_parse.h file.
             missing cmdline_parse_token_hdr_t define and looks like the header was not
             included in the pktgen-seq.h file for DPDK v2.2.0 and pktgen-2.9.15
 - 2.9.15  - Update Lua to version 5.3.2
 - 2.9.14  - Fix compiler error for gcc-4.9 and inet_ntop() routine
 - 2.9.13  - Add max last seen RX/TX packets to display.
 - 2.9.12  - Was not able to set IP protocol type for range packets.
             New command range.proto <portlist> udp|tcp|icmp
             Lua command is range_proto("all", "udp")
 - 2.9.11  - Fix version string for new version style in DPDK.
 - 2.9.10  - Reformat the code and get ready for the next release of DPDK.
 - 2.9.9   - Update the init screen output to not screw up DPDK screen output.
 - 2.9.8   - Fixed the crash when using the sequence packets.
 - 2.9.7   - Changed all rte_zmalloc to rte_zmalloc_socket calls and change seq_pkt support.
             The fix for multiple cores accessing seq_pkts was to allocate memory and copy
             into a private area. This sometimes caused memory allocation problems, so I
             removed the allocation and used spinlocks around the code. Most likely slower
             in some areas but better then allocating memory.
 - 2.9.6   - Add support for different pattern types and a user patten string.
             New commands are 'pattern <portlist> type'.
             Types are abc, none, zero or user
             New command 'user.pattern <portlist> <string>' The string can not contain a space
             which is a limitation of the rte_cmdline code.
             Added new Lua command for the above 'pattern(<portlist>, <type>)'
             and 'userPatten(<portlist>, <string>)'
 - 2.9.5   - Fixed sequence packet race condition for multiple senders.
 - 2.9.4   - Fixed the ARP sends were not being flushed 
 - 2.9.3   - Remove change log and comment out the eth stop when done sending.
             This will most likely screw up the pcap and others, but stopping the port is not good.
 - 2.9.1   - Fix up the sequeue help to remove vlan option with ipv4/ipv6
 - 2.9.0   - Update to DPDK 2.0.0 and Lua 5.3.0 with README update.
 - 2.8.6   - Fix argument for rte_mempool_create, which caused a crash.
 - 2.8.5   - Fix compat problem with latest Pktgen and DPDK 1.8.0
 - 2.8.4   - Minor updates for comments.
 - 2.8.3   - Updated the Makefiles to use rte.extXYZ.mk files.
             Updated the code to build with DPDK 2.0.0-rc1 as some function prototype changed.
 - 2.8.2   - Fix bug in pktgen_main_receive routine not using the correct port number.
 - 2.8.1   - Add a new docs directory using Sphinx format and update version numbers.
 - 2.8.0   - Update to release 1.8.0 of DPDK.
 - 2.7.7   - Update Lua to 5.2.3 and fixed setting vlan ID on single ports plus added new Lua functions
			 New Lua functions are pktgen.portCount() and pktgen.totalPorts() portCount() is the number of
			 port used by Pktgen and totalPorts() is the total number seen by DPDK.
 - 2.7.6   - Update code from dpdk.org version of Pktgen, which hopefull fixes the send foreve problem.
 - 2.7.5   - Update to latest dpdk.org and move scrn to lib directory with name changes.
 - 2.7.4   - Removed old printf_info() calls for printf_status() calls.
 - 2.7.3   - Fixed race condition with updating the TX count value with a small count.
 - 2.7.1   - Add a command line option '-T' to enable themes and set themes off by default.
 - 2.7.0   - Update to DPDK 1.7.0, Note: DPDK 1.7.0 changed how ports are detected and blacklisted,
             which means the port index is now different. You will need to blacklist or whitelist ports
             with the DPDK '-b' or '--pci-blacklist or --pci-whitelist' options. Pktgen does not blacklist
             ports anymore.
           - Moved pktgen to the examples directory plus removed the libwr_* from the lib directory
           - Pktgen now supports ANSI color terminals only the main screen ATM, but more later.
           - Best viewed on a black background display, unless you want to change it with the new theme commands.
           - More supported generator types, checkout the help screens.
 - 2.6.8   - Fixed a transmit problem when count is set to one. Plus increase the link down delays.
 - 2.6.7   - Add more support for GRE packets, log support and more testing code.
 - 2.6.6   - Fix compile problem when not SSE4.2 instructions are not supported. Allowing QEMU and other
             systems to build and run. Also added a patch to take into account huge reserved pages.
 - 2.6.5   - Added support for logging packet information.
 - 2.6.4   - It consists of 3 commits: improvements to the pktgen-random.c unit tests,
             the real CentOS compilation fixes and a small update to tap.{c,h} so they
             are identical to those from zorgnax/libtap on github.
 - 2.6.3   - Add a delay when traffic stops to make sure all packets are sent.
             Remove the `rte_hash_crc.h` include in wr_pcap.c file.
 - 2.6.2   - Fixup GRE and ARP problems
 - 2.6.1   - Add random bits support and more cleanup
 - 2.6.0   - Split up the code for testing to be added later
 - 2.5.2   - Remove extra ethertypes.h file.
 - 2.5.1   - Added the following updates.
           - Implement-Rx-packet-dump-functionality
           - Add-packet-capture-functionality
           - Add-MPLS-functionality
           - Add-Q-in-Q-802.11ad-functionality
           - Add-GRE-header-generation
           - Fix-UDP-TCP-ICMP-protocol-selection
           - Add-ARP-protocol
 - 2.5.0   - Update to DPDK 1.6.0 plus a few bug fixes.
 - 2.4.1   - Fixed a bug in range packets when 'inc' value is zero use start values.
 - 2.4.0   - Add support for TX tap packets. Change 'tap' command to rxtap and txtap.
 - 2.3.4   - Minor update to help eliminate RX errors and be able to receive at wire rate.
 - 2.3.3   - Update to minor release 1.5.2
 - 2.3.2   - Fixed VLAN detection problem in ARP and special GARP support.
 - 2.3.1   - Getting closer to line rate tx speed.
 - 2.3.0   - Now supports the VLAN encapsulated packets for ARP replies
             Also added a special GARP processing to update the destination MAC
             address to help support a special request for failover support.
             Added support for DPDK 1.5.1
 - 2.2.7   - Updated the code to handle multiple TX queues per port.
 - 2.2.6   - Fixed a crash if the port is not up with link status
 - 2.2.5   - Remove the flow control code as some systems it does not work.
 - 2.2.4   - Fix the `inet_h64tom and inet_mtoh64` functions to account for endianness
 - 2.2.3   - range packet fixes for packet size and source/destination mac
 - 2.2.2   - Minor performance changes for receive packet performance.
 - 2.2.1   - Change MAC address from XXXX:XXXX:XXXX to XX:XX:XX:XX:XX:XX format
             Fixed Pktgen to allow packet changes without having to restart the tool.
 - 2.2.0   - Update to DPDK 1.5.0
 
**=====================**

Please look at the 3rd party PDF for license information.

---
**Copyright &copy; \<2010-2016\>, Intel Corporation All rights reserved.**
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:

 - Redistributions of source code must retain the above copyright
   notice, this list of conditions and the following disclaimer.

 - Redistributions in binary form must reproduce the above copyright
   notice, this list of conditions and the following disclaimer in
   the documentation and/or other materials provided with the
   distribution.

 - Neither the name of Intel Corporation nor the names of its
   contributors may be used to endorse or promote products derived
   from this software without specific prior written permission.

 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 OF THE POSSIBILITY OF SUCH DAMAGE.

---
**Copyright &copy; \<2010-2014\>, Wind River Systems, Inc.**

 Redistribution and use in source and binary forms, with or without modification, are
 permitted provided that the following conditions are met:

 1) Redistributions of source code must retain the above copyright notice,
    this list of conditions and the following disclaimer.

 2) Redistributions in binary form must reproduce the above copyright notice,
    this list of conditions and the following disclaimer in the documentation and/or
    other materials provided with the distribution.

 3) Neither the name of Wind River Systems nor the names of its contributors may be
    used to endorse or promote products derived from this software without specific
    prior written permission.

 4) The screens displayed by the application must contain the copyright notice as defined
    above and can not be removed without specific prior written permission.

 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
 USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 Pktgen: Created 2010 by Keith Wiles @ windriver.com, now at Intel.com
 ---

**======================== README.md file ==============================**

                          *** Pktgen ****
          Copyright &copy \<2015-2016\>, Intel Corporation.
          Copyright &copy \<2010-2014\>, Wind River Systems, Inc.

README for setting up Pktgen with DPDK on Ubuntu 10.04 to 13.10 desktop, it
should work on most Linux systems as long as the kernel has hugeTLB page support.

*** Note: Tested with Ubuntu 13.10 and up to 14.04 kernel version
    Linux 3.5.0-25-generic #39-Ubuntu SMP Mon Feb 25 18:26:58 UTC 2013 x86_64

I am using Ubuntu 13.10 x86_64 (64 bit support) for running Pktgen-DPDK on a
Crownpass Dual socket board running at 2.4GHz with 32GB of ram 16GB per socket.
The current kernel version is 3.5.0-25 (as of 2013-03-18) support, but should
work on just about any new Linux kernel version.

Currently using as of 2016-02-10 Ubuntu 15.10 Kernel 4.2.0-27-generic system.

To get hugeTLB page support your Linux kernel must be at least 2.6.33 and in the
DPDK documents it talks about how you can upgrade your Linux kernel.

Here is another document on how to upgrade your Linux kernel.
Ubuntu 10.04 is 2.6.32 by default so upgraded to kernel 2.6.34 using this HOWTO:
http://usablesoftware.wordpress.com/2010/05/26/switch-to-a-newer-kernel-in-ubuntu-10-04/

The pktgen output display needs 132 columns and about 42 lines to display
correctly. I am using an xterm of 132x42, but you can have a larger display
and maybe a bit smaller. If you are displaying more then 4-6 ports then you
will need a wider display. Pktgen allows you to view a set of ports if they
do not all fit on the screen at one time via the 'page' command.

Type 'help' at the 'Pktgen>' prompt to see the complete Pktgen command line
commands. Pktgen uses VT100 control codes or escape codes to display the screens,
which means your terminal must support VT100. The Hyperterminal in windows is not
going to work for Pktgen as it has a few problems with VT100 codes.

The pktgen program as built can send up to 16 packets per port in a sequence
and you can configure a port using the 'seq' pktgen command. A script file
can be loaded from the shell command line via the -f option and you can 'load'
a script file from within pktgen as well.

In the BIOS make sure the HPET High Precision Event Timer is enabled. Also
make sure hyper-threading is enabled.

** NOTE **
  On a 10GB NIC if the transceivers are not attached the screen updates will go
  very slow.

Get the DPDK and pktgen source code from github.com or dpdk.org repo via:
```
# cd <InstallDir>
# git clone git://dpdk.org/dpdk.git
```
```
# cd <InstallDir>
# git clone git://dpdk.org/pktgen-dpdk.git
```
** Note **
  The site dpdk.org you must also pull down DPDK repo as well. git://dpdk.org/dpdk

Will create a directory called Pktgen-DPDK in the current directory location. Using
this clone command you will get DPDK and pktgen source files.

Make sure you have HUGE TLB support in the kernel with the following commands:
```
# grep -i huge /boot/config-2.6.35-24-generic 
CONFIG_HUGETLBFS=y
CONFIG_HUGETLB_PAGE=y

# grep -i huge /proc/meminfo
HugePages_Total:      128
HugePages_Free:       128
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
```
NOTE: The values in Total and Free maybe different until you reboot the machine.

Two files in /etc must be setup to support huge TLBs. If you do not have
hugeTLB support then you most likely need a newer kernel.
```
# vi /etc/sysctl.conf
Add to the bottom of the file:
vm.nr_hugepages=256
```
If you need more or less hugeTLB pages then you can change the value to a
number you need it to be. In some cases pktgen needs a fair number of pages
and making it too small will effect performance or pktgen will terminate on
startup looking for more pages.
```
# On Ubuntu 15.10 I noticed mounting /mnt/huge is not required as /dev/hugepages
# is already mounted. Check your system and verify that /mnt/huge is required.
# vi /etc/fstab
Add to the bottom of the file:
huge /mnt/huge hugetlbfs defaults 0 0

# mkdir /mnt/huge
# chmod 777 /mnt/huge
```
Reboot your machine as the huge pages must be setup just after boot to make
sure you have contiguous memory for the 2Meg pages.

** Note: If you startup Eclipse or WR Workbench before starting pktgen the first
   time after reboot, pktgen will fail to load because it can not get all of the
   huge pages as eclipse has consumed some of the huge pages. If you did start eclipse
   or WR Workbench then you need to close that application first. 

This is my current machine you will have a few different numbers depending on 
how your system was booted and if you had hugeTLB support enabled.

At the ${RTE_SDK}/examples/pktgen level directory we have the 'setup' script,
which needs to be run as root once per boot. The script contains a commands to setup
the environment.

Make sure you run the setup script as root via 'sudo -E ./setup'. The setup script
is a bash script and tries to setup the system correctly, but you may have to 
change the script to match your number of huge pages you configured above.

The modprobe uio command, in the setup script, loads the UIO support module into the
kernel plus it loads the igb-uio.ko module into the kernel. The two echo commands,
in the setup script, finish setting up the huge pages one for each socket. If you
only have a single socket system then comment out the second echo command. The last
command is to display the huge TLB setup.

Edit your .bashrc or .profile or .cshrc to add the environment variables.
I am using bash:
`# vi ~/.bashrc`
Add the following lines: Change the $RTE_SDK to the location of the DPDK version
directory. Your SDK directory maybe named differently, but should point to the DPDK
SDK directory.

Make sure you have the Linux kernel headers installed as DPDK requires them to build
the kernel modules. On Ubuntu I run the following:

`# sudo apt-get install linux-headers-3.5.0-32-generic`

You will need to adjust the version number to match your current kernel version.
If you upgrade your system or kernel version you will need to install the correct
headers and rebuild the RTE_TARGET directory.

```
# sudo apt-get install libpcap-dev

export RTE_SDK=<DPDKinstallDir>
export RTE_TARGET=x86_64-native-linuxapp-gcc
or use clang if you have it installed
export RTE_TARGET=x86_64-native-linuxapp-clang
```
Create the DPDK build tree:
```
# cd $RTE_SDK
# make install T=x86_64-native-linuxapp-gcc
```
This above command will create the x86_64-native-linuxapp-gcc directory in the
top level of the current-dkdp directory. The above command will build the basic
DPDK libraries and build tree.

Next we build pktgen:
```
# cd <PktgenInstallDir>
# make
```
You should now have pktgen built and to run pktgen type 'sudo -E ./doit', which is a script
to help with the command line options of pktgen. You may need to modify this script for
your system and configuration.
```
# cat doit
#!/bin/bash

#rkwiles@rkwiles-desk:~/projects/intel/dpdk$ lspci |grep Ether
#06:00.0 Ethernet controller: Intel Corporation Ethernet Converged Network Adapter X520-Q1 (rev 01)
#06:00.1 Ethernet controller: Intel Corporation Ethernet Converged Network Adapter X520-Q1 (rev 01)
#08:00.0 Ethernet controller: Intel Corporation Ethernet Converged Network Adapter X520-Q1 (rev 01)
#08:00.1 Ethernet controller: Intel Corporation Ethernet Converged Network Adapter X520-Q1 (rev 01)
#09:00.0 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
#09:00.1 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
#83:00.1 Ethernet controller: Intel Corporation DH8900CC Null Device (rev 21)
#87:00.0 Ethernet controller: Intel Corporation Ethernet Converged Network Adapter X520-Q1 (rev 01)
#87:00.1 Ethernet controller: Intel Corporation Ethernet Converged Network Adapter X520-Q1 (rev 01)
#89:00.0 Ethernet controller: Intel Corporation Ethernet Converged Network Adapter X520-Q1 (rev 01)
#89:00.1 Ethernet controller: Intel Corporation Ethernet Converged Network Adapter X520-Q1 (rev 01)

if [ $name == "rkwiles-supermicro" ]; then
./app/app/${target}/pktgen -c 1fff0 -n 3 --proc-type auto --socket-mem 512,512 --file-prefix pg -b 06:00.0 -b 06:00.1 -b 08:00.0 -b 08:00.1 -b 09:00.0 -b 09:00.1 -b 83:00.1 -- -T -P -m "[5:7].0, [6:8].1, [9:11].2, [10:12].3" -f themes/black-yellow.theme
fi
```
** Note: The '-m NNN' in the DPDK arguments is to have DPDK allocate 512 megs of memory.
   The '--socket-mem 256,156' DPDK command will allocate 256M from each CPU (two in this
   case). Do not use the '-m NNN' and '--socket-mem NN,NN' commands on the same command
   line.
   
The pktgen program follows the same format as a standard DPDK linuxapp, meaning
the first set of arguments '-c 1f' are the standard DPDK arguments. This option
defines the number of logical cores to be used by pktgen. The 1f states 5 lcores
are used and the '3c' is just a bit array for each lcore to be used. The '-P' enables
promiscuous mode on all ports if you need that support. The '-m "..."' sets up the
port to lcore mapping for pktgen. 

The second half of the command line followed by the '--' is pktgen specific
options.

The pktgen requires 2 logical cores for a minimum system. The first lcore 0 used
for pktgen command line and is used for timers also displaying the text on the
screen and lcores 1-n are used to do the packet receive and transmits along with
anything else related to packets. You do not need to start at lcore zero, but the first
lcore in the bitmap from in the least signification bit location is the display and
timer lcore used by pktgen.

The -m format now allows the developer to have different lcores for rx and tx
instead of rx/tx on the same lcore. The above format of {1:3}.0 states to use
lcore 1 for rx and lcore 3 for tx on port 0. Make sure you select different
lcores for the rx and tx so that only a single rx or tx function is on
a single physical core. If you pick the rx/tx functions on different lcores, but
on the same physical core you will not be able to get the performance you want as the
single physical core will be trying to do both Rx/Tx functions.

The '-n 2' is a required argument for DPDK and denotes the number of memory channels.

```
Usage: ./app/pktgen -c COREMASK -n NUM [-m NB] [-r NUM] [-b <domain:bus:devid.func>][--proc-type primary|secondary|auto]

EAL options:                                                                                                                        
  -c COREMASK  : A hexadecimal bitmask of cores to run on                                                                           
  -n NUM       : Number of memory channels                                                                                          
  -v           : Display version information on startup                                                                             
  -d LIB.so    : add driver (can be used multiple times)                                                                            
  -m MB        : memory to allocate (see also --socket-mem)                                                                         
  -r NUM       : force number of memory ranks (don't detect)                                                                        
  --xen-dom0 : support application running on Xen Domain0 without hugetlbfs                                                         
  --syslog     : set syslog facility                                                                                                
  --socket-mem : memory to allocate on specific                                                                                     
                 sockets (use comma separated values)                                                                               
  --huge-dir   : directory where hugetlbfs is mounted                                                                               
  --proc-type  : type of this process                                                                                               
  --file-prefix: prefix for hugepage filenames                                                                                      
  --pci-blacklist, -b: add a PCI device in black list.                                                                              
               Prevent EAL from using this PCI device. The argument                                                                 
               format is `<domain:bus:devid.func>`.                                                                                   
  --pci-whitelist, -w: add a PCI device in white list.                                                                              
               Only use the specified PCI devices. The argument format                                                              
               is <[domain:]bus:devid.func>. This option can be present                                                             
               several times (once per device).                                                                                     
               [NOTE: PCI whitelist cannot be used with -b option]                                                                  
  --vdev: add a virtual device.                                                                                                     
               The argument format is `<driver><id>[,key=val,...]`                                                                    
               (ex: --vdev=eth_pcap0,iface=eth2).                                                                                   
  --vmware-tsc-map: use VMware TSC map instead of native RDTSC                                                                      
  --base-virtaddr: specify base virtual address                                                                                     
  --vfio-intr: specify desired interrupt mode for VFIO (legacy|msi|msix)                                                            
  --create-uio-dev: create /dev/uioX (usually done by hotplug)                                                                      

EAL options for DEBUG use only:                                                                                                     
  --no-huge  : use malloc instead of hugetlbfs                                                                                      
  --no-pci   : disable pci                                                                                                          
  --no-hpet  : disable hpet                                                                                                         
  --no-shconf: no shared config (mmap'd files)

===== Application Usage =====

Usage: ./app/pktgen [EAL options] -- [-h] [-P] [-G] [-f cmd_file] [-l log_file] [-s P:PCAP_file] [-m <string>]
  -s P:file    PCAP packet stream file, 'P' is the port number
  -f filename  Command file (.pkt) to execute or a Lua script (.lua) file
  -l filename  Write log to filename
  -P           Enable PROMISCUOUS mode on all ports
  -g address   Optional IP address and port number default is (localhost:0x5606)
               If -g is used that enable socket support as a server application
  -G           Enable socket support using default server values localhost:0x5606 
  -N           Enable NUMA support
  -m <string>  matrix for mapping ports to logical cores
      BNF: (or kind of BNF)
      <matrix-string>   := """ <lcore-port> { "," <lcore-port>} """
      <lcore-port>      := <lcore-list> "." <port-list>
      <lcore-list>      := "[" <rx-list> ":" <tx-list> "]"
      <port-list>       := "[" <rx-list> ":" <tx-list>"]"
      <rx-list>         := <num> { "/" (<num> | <list>) }
      <tx-list>         := <num> { "/" (<num> | <list>) }
      <list>            := <num> { "/" (<range> | <list>) }
      <range>           := <num> "-" <num> { "/" <range> }
      <num>             := <digit>+
      <digit>           := 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
      1.0, 2.1, 3.2                 - core 1 handles port 0 rx/tx,
                                      core 2 handles port 1 rx/tx
                                      core 3 handles port 2 rx/tx
      1.[0-2], 2.3, ...             - core 1 handle ports 0,1,2 rx/tx,
                                      core 2 handle port 3 rx/tx
      [0-1].0, [2/4-5].1, ...       - cores 0-1 handle port 0 rx/tx,
                                      cores 2,4,5 handle port 1 rx/tx
      [1:2].0, [4:6].1, ...         - core 1 handles port 0 rx,
                                      core 2 handles port 0 tx,
      [1:2].[0-1], [4:6].[2/3], ... - core 1 handles port 0 & 1 rx,
                                      core 2 handles port  0 & 1 tx
      [1:2-3].0, [4:5-6].1, ...     - core 1 handles port 0 rx, cores 2,3 handle port 0 tx
                                      core 4 handles port 1 rx & core 5,6 handles port 1 tx
      [1-2:3].0, [4-5:6].1, ...     - core 1,2 handles port 0 rx, core 3 handles port 0 tx
                                      core 4,5 handles port 1 rx & core 6 handles port 1 tx
      [1-2:3-5].0, [4-5:6/8].1, ... - core 1,2 handles port 0 rx, core 3,4,5 handles port 0 tx
                                      core 4,5 handles port 1 rx & core 6,8 handles port 1 tx
      [1:2].[0:0-7], [3:4].[1:0-7], - core 1 handles port 0 rx, core 2 handles ports 0-7 tx
                                      core 3 handles port 1 rx & core 4 handles port 0-7 tx
      BTW: you can use "{}" instead of "[]" as it does not matter to the syntax.
  -h           Display the help information
** Note: To determine the Ethernet ports in your system use 'lspci | grep Ethernet' to 
   get a list of all ports in the system. Some ports may not be useable by DPDK/Pktgen.
   The first port listed is bit 0 or least signification bit in the '-c' mask.
   Another method is to compile the test_pmd example and run './test_pmd -c 0x3 -n 2'
   command to list out the ports DPDK is able to use.
```
A new feature for pktgen and DPDK is to run multiple instances of pktgen. This
allows the developer to share ports on the same machine.

------------- doit script ----------------
```
#!/bin/bash

# Normal setup
#   different cores for each port.

name=`uname -n`

# Use 'sudo -E ./setup.sh' to include environment variables

if [ -z ${RTE_SDK} ] ; then
    echo "*** RTE_SDK is not set, did you forget to do 'sudo -E ./setup.sh'"
	export RTE_SDK=/work/home/rkwiles/projects/intel/dpdk
	export RTE_TARGET=x86_64-native-linuxapp-clang
fi
sdk=${RTE_SDK}

if [ -z ${RTE_TARGET} ]; then
    echo "*** RTE_TARGET is not set, did you forget to do 'sudo -E ./setup.sh'"
    target=x86_64-pktgen-linuxapp-gcc
else
    target=${RTE_TARGET}
fi


#rkwiles@rkwiles-desk:~/projects/intel/dpdk$ lspci |grep Ether
#06:00.0 Ethernet controller: Intel Corporation Ethernet Converged Network Adapter X520-Q1 (rev 01)
#06:00.1 Ethernet controller: Intel Corporation Ethernet Converged Network Adapter X520-Q1 (rev 01)
#08:00.0 Ethernet controller: Intel Corporation Ethernet Converged Network Adapter X520-Q1 (rev 01)
#08:00.1 Ethernet controller: Intel Corporation Ethernet Converged Network Adapter X520-Q1 (rev 01)
#09:00.0 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
#09:00.1 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
#83:00.1 Ethernet controller: Intel Corporation DH8900CC Null Device (rev 21)
#87:00.0 Ethernet controller: Intel Corporation Ethernet Converged Network Adapter X520-Q1 (rev 01)
#87:00.1 Ethernet controller: Intel Corporation Ethernet Converged Network Adapter X520-Q1 (rev 01)
#89:00.0 Ethernet controller: Intel Corporation Ethernet Converged Network Adapter X520-Q1 (rev 01)
#89:00.1 Ethernet controller: Intel Corporation Ethernet Converged Network Adapter X520-Q1 (rev 01)

if [ $name == "rkwiles-supermicro" ]; then
./app/app/${target}/pktgen -c 1fff0 -n 3 --proc-type auto --socket-mem 512,512 --file-prefix pg -b 06:00.0 -b 06:00.1 -b 08:00.0 -b 08:00.1 -b 09:00.0 -b 09:00.1 -b 83:00.1 -- -T -P -m "[5:7].0, [6:8].1, [9:11].2, [10:12].3" -f themes/black-yellow.theme
fi

#00:19.0 Ethernet controller: Intel Corporation Ethernet Connection (2) I218-V
#01:00.1 Ethernet controller: Intel Corporation DH8900CC Series Gigabit Network Connection (rev 10)
#01:00.2 Ethernet controller: Intel Corporation DH8900CC Series Gigabit Network Connection (rev 10)
#01:00.3 Ethernet controller: Intel Corporation DH8900CC Series Gigabit Network Connection (rev 10)
#01:00.4 Ethernet controller: Intel Corporation DH8900CC Series Gigabit Network Connection (rev 10)

if [ $name == "rkwiles-mini-i7" ]; then
./app/app/${target}/pktgen -c 1f -n 3 --proc-type auto --socket-mem 512 --file-prefix pg -- -T -P -m "1.0, 2.1, 3.2, 4.3" -f themes/black-yellow.theme
fi
```
------------- doit script ----------------

------------- setup script ----------------
```
#!/bin/bash

# Use 'sudo -E ./setup.sh' to include environment variables

if [ -z ${RTE_SDK} ] ; then
	echo "*** RTE_SDK is not set, did you forget to do 'sudo -E ./setup.sh'"
	echo "    Using "${RTE_SDK}
	export RTE_SDK=/work/home/rkwiles/projects/intel/dpdk
	export RTE_TARGET=x86_64-native-linuxapp-clang
fi
sdk=${RTE_SDK}

if [ -z ${RTE_TARGET} ]; then
	echo "*** RTE_TARGET is not set, did you forget to do 'sudo -E ./setup.sh'"
	target=x86_64-pktgen-linuxapp-gcc
else
	target=${RTE_TARGET}
fi

echo "Using directory: "$sdk"/"$target

function nr_hugepages_fn {
    echo /sys/devices/system/node/node${1}/hugepages/hugepages-2048kB/nr_hugepages
}

function num_cpu_sockets {
    local sockets=0
    while [ -f $(nr_hugepages_fn $sockets) ]; do
		sockets=$(( $sockets + 1 ))
    done
    echo $sockets
	if [ $sockets -eq 0 ]; then
		echo "Huge TLB support not found make sure you are using a kernel >= 2.6.34" >&2
		exit 1
	fi
}

if [ $UID -ne 0 ]; then
    echo "You must run this script as root" >&2
    exit 1
fi

rm -fr /mnt/huge/*

NR_HUGEPAGES=$(( `sysctl -n vm.nr_hugepages` / $(num_cpu_sockets) ))
echo "Setup "$(num_cpu_sockets)" socket(s) with "$NR_HUGEPAGES" pages."
for socket in $(seq 0 $(( $(num_cpu_sockets) - 1 )) ); do
    echo $NR_HUGEPAGES > $(nr_hugepages_fn $socket)
done

grep -i huge /proc/meminfo
modprobe uio
echo "trying to remove old igb_uio module and may get an error message, ignore it"
rmmod igb_uio
insmod $sdk/$target/kmod/igb_uio.ko
echo "trying to remove old rte_kni module and may get an error message, ignore it"
rmmod rte_kni
insmod $sdk/$target/kmod/rte_kni.ko "lo_mode=lo_mode_ring"

name=`uname -n`
if [ $name == "rkwiles-supermicro" ]; then
$sdk/tools/dpdk_nic_bind.py -b igb_uio 06:00.0 06:00.1 08:00.0 08:00.1 87:00.0 87:00.1 89:00.0 89:00.1
fi
if [ $name == "rkwilesmini-i7" ]; then
$sdk/tools/dpdk_nic_bind.py -b igb_uio 01:00.1 01:00.2 01:00.3 01:00.4
fi
$sdk/tools/dpdk_nic_bind.py --status
lspci |grep Ether
```
------------- setup script ----------------

If you have run pktgen before then remove the files in /mnt/huge/* before
running the new version.

Running the doit script produces output as follows, but maybe different on your
system configuration.
```
[22:20][keithw@keithw-S5520HC:pktgen(master)]$ sudo -E ./doit
------------------------------------------------------------------------
-----------------------
  
     BSD LICENSE
  
     Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
     All rights reserved.
  
     Redistribution and use in source and binary forms, with or without
     modification, are permitted provided that the following conditions
     are met:
  
       * Redistributions of source code must retain the above copyright
         notice, this list of conditions and the following disclaimer.
       * Redistributions in binary form must reproduce the above copyright
         notice, this list of conditions and the following disclaimer in
         the documentation and/or other materials provided with the
         distribution.
       * Neither the name of Intel Corporation nor the names of its
         contributors may be used to endorse or promote products derived
         from this software without specific prior written permission.
  
     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
-----------------------
    Copyright (c) <2010-2014>, Wind River Systems, Inc.

     Redistribution and use in source and binary forms, with or without modification, are
     permitted provided that the following conditions are met:
  
       1) Redistributions of source code must retain the above copyright notice,
          this list of conditions and the following disclaimer.
  
       2) Redistributions in binary form must reproduce the above copyright notice,
          this list of conditions and the following disclaimer in the documentation and/or
          other materials provided with the distribution.
  
       3) Neither the name of Wind River Systems nor the names of its contributors may be
          used to endorse or promote products derived from this software without specific
          prior written permission.
  
       4) The screens displayed by the application must contain the copyright notice as defined
          above and can not be removed without specific prior written permission.
  
     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
     LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
     CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
     OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
     USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
  Pktgen created by: Keith Wiles -- >>> Powered by Intel® DPDK <<<
-----------------------
EAL: Detected lcore 0 as core 0 on socket 0
EAL: Detected lcore 1 as core 1 on socket 0                                                                                         
EAL: Detected lcore 2 as core 2 on socket 0                                                                                         
EAL: Detected lcore 3 as core 3 on socket 0                                                                                         
EAL: Detected lcore 4 as core 4 on socket 0                                                                                         
EAL: Detected lcore 5 as core 8 on socket 0                                                                                         
EAL: Detected lcore 6 as core 9 on socket 0                                                                                         
EAL: Detected lcore 7 as core 10 on socket 0                                                                                        
EAL: Detected lcore 8 as core 11 on socket 0                                                                                        
EAL: Detected lcore 9 as core 12 on socket 0                                                                                        
EAL: Detected lcore 10 as core 0 on socket 1                                                                                        
EAL: Detected lcore 11 as core 1 on socket 1                                                                                        
EAL: Detected lcore 12 as core 2 on socket 1                                                                                        
EAL: Detected lcore 13 as core 3 on socket 1                                                                                        
EAL: Detected lcore 14 as core 4 on socket 1                                                                                        
EAL: Detected lcore 15 as core 8 on socket 1                                                                                        
EAL: Detected lcore 16 as core 9 on socket 1                                                                                        
EAL: Detected lcore 17 as core 10 on socket 1                                                                                       
EAL: Detected lcore 18 as core 11 on socket 1                                                                                       
EAL: Detected lcore 19 as core 12 on socket 1                                                                                       
EAL: Detected lcore 20 as core 0 on socket 0                                                                                        
EAL: Detected lcore 21 as core 1 on socket 0                                                                                        
EAL: Detected lcore 22 as core 2 on socket 0                                                                                        
EAL: Detected lcore 23 as core 3 on socket 0                                                                                        
EAL: Detected lcore 24 as core 4 on socket 0                                                                                        
EAL: Detected lcore 25 as core 8 on socket 0                                                                                        
EAL: Detected lcore 26 as core 9 on socket 0                                                                                        
EAL: Detected lcore 27 as core 10 on socket 0                                                                                       
EAL: Detected lcore 28 as core 11 on socket 0                                                                                       
EAL: Detected lcore 29 as core 12 on socket 0                                                                                       
EAL: Detected lcore 30 as core 0 on socket 1                                                                                        
EAL: Detected lcore 31 as core 1 on socket 1                                                                                        
EAL: Detected lcore 32 as core 2 on socket 1                                                                                        
EAL: Detected lcore 33 as core 3 on socket 1                                                                                        
EAL: Detected lcore 34 as core 4 on socket 1                                                                                        
EAL: Detected lcore 35 as core 8 on socket 1                                                                                        
EAL: Detected lcore 36 as core 9 on socket 1                                                                                        
EAL: Detected lcore 37 as core 10 on socket 1                                                                                       
EAL: Detected lcore 38 as core 11 on socket 1                                                                                       
EAL: Detected lcore 39 as core 12 on socket 1                                                                                       
EAL: Support maximum 64 logical core(s) by configuration.                                                                           
EAL: Detected 40 lcore(s)                                                                                                           
EAL: Auto-detected process type: PRIMARY                                                                                            
EAL:   cannot open VFIO container, error 2 (No such file or directory)                                                              
EAL: VFIO support could not be initialized                                                                                          
EAL: Setting up memory...                                                                                                           
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa3c8600000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa3c8200000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa3c7e00000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa3c7a00000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa3c7600000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa3c7200000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa3c6e00000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x400000 bytes                                                                                           
EAL: Virtual area found at 0x7fa3c6800000 (size = 0x400000)                                                                         
EAL: Ask a virtual area of 0x400000 bytes                                                                                           
EAL: Virtual area found at 0x7fa3c6200000 (size = 0x400000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa3c5e00000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0xe200000 bytes                                                                                          
EAL: Virtual area found at 0x7fa3b7a00000 (size = 0xe200000)                                                                        
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa3b7600000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa3b7200000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa3b6e00000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x2f800000 bytes                                                                                         
EAL: Virtual area found at 0x7fa387400000 (size = 0x2f800000)                                                                       
EAL: Ask a virtual area of 0x400000 bytes                                                                                           
EAL: Virtual area found at 0x7fa386e00000 (size = 0x400000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa386a00000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x600000 bytes                                                                                           
EAL: Virtual area found at 0x7fa386200000 (size = 0x600000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa385e00000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa385a00000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa385600000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa385200000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa384e00000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa384a00000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa384600000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x400000 bytes                                                                                           
EAL: Virtual area found at 0x7fa384000000 (size = 0x400000)                                                                         
EAL: Ask a virtual area of 0x400000 bytes                                                                                           
EAL: Virtual area found at 0x7fa383a00000 (size = 0x400000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa383600000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa383200000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa382e00000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                               
EAL: Virtual area found at 0x7fa382a00000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa382600000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa382200000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa381e00000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa381a00000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x400000 bytes                                                                                           
EAL: Virtual area found at 0x7fa381400000 (size = 0x400000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa381000000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa380c00000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa380800000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa380400000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa380000000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x400000 bytes                                                                                           
EAL: Virtual area found at 0x7fa37fa00000 (size = 0x400000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa37f600000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa37f200000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa37ee00000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa37ea00000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa37e600000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa37e200000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa37de00000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa37da00000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa37d600000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa37d200000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0xa00000 bytes                                                                                           
EAL: Virtual area found at 0x7fa37c600000 (size = 0xa00000)                                                                         
EAL: Ask a virtual area of 0x47a00000 bytes                                                                                         
EAL: Virtual area found at 0x7fa334a00000 (size = 0x47a00000)                                                                       
EAL: Ask a virtual area of 0xf600000 bytes                                                                                          
EAL: Virtual area found at 0x7fa325200000 (size = 0xf600000)                                                                        
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa324e00000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa324a00000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa324600000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa324200000 (size = 0x200000)                                                                         
EAL: Ask a virtual area of 0x200000 bytes                                                                                           
EAL: Virtual area found at 0x7fa323e00000 (size = 0x200000)                                                                         
EAL: Requesting 128 pages of size 2MB from socket 0                                                                                 
EAL: Requesting 128 pages of size 2MB from socket 1                                                                                 
EAL: TSC frequency is ~2793266 KHz                                                                                                  
EAL: Master core 0 is ready (tid=c9f8c880)                                                                                          
EAL: Core 4 is ready (tid=b4dfb700)                                                                                                 
EAL: Core 3 is ready (tid=b55fc700)                                                                                                 
EAL: Core 2 is ready (tid=b5dfd700)                                                                                                 
EAL: Core 1 is ready (tid=b65fe700)                                                                                                 
EAL: PCI device 0000:03:00.0 on NUMA socket 0                                                                                       
EAL:   probe driver: 8086:10fb rte_ixgbe_pmd                                                                                        
EAL:   Device is blacklisted, not initializing                                                                                      
EAL: PCI device 0000:03:00.1 on NUMA socket 0                                                                                       
EAL:   probe driver: 8086:10fb rte_ixgbe_pmd                                                                                        
EAL:   Device is blacklisted, not initializing                                                                                      
EAL: PCI device 0000:07:00.0 on NUMA socket 0                                                                                       
EAL:   probe driver: 8086:1521 rte_igb_pmd                                                                                          
EAL:   0000:07:00.0 not managed by UIO driver, skipping                                                                             
EAL: PCI device 0000:07:00.1 on NUMA socket 0                                                                                       
EAL:   probe driver: 8086:1521 rte_igb_pmd                                                                                          
EAL:   0000:07:00.1 not managed by UIO driver, skipping                                                                             
EAL: PCI device 0000:83:00.0 on NUMA socket 1                                                                                       
EAL:   probe driver: 8086:10fb rte_ixgbe_pmd                                                                                        
EAL:   PCI memory mapped at 0x7fa3c9ed6000                                                                                          
EAL:   PCI memory mapped at 0x7fa3c9fac000                                                                                          
EAL: PCI device 0000:83:00.1 on NUMA socket 1                                                                                       
EAL:   probe driver: 8086:10fb rte_ixgbe_pmd                                                                                        
EAL:   PCI memory mapped at 0x7fa3c9e56000                                                                                          
EAL:   PCI memory mapped at 0x7fa3c9fa8000                                                                                          
EAL: PCI device 0000:85:00.0 on NUMA socket 1                                                                                       
EAL:   probe driver: 8086:10fb rte_ixgbe_pmd                                                                                        
EAL:   PCI memory mapped at 0x7fa3c9dd6000                                                                                          
EAL:   PCI memory mapped at 0x7fa3c9fa4000                                                                                          
EAL: PCI device 0000:85:00.1 on NUMA socket 1                                                                                       
EAL:   probe driver: 8086:10fb rte_ixgbe_pmd                                                                                        
EAL:   PCI memory mapped at 0x7fa3c8de1000                                                                                          
EAL:   PCI memory mapped at 0x7fa3c9fa0000                                                                                          
EAL: PCI device 0000:88:00.0 on NUMA socket 1                                                                                       
EAL:   probe driver: 8086:10fb rte_ixgbe_pmd                                                                                        
EAL:   PCI memory mapped at 0x7fa3c8d61000                                                                                          
EAL:   PCI memory mapped at 0x7fa3c9f9c000                                                                                          
EAL: PCI device 0000:88:00.1 on NUMA socket 1                                                                                       
EAL:   probe driver: 8086:10fb rte_ixgbe_pmd                                                                                        
EAL:   PCI memory mapped at 0x7fa3c8ce1000                                                                                          
EAL:   PCI memory mapped at 0x7fa3c9f98000                                                                                          
[1:3].0          = lcores(rx 0000000000000002, tx 0000000000000008) ports(rx 0000000000000001, tx 0000000000000001)                 
[2:4].1          = lcores(rx 0000000000000004, tx 0000000000000010) ports(rx 0000000000000002, tx 0000000000000002)                 
EAL: PCI device 0000:03:00.0 on NUMA socket 0                                                                                       
EAL:   probe driver: 8086:10fb rte_ixgbe_pmd                                                                                        
EAL:   Device is blacklisted, not initializing                                                                                      
EAL: PCI device 0000:03:00.1 on NUMA socket 0                                                                                       
EAL:   probe driver: 8086:10fb rte_ixgbe_pmd                                                                                        
EAL:   Device is blacklisted, not initializing                                                                                      
EAL: PCI device 0000:07:00.0 on NUMA socket 0                                                                                       
EAL:   probe driver: 8086:1521 rte_igb_pmd                                                                                          
EAL:   0000:07:00.0 not managed by UIO driver, skipping                                                                             
EAL: PCI device 0000:07:00.1 on NUMA socket 0                                                                                       
EAL:   probe driver: 8086:1521 rte_igb_pmd                                                                                          
EAL:   0000:07:00.1 not managed by UIO driver, skipping                                                                             
Lua 5.2.1  Copyright (C) 1994-2012 Lua.org, PUC-Rio                                                                                 
>>> Packet Burst 16, RX Desc 256, TX Desc 256, mbufs/port 2048, mbuf cache 256                                                      

=== port to lcore mapping table (# lcores 5) ===                                                                                    
   lcore:     0     1     2     3     4                                                                                             
port   0:  D: T  1: 0  0: 0  0: 1  0: 0 =  1: 1                                                                                     
port   1:  D: T  0: 0  1: 0  0: 0  0: 1 =  1: 1                                                                                     
Total   :  0: 0  1: 0  1: 0  0: 1  0: 1                                                                                             
    Display and Timer on lcore 0, rx:tx counts per port/lcore                                                                       

Configuring 6 ports, MBUF Size 1984, MBUF Cache Size 256                                                                            
Lcore:                                                                                                                              
    1, type  RX , rx_cnt  1, tx_cnt  0 private (nil), RX (pid:qid): ( 0: 0) , TX (pid:qid):                                         
    2, type  RX , rx_cnt  1, tx_cnt  0 private (nil), RX (pid:qid): ( 1: 0) , TX (pid:qid):                                         
    3, type  TX , rx_cnt  0, tx_cnt  1 private (nil), RX (pid:qid): , TX (pid:qid): ( 0: 0)                                         
    4, type  TX , rx_cnt  0, tx_cnt  1 private (nil), RX (pid:qid): , TX (pid:qid): ( 1: 0)                                         

Port :                                                                                                                              
    0, nb_lcores  2, private 0x7d08d8, lcores:  1  3                                                                                
    1, nb_lcores  2, private 0x7d1c48, lcores:  2  4                                                                                


Initialize Port 0 -- TxQ 1, RxQ 1,  Src MAC 90:e2:ba:5a:f7:90                                                                       
    Create: Default RX  0:0  - Memory used (MBUFs 2048 x (size 1984 + Hdr 64)) + 790720 =   4869 KB                                 

    Create: Default TX  0:0  - Memory used (MBUFs 2048 x (size 1984 + Hdr 64)) + 790720 =   4869 KB                                 
    Create: Range TX    0:0  - Memory used (MBUFs 2048 x (size 1984 + Hdr 64)) + 790720 =   4869 KB                                 
    Create: Sequence TX 0:0  - Memory used (MBUFs 2048 x (size 1984 + Hdr 64)) + 790720 =   4869 KB                                 
    Create: Special TX  0:0  - Memory used (MBUFs   64 x (size 1984 + Hdr 64)) + 790720 =    901 KB                                 

                                                                       Port memory used =  20373 KB                                 
Initialize Port 1 -- TxQ 1, RxQ 1,  Src MAC 90:e2:ba:5a:f7:91                                                                       
    Create: Default RX  1:0  - Memory used (MBUFs 2048 x (size 1984 + Hdr 64)) + 790720 =   4869 KB                                 

    Create: Default TX  1:0  - Memory used (MBUFs 2048 x (size 1984 + Hdr 64)) + 790720 =   4869 KB                                 
    Create: Range TX    1:0  - Memory used (MBUFs 2048 x (size 1984 + Hdr 64)) + 790720 =   4869 KB                                 
    Create: Sequence TX 1:0  - Memory used (MBUFs 2048 x (size 1984 + Hdr 64)) + 790720 =   4869 KB                                 
    Create: Special TX  1:0  - Memory used (MBUFs   64 x (size 1984 + Hdr 64)) + 790720 =    901 KB                                 

                                                                       Port memory used =  20373 KB                                 
                                                                      Total memory used =  40746 KB                                 
Port  0: Link Up - speed 10000 Mbps - full-duplex <Enable promiscuous mode>                                                         
Port  1: Link Up - speed 10000 Mbps - full-duplex <Enable promiscuous mode>                                                         


=== Display processing on lcore 0                                                                                                   
=== RX processing on lcore  1, rxcnt 1, port/qid, 0/0                                                                               
=== RX processing on lcore  2, rxcnt 1, port/qid, 1/0                                                                               
=== TX processing on lcore  3, txcnt 1, port/qid, 0/0                                                                               
=== TX processing on lcore  4, txcnt 1, port/qid, 1/0

               Pktgen created by Keith Wiles -- >>> Powered by Intel® DPDK <<<
```
------------------
```
- Ports 0-3 of 6   ** Main Page **  Copyright (c) <2010-2016>, Intel Corporation. Powered by Intel® DPDK
  Flags:Port    :   P-------------:0   P-------------:1
Link State      :      <UP-10000-FD>      <UP-10000-FD>                                          ---TotalRate---
Pkts/s  Rx      :                  0                  0                                                        0
        Tx      :                  0                  0                                                        0
MBits/s Rx/Tx   :                0/0                0/0                                                      0/0
Broadcast       :                  0                  0
Multicast       :                  0                  0
  64 Bytes      :                  0                  0
  65-127        :                  0                  0
  128-255       :                  0                  0
  256-511       :                  0                  0
  512-1023      :                  0                  0
  1024-1518     :                  0                  0
Runts/Jumbos    :                0/0                0/0
Errors Rx/Tx    :                0/0                0/0
Total Rx Pkts   :                  0                  0
      Tx Pkts   :                  0                  0
      Rx MBs    :                  0                  0
      Tx MBs    :                  0                  0
ARP/ICMP Pkts   :                0/0                0/0
                :
Tx Count/% Rate :       Forever/100%       Forever/100%
PktSize/Tx Burst:              64/16              64/16
Src/Dest Port   :          1234/5678          1234/5678
Pkt Type:VLAN ID:      IPv4/TCP:0001      IPv4/TCP:0001
Dst  IP Address :        192.168.1.1        192.168.0.1
Src  IP Address :     192.168.0.1/24     192.168.1.1/24
Dst MAC Address :  90:e2:ba:5a:f7:91  90:e2:ba:5a:f7:90
Src MAC Address :  90:e2:ba:5a:f7:90  90:e2:ba:5a:f7:91
-- Pktgen Ver:2.9.x(DPDK-2.X.0) -------------------------------------------------------------------------------------















Pktgen> quit
$
```
------------------------------------------------------------------------
```
   *** Help Information for Pktgen ***         Copyright (c) <2010-2016>, Intel Corporation.

set <portlist> <xxx> value         - Set a few port values
  <portlist>                       - a list of ports as 2,4,6-9,12 or the word 'all'
  <xxx>          count             - number of packets to transmit
                 size              - size of the packet to transmit
                 rate              - Packet rate in percentage
                 burst             - number of packets in a burst
                 sport             - Source port number for TCP
                 dport             - Destination port number for TCP
                 prime             - Set the number of packets to send on prime command
                 seqCnt            - Set the number of packet in the sequence to send
                 dump              - Dump the next <value> received packets to the screen
seq <seq#> <portlist> dst-Mac src-Mac dst-IP src-IP sport dport ipv4|ipv6 udp|tcp|icmp vid pktsize
                                   - Set the sequence packet information, make sure the src-IP
                                     has the netmask value eg 1.2.3.4/24
save <path-to-file>                - Save a configuration file using the filename
load <path-to-file>                - Load a command/script file from the given path
ppp [1-6]                          - Set the number of ports displayed per page
icmp.echo <portlist> <state>       - Enable/disable ICMP echo responses per port
send arp req|grat <portlist>       - Send a ARP request or gratuitous ARP on a set of ports
set mac <portlist> etheraddr       - Set MAC addresses 00:11:22:33:44:55
                                     You can use 0011:2233:4455 format as well
mac_from_arp <state>               - Set the option to get MAC from ARP request
proto udp|tcp|icmp <portlist>      - Set the packet protocol to UDP or TCP or ICMP per port
type ipv4|ipv6|vlan <portlist>     - Set the packet type to IPv4 or IPv6 or VLAN
set ip src|dst <portlist> ipaddr   - Set IP addresses
geometry <geom>                    - Set the display geometry Columns by Rows (ColxRow)
capture <portlist> <state>         - Enable/disable packet capturing on a portlist
rxtap <portlist> <state>           - Enable/disable Rx tap interface support pg_rxtapN
txtap <portlist> <state>           - Enable/disable Tx tap interface support pg_txtapN
vlan <portlist> <state>            - Enable/disable sending VLAN ID in packets
vlanid <portlist> <vlanid>         - Set the VLAN ID for the portlist
mpls <portlist> <state>            - Enable/disable sending MPLS entry in packets
mpls_entry <portlist> <entry>      - Set the MPLS entry for the portlist (must be specified in hex)
qinq <portlist> <state>            - Enable/disable sending Q-in-Q header in packets
qinqids <portlist> <id1> <id2>     - Set the Q-in-Q ID's for the portlist
gre <portlist> <state>             - Enable/disable GRE with IPv4 payload
gre_eth <portlist> <state>         - Enable/disable GRE with Ethernet frame payload
gre_key <portlist> <state>         - Set the GRE key
pcap <portlist> <state>            - Enable or Disable sending pcap packets on a portlist
pcap.show                          - Show the PCAP information
pcap.index                         - Move the PCAP file index to the given packet number,  0 - rewind, -1 - end of file
pcap.filter <portlist> <string>    - PCAP filter string to filter packets on receive
script <filename>                  - Execute the Lua script code in file (www.lua.org).
ping4 <portlist>                   - Send a IPv4 ICMP echo request on the given portlist
page [0-7]|main|range|config|seq|pcap|next|cpu|rnd- Show the port pages or configuration or sequence page
     [0-7]                         - Page of different ports
     main                          - Display page zero
     range                         - Display the range packet page
     config                        - Display the configuration page (not used)
     pcap                          - Display the pcap page
     cpu                           - Display some information about the CPU system
     next                          - Display next page of PCAP packets.
     sequence | seq                - sequence will display a set of packets for a given port
                                     Note: use the 'port <number>' to display a new port sequence
     rnd                           - Display the random bitfields to packets for a given port
                                     Note: use the 'port <number>' to display a new port sequence
     log                           - Display the log messages page
port <number>                      - Sets the sequence of packets to display for a given port
process <portlist> <state>         - Enable or Disable processing of ARP/ICMP/IPv4/IPv6 packets
garp <portlist> <state>            - Enable or Disable GARP packet processing and update MAC address
blink <portlist> <state>           - Blink the link led on the given port list
rnd <portlist> <idx> <off> <mask>  - Set random mask for all transmitted packets from portlist
                                     idx: random mask slot
                                     off: offset in packets, where to apply mask
                                     mask: up to 32 bit long mask specification (empty to disable):
                                       0: bit will be 0
                                       1: bit will be 1
                                       .: bit will be ignored (original value is retained)
                                       X: bit will get random value
theme <state>                      - Enable or Disable the theme
theme <item> <fg> <bg> <attr>      - Set color for item with fg/bg color and attribute value
theme.show                         - List the item strings, colors and attributes to the items
theme.save <filename>              - Save the current color theme to a file
start <portlist>                   - Start transmitting packets
stop <portlist>                    - Stop transmitting packets
stp                                - Stop all ports from transmitting
str                                - Start all ports transmitting
screen stop|start                  - stop/start updating the screen and unlock/lock window
off                                - screen off shortcut
on                                 - screen on shortcut
prime <portlist>                   - Transmit N packets on each port listed. See set prime command above
delay milliseconds                 - Wait a number of milliseconds for scripting commands
sleep seconds                      - Wait a number of seconds for scripting commands
dev.list                           - Show the device whitelist/blacklist/Virtual
pci.list                           - Show all the PCI devices
clear <portlist>                   - Clear the statistics
clr                                - Clear all Statistices
cls                                - Clear the screen
reset <portlist>                   - Reset the configuration to the default
rst                                - Reset the configuration for all ports
help                               - Display this help message
quit                               - Quit the Pktgen program
  -- Setup the packet range values --
dst.mac start <portlist> etheraddr - Set destination MAC address start
src.mac start <portlist> etheraddr - Set source MAC address start
src.ip start <portlist> ipaddr     - Set source IP start address
src.ip min <portlist> ipaddr       - Set source IP minimum address
src.ip max <portlist> ipaddr       - Set source IP maximum address
src.ip inc <portlist> ipaddr       - Set source IP increment address
dst.ip start <portlist> ipaddr     - Set destination IP start address
dst.ip min <portlist> ipaddr       - Set destination IP minimum address
dst.ip max <portlist> ipaddr       - Set destination IP maximum address
dst.ip inc <portlist> ipaddr       - Set destination IP increment address
src.port start <portlist> value    - Set source port start address
src.port min <portlist> value      - Set source port minimum address
src.port max <portlist> value      - Set source port maximum address
src.port inc <portlist> value      - Set source port increment address
dst.port start <portlist> value    - Set source port start address
dst.port min <portlist> value      - Set source port minimum address
dst.port max <portlist> value      - Set source port maximum address
dst.port inc <portlist> value      - Set source port increment address
vlan.id start <portlist> value     - Set vlan id start address
vlan.id min <portlist> value       - Set vlan id minimum address
vlan.id max <portlist> value       - Set vlan id maximum address
vlan.id inc <portlist> value       - Set vlan id increment address
pkt.size start <portlist> value    - Set vlan id start address
pkt.size min <portlist> value      - Set vlan id minimum address
pkt.size max <portlist> value      - Set vlan id maximum address
pkt.size inc <portlist> value      - Set vlan id increment address
range <portlist> <state>           - Enable or Disable the given portlist for sending a range of packets
       Flags: P--------------- - Promiscuous mode enabled
               E               - ICMP Echo enabled
                A              - Send ARP Request flag
                 G             - Send Gratuitous ARP flag
                  C            - TX Cleanup flag
                   p           - PCAP enabled flag
                    S          - Send Sequence packets enabled
                     R         - Send Range packets enabled
                      D        - DPI Scanning enabled (If Enabled)
                       I       - Process packets on input enabled
                        T      - Using TAP interface for this port
                         V     - Send VLAN ID tag
                         M     - Send MPLS header
                         Q     - Send Q-in-Q tags
                          g    - Process GARP packets
                           g   - Perform GRE with IPv4 payload
                           G   - Perform GRE with Ethernet payload
                            C  - Capture received packets
                             R - Random bitfield(s) are applied
Notes: <state>       - Use enable|disable or on|off to set the state.
       <portlist>    - a list of ports (no spaces) as 2,4,6-9,12 or 3-5,8 or 5 or the word 'all'
       Color best seen on a black background for now
       To see a set of example Lua commands see the files in wr-examples/pktgen/test

```
---------------------------------------------------------------------------
```
\  Port 0 of 4    ** PCAP Page **   Copyright (c) <2010-2016>, Intel Corporation, Powered by Intel® DPDK
Port: 0, PCAP Count: 0 of 9716, skipped 0
  Seq            Dst MAC           Src MAC            Dst IP              Src IP    Port S/D  Protocol:VLAN Size-FCS
    0:    0014:2273:0a68    000f:ea34:177e    192.168.119.23     192.168.117.213    43934/53  IPv4/UDP:   0   73
    1:    000f:ea34:177e    0014:2273:0a68   192.168.117.213      192.168.119.23    53/43934  IPv4/UDP:   0  445
    2:    0013:720b:515b    000f:ea34:177e    209.131.36.158     192.168.117.213    34918/80  IPv4/UDP:   0   74
    3:    000f:ea34:177e    0013:720b:515b   192.168.117.213      209.131.36.158    80/34918  IPv4/UDP:   0   78
    4:    0013:720b:515b    000f:ea34:177e    209.131.36.158     192.168.117.213    34918/80  IPv4/UDP:   0   66
    5:    0013:720b:515b    000f:ea34:177e    209.131.36.158     192.168.117.213    34918/80  IPv4/UDP:   0  842
    6:    000f:ea34:177e    0013:720b:515b   192.168.117.213      209.131.36.158    80/34918  IPv4/UDP:   0   66
    7:    000f:ea34:177e    0013:720b:515b   192.168.117.213      209.131.36.158    80/34918  IPv4/UDP:   0 1155
    8:    0013:720b:515b    000f:ea34:177e    209.131.36.158     192.168.117.213    34918/80  IPv4/UDP:   0   66
    9:    0014:2273:0a68    000f:ea34:177e    192.168.119.23     192.168.117.213    47919/53  IPv4/UDP:   0   72
   10:    0013:720b:515b    000f:ea34:177e    209.131.36.158     192.168.117.213    34918/80  IPv4/UDP:   0   66
   11:    000f:ea34:177e    0013:720b:515b   192.168.117.213      209.131.36.158    80/34918  IPv4/UDP:   0   66
   12:    000f:ea34:177e    0013:720b:515b   192.168.117.213      209.131.36.158    80/34918  IPv4/UDP:   0 1090
   13:    0013:720b:515b    000f:ea34:177e    209.131.36.158     192.168.117.213    34918/80  IPv4/UDP:   0   54
   14:    000f:ea34:177e    0014:2273:0a68   192.168.117.213      192.168.119.23    53/47919  IPv4/UDP:   0  352
   15:    0013:720b:515b    000f:ea34:177e     203.84.217.32     192.168.117.213    40202/80  IPv4/UDP:   0   74
   16:    000f:ea34:177e    0013:720b:515b   192.168.117.213       203.84.217.32    80/40202  IPv4/UDP:   0   78
   17:    0013:720b:515b    000f:ea34:177e     203.84.217.32     192.168.117.213    40202/80  IPv4/UDP:   0   66
   18:    0013:720b:515b    000f:ea34:177e     203.84.217.32     192.168.117.213    40202/80  IPv4/UDP:   0  846
   19:    000f:ea34:177e    0013:720b:515b   192.168.117.213       203.84.217.32    80/40202  IPv4/UDP:   0   66
   20:    000f:ea34:177e    0013:720b:515b   192.168.117.213       203.84.217.32    80/40202  IPv4/UDP:   0 1486
   21:    0013:720b:515b    000f:ea34:177e     203.84.217.32     192.168.117.213    40202/80  IPv4/UDP:   0   66
   22:    000f:ea34:177e    0013:720b:515b   192.168.117.213       203.84.217.32    80/40202  IPv4/UDP:   0  104
   23:    0013:720b:515b    000f:ea34:177e     203.84.217.32     192.168.117.213    40202/80  IPv4/UDP:   0   66
   24:    000f:ea34:177e    0013:720b:515b   192.168.117.213       203.84.217.32    80/40202  IPv4/UDP:   0 1466

- Pktgen Ver:2.9.x(DPDK-2.X.0) --------------------------------------------------------------------------------------










pktgen> quit
```
------------------------------------------------------------------------------------------
-- Example command lines.
```
./app/pktgen -c 1ff -n 3 --proc-type auto --socket-mem 256,256 -- -P -m "[1:3].0, [2:4].1, [5:7].2, [6:8].3" -s 0:pcap/large.pcap
./app/pktgen -c 1f -n 3 --proc-type auto --socket-mem 128,128 --file-prefix pg -- -P -m "[1:3].0, [2:4].1, [5:7].2, [6:8].3" -s 0:pcap/test1.pcap -s 1:pcap/large.pcap
./app/pktgen -c 1f -n 3 --proc-type auto --socket-mem 128,128 --file-prefix pg -- -P -m "[1:3].0, [2:4].1, [5:7].2, [6:8].3" -s 0:pcap/test1.pcap -s 1:pcap/large.pcap
./app/pktgen -c e -n 3 --proc-type auto --socket-mem 128,128 --file-prefix pg -- -P -m "2.0, 3.1"
./app/pktgen -c 1ff -n 3 --proc-type auto --socket-mem 256,256 -- -P -m "[1:3].0, [2:4].1, [5:7].2, [6:8].3"
```

A command line passing in a pktgen/test/set_seq.pkt file to help initialize pktgen with some
default values and configurations. You can also replace the filename using the '-f' command
with a Lua script file ending in .lua instead of .pkt. BTW, if the filename ends in anything
other then .lua it is treated as a .pkt file.
 
`./app/pktgen -c 1f -n 3 --proc-type auto --socket-mem 128,128 -- -P -m "[1:3].0, [2:4].1" -f test/set_seq.pkt`

-- test/set_seq.pkt
```
seq 0 all 0000:4455:6677 0000:1234:5678 10.11.0.1 10.10.0.1/16 5 6 ipv4 udp 1 128
set all seqCnt 1
```
The set_seq.pkt command file can also be one of the files in pktgen/test directory,
which are Lua based scripts instead of command line scripts as in set_seq.pkt file.

-- test/set_seq.lua
The Lua version is easier to remember the layout of the agruments if you want to
use that one instead of set_seq.pkt file.

```
./app/pktgen -c 1f -n 3 --proc-type auto --socket-mem 128,128 -- -P -m "[1:3].0, [2:4].1" -f test/set_seq.lua`

-- The '--' is a comment in Lua
local seq_table = {			-- entries can be in any order
    ["eth_dst_addr"] = "0011:4455:6677",
    ["eth_src_addr"] = "0011:1234:5678",
    ["ip_dst_addr"] = "10.12.0.1",
    ["ip_src_addr"] = "10.12.0.1/16",	-- the 16 is the size of the mask value
    ["sport"] = 9,			-- Standard port numbers
    ["dport"] = 10,			-- Standard port numbers
    ["ethType"] = "ipv4",	-- ipv4|ipv6
    ["ipProto"] = "udp",	-- udp|tcp|icmp
    ["vlanid"] = 1,			-- 1 - 4095
    ["pktSize"] = 128		-- 64 - 1518
  };
-- seqTable( seq#, portlist, table );
pktgen.seqTable(0, "all", seq_table );
pktgen.set("all", "seqCnt", 1);
```
------------------------------------------------------------------------------------------
-- Two Pktgens running on the same machine with connected via a loopback ports

Look at the two new files pktgen-master.sh and pktgen-slave.sh for some help on
the configuration to run two pktgens at the same time on the same machine.

------------------------------------------------------------------------------------------
-- Socket Support for Pktgen.

Pktgen has a TCP socket connection to allow you to control Pktgen from a remote
program or console. The TCP connection is using port 0x5606 or 22022 and presents
a Lua command shell interface. If you telnet to the machine running Pktgen on port
22022 you will get a lua command shell like interface. This interface does not have
a command line prompt, but you can issue Lua code or load script files from the local
disk of the machine. You can also send programs to the remote Pktgen machine to
load scripts from a remote location.

One method to connect to Pktgen is using telnet, but another method would be to
use 'socat' program on a Linux machine. The socat program is very powerfull application
and can do a lot of things. I used socat to debug Pktgen using the following
command, which gives me a readline inteface to Pktgen's socket interface.

$ socat -d -d READLINE TCP4:localhost:22022

'You will see socat create the connection and then wait for Lua command scripts for you'
To exit this command type Control-D to exit and close the connection.

You can also just send Pktgen a script file and display the ouptut.

---------
$ socat - TCP4:localhost:22022 < test/hello-world.lua 

Lua Vesrion      : Lua 5.2
Pktgen Version   : 2.9.x
Pktgen Copyright : Copyright (c) `<2010-2016>`, Intel Corporation
Pktgen Authors   : Keith Wiles @ Intel Corporation

Hello World!!!!
--------

Here is the program I sent Pktgen:

$ cat test/hello-world.lua 
package.path = package.path ..";?.lua;test/?.lua;app/?.lua;"

printf("Lua Vesrion      : %s\n", pktgen.info.Lua_Version);
printf("Pktgen Version   : %s\n", pktgen.info.Pktgen_Version);
printf("Pktgen Copyright : %s\n", pktgen.info.Pktgen_Copyright);
printf("Pktgen Authors   : %s\n", pktgen.info.Pktgen_Authors);

printf("\nHello World!!!!\n");
-----------

Here is a command from my Mac Book pro laptop, which loads a file from the local
disk where Pktgen is running and then we execute the file with 'f()'.

------------------
$ socat READLINE TCP4:172.25.40.163:22022
f,e = loadfile("test/hello-world.lua")
f()
Lua Version      : Lua 5.2
Pktgen Version   : 2.9.x
Pktgen Copyright : Copyright (c) `<2010-2016>`, Intel Corporation
Pktgen Authors   : Keith Wiles @ Intel Corporation

Hello World!!!!
<Control-D>
------------------

You can also just send it commands via echo.

-----------------
$ echo "f,e = loadfile('test/hello-world.lua'); f();"| socat - TCP4:172.25.40.163:22022
Lua Version      : Lua 5.2
Pktgen Version   : 2.9.x
Pktgen Copyright : Copyright (c) `<2010-2016>`, Intel Corporation
Pktgen Authors   : Keith Wiles @ Intel Corporation

Hello World!!!!
----------------------

Keith Wiles @ Intel Corporation