-
Notifications
You must be signed in to change notification settings - Fork 2
/
cmdline.c
18051 lines (16198 loc) · 546 KB
/
cmdline.c
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
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2010-2016 Intel Corporation.
* Copyright(c) 2014 6WIND S.A.
*/
#include <stdarg.h>
#include <errno.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#include <inttypes.h>
#include <sys/queue.h>
#include <rte_common.h>
#include <rte_byteorder.h>
#include <rte_log.h>
#include <rte_debug.h>
#include <rte_cycles.h>
#include <rte_memory.h>
#include <rte_memzone.h>
#include <rte_malloc.h>
#include <rte_launch.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_lcore.h>
#include <rte_branch_prediction.h>
#include <rte_ring.h>
#include <rte_mempool.h>
#include <rte_interrupts.h>
#include <rte_pci.h>
#include <rte_ether.h>
#include <rte_ethdev.h>
#include <rte_string_fns.h>
#include <rte_devargs.h>
#include <rte_flow.h>
#ifdef RTE_LIB_GRO
#include <rte_gro.h>
#endif
#include <rte_mbuf_dyn.h>
#include <cmdline_rdline.h>
#include <cmdline_parse.h>
#include <cmdline_parse_num.h>
#include <cmdline_parse_string.h>
#include <cmdline_parse_ipaddr.h>
#include <cmdline_parse_etheraddr.h>
#include <cmdline_socket.h>
#include <cmdline.h>
#ifdef RTE_NET_BOND
#include <rte_eth_bond.h>
#include <rte_eth_bond_8023ad.h>
#endif
#if defined RTE_BUS_DPAA && defined RTE_NET_DPAA
#include <rte_pmd_dpaa.h>
#endif
#ifdef RTE_NET_IXGBE
#include <rte_pmd_ixgbe.h>
#endif
#ifdef RTE_NET_I40E
#include <rte_pmd_i40e.h>
#endif
#ifdef RTE_NET_BNXT
#include <rte_pmd_bnxt.h>
#endif
#include "testpmd.h"
#include "cmdline_mtr.h"
#include "cmdline_tm.h"
#include "bpf_cmd.h"
static struct cmdline *testpmd_cl;
static void cmd_reconfig_device_queue(portid_t id, uint8_t dev, uint8_t queue);
/* *** Help command with introduction. *** */
struct cmd_help_brief_result {
cmdline_fixed_string_t help;
};
static void cmd_help_brief_parsed(__rte_unused void *parsed_result,
struct cmdline *cl,
__rte_unused void *data)
{
cmdline_printf(
cl,
"\n"
"Help is available for the following sections:\n\n"
" help control : Start and stop forwarding.\n"
" help display : Displaying port, stats and config "
"information.\n"
" help config : Configuration information.\n"
" help ports : Configuring ports.\n"
" help registers : Reading and setting port registers.\n"
" help filters : Filters configuration help.\n"
" help traffic_management : Traffic Management commands.\n"
" help devices : Device related cmds.\n"
" help all : All of the above sections.\n\n"
);
}
cmdline_parse_token_string_t cmd_help_brief_help =
TOKEN_STRING_INITIALIZER(struct cmd_help_brief_result, help, "help");
cmdline_parse_inst_t cmd_help_brief = {
.f = cmd_help_brief_parsed,
.data = NULL,
.help_str = "help: Show help",
.tokens = {
(void *)&cmd_help_brief_help,
NULL,
},
};
/* *** Help command with help sections. *** */
struct cmd_help_long_result {
cmdline_fixed_string_t help;
cmdline_fixed_string_t section;
};
static void cmd_help_long_parsed(void *parsed_result,
struct cmdline *cl,
__rte_unused void *data)
{
int show_all = 0;
struct cmd_help_long_result *res = parsed_result;
if (!strcmp(res->section, "all"))
show_all = 1;
if (show_all || !strcmp(res->section, "control")) {
cmdline_printf(
cl,
"\n"
"Control forwarding:\n"
"-------------------\n\n"
"start\n"
" Start packet forwarding with current configuration.\n\n"
"start tx_first\n"
" Start packet forwarding with current config"
" after sending one burst of packets.\n\n"
"stop\n"
" Stop packet forwarding, and display accumulated"
" statistics.\n\n"
"quit\n"
" Quit to prompt.\n\n"
);
}
if (show_all || !strcmp(res->section, "display")) {
cmdline_printf(
cl,
"\n"
"Display:\n"
"--------\n\n"
"show port (info|stats|summary|xstats|fdir|dcb_tc) (port_id|all)\n"
" Display information for port_id, or all.\n\n"
"show port info (port_id) representor\n"
" Show supported representors for a specific port\n\n"
"show port port_id (module_eeprom|eeprom)\n"
" Display the module EEPROM or EEPROM information for port_id.\n\n"
"show port X rss reta (size) (mask0,mask1,...)\n"
" Display the rss redirection table entry indicated"
" by masks on port X. size is used to indicate the"
" hardware supported reta size\n\n"
"show port (port_id) rss-hash [key]\n"
" Display the RSS hash functions and RSS hash key of port\n\n"
"clear port (info|stats|xstats|fdir) (port_id|all)\n"
" Clear information for port_id, or all.\n\n"
"show (rxq|txq) info (port_id) (queue_id)\n"
" Display information for configured RX/TX queue.\n\n"
"show config (rxtx|cores|fwd|rxoffs|rxpkts|txpkts)\n"
" Display the given configuration.\n\n"
"read rxd (port_id) (queue_id) (rxd_id)\n"
" Display an RX descriptor of a port RX queue.\n\n"
"read txd (port_id) (queue_id) (txd_id)\n"
" Display a TX descriptor of a port TX queue.\n\n"
"ddp get list (port_id)\n"
" Get ddp profile info list\n\n"
"ddp get info (profile_path)\n"
" Get ddp profile information.\n\n"
"show vf stats (port_id) (vf_id)\n"
" Display a VF's statistics.\n\n"
"clear vf stats (port_id) (vf_id)\n"
" Reset a VF's statistics.\n\n"
"show port (port_id) pctype mapping\n"
" Get flow ptype to pctype mapping on a port\n\n"
"show port meter stats (port_id) (meter_id) (clear)\n"
" Get meter stats on a port\n\n"
"show fwd stats all\n"
" Display statistics for all fwd engines.\n\n"
"clear fwd stats all\n"
" Clear statistics for all fwd engines.\n\n"
"show port (port_id) rx_offload capabilities\n"
" List all per queue and per port Rx offloading"
" capabilities of a port\n\n"
"show port (port_id) rx_offload configuration\n"
" List port level and all queue level"
" Rx offloading configuration\n\n"
"show port (port_id) tx_offload capabilities\n"
" List all per queue and per port"
" Tx offloading capabilities of a port\n\n"
"show port (port_id) tx_offload configuration\n"
" List port level and all queue level"
" Tx offloading configuration\n\n"
"show port (port_id) tx_metadata\n"
" Show Tx metadata value set"
" for a specific port\n\n"
"show port (port_id) ptypes\n"
" Show port supported ptypes"
" for a specific port\n\n"
"show device info (<identifier>|all)"
" Show general information about devices probed.\n\n"
"show port (port_id) rxq|txq (queue_id) desc (desc_id) status"
" Show status of rx|tx descriptor.\n\n"
"show port (port_id) rxq (queue_id) desc used count\n"
" Show current number of filled receive"
" packet descriptors.\n\n"
"show port (port_id) macs|mcast_macs"
" Display list of mac addresses added to port.\n\n"
"show port (port_id) flow transfer proxy\n"
" Display proxy port to manage transfer flows\n\n"
"show port (port_id) fec capabilities"
" Show fec capabilities of a port.\n\n"
"show port (port_id) fec_mode"
" Show fec mode of a port.\n\n"
"show port (port_id) flow_ctrl"
" Show flow control info of a port.\n\n"
);
}
if (show_all || !strcmp(res->section, "config")) {
cmdline_printf(
cl,
"\n"
"Configuration:\n"
"--------------\n"
"Configuration changes only become active when"
" forwarding is started/restarted.\n\n"
"set default\n"
" Reset forwarding to the default configuration.\n\n"
"set verbose (level)\n"
" Set the debug verbosity level X.\n\n"
"set log global|(type) (level)\n"
" Set the log level.\n\n"
"set nbport (num)\n"
" Set number of ports.\n\n"
"set nbcore (num)\n"
" Set number of cores.\n\n"
"set coremask (mask)\n"
" Set the forwarding cores hexadecimal mask.\n\n"
"set portmask (mask)\n"
" Set the forwarding ports hexadecimal mask.\n\n"
"set burst (num)\n"
" Set number of packets per burst.\n\n"
"set burst tx delay (microseconds) retry (num)\n"
" Set the transmit delay time and number of retries,"
" effective when retry is enabled.\n\n"
"set rxoffs (x[,y]*)\n"
" Set the offset of each packet segment on"
" receiving if split feature is engaged."
" Affects only the queues configured with split"
" offloads.\n\n"
"set rxpkts (x[,y]*)\n"
" Set the length of each segment to scatter"
" packets on receiving if split feature is engaged."
" Affects only the queues configured with split"
" offloads.\n\n"
"set txpkts (x[,y]*)\n"
" Set the length of each segment of TXONLY"
" and optionally CSUM packets.\n\n"
"set txsplit (off|on|rand)\n"
" Set the split policy for the TX packets."
" Right now only applicable for CSUM and TXONLY"
" modes\n\n"
"set txtimes (x, y)\n"
" Set the scheduling on timestamps"
" timings for the TXONLY mode\n\n"
"set corelist (x[,y]*)\n"
" Set the list of forwarding cores.\n\n"
"set portlist (x[,y]*)\n"
" Set the list of forwarding ports.\n\n"
"set port setup on (iterator|event)\n"
" Select how attached port is retrieved for setup.\n\n"
"set tx loopback (port_id) (on|off)\n"
" Enable or disable tx loopback.\n\n"
"set all queues drop (port_id) (on|off)\n"
" Set drop enable bit for all queues.\n\n"
"set vf split drop (port_id) (vf_id) (on|off)\n"
" Set split drop enable bit for a VF from the PF.\n\n"
"set vf mac antispoof (port_id) (vf_id) (on|off).\n"
" Set MAC antispoof for a VF from the PF.\n\n"
"set macsec offload (port_id) on encrypt (on|off) replay-protect (on|off)\n"
" Enable MACsec offload.\n\n"
"set macsec offload (port_id) off\n"
" Disable MACsec offload.\n\n"
"set macsec sc (tx|rx) (port_id) (mac) (pi)\n"
" Configure MACsec secure connection (SC).\n\n"
"set macsec sa (tx|rx) (port_id) (idx) (an) (pn) (key)\n"
" Configure MACsec secure association (SA).\n\n"
"set vf broadcast (port_id) (vf_id) (on|off)\n"
" Set VF broadcast for a VF from the PF.\n\n"
"vlan set stripq (on|off) (port_id,queue_id)\n"
" Set the VLAN strip for a queue on a port.\n\n"
"set vf vlan stripq (port_id) (vf_id) (on|off)\n"
" Set the VLAN strip for all queues in a pool for a VF from the PF.\n\n"
"set vf vlan insert (port_id) (vf_id) (vlan_id)\n"
" Set VLAN insert for a VF from the PF.\n\n"
"set vf vlan antispoof (port_id) (vf_id) (on|off)\n"
" Set VLAN antispoof for a VF from the PF.\n\n"
"set vf vlan tag (port_id) (vf_id) (on|off)\n"
" Set VLAN tag for a VF from the PF.\n\n"
"set vf tx max-bandwidth (port_id) (vf_id) (bandwidth)\n"
" Set a VF's max bandwidth(Mbps).\n\n"
"set vf tc tx min-bandwidth (port_id) (vf_id) (bw1, bw2, ...)\n"
" Set all TCs' min bandwidth(%%) on a VF.\n\n"
"set vf tc tx max-bandwidth (port_id) (vf_id) (tc_no) (bandwidth)\n"
" Set a TC's max bandwidth(Mbps) on a VF.\n\n"
"set tx strict-link-priority (port_id) (tc_bitmap)\n"
" Set some TCs' strict link priority mode on a physical port.\n\n"
"set tc tx min-bandwidth (port_id) (bw1, bw2, ...)\n"
" Set all TCs' min bandwidth(%%) for all PF and VFs.\n\n"
"vlan set (strip|filter|qinq_strip|extend) (on|off) (port_id)\n"
" Set the VLAN strip or filter or qinq strip or extend\n\n"
"vlan set (inner|outer) tpid (value) (port_id)\n"
" Set the VLAN TPID for Packet Filtering on"
" a port\n\n"
"rx_vlan add (vlan_id|all) (port_id)\n"
" Add a vlan_id, or all identifiers, to the set"
" of VLAN identifiers filtered by port_id.\n\n"
"rx_vlan rm (vlan_id|all) (port_id)\n"
" Remove a vlan_id, or all identifiers, from the set"
" of VLAN identifiers filtered by port_id.\n\n"
"rx_vlan add (vlan_id) port (port_id) vf (vf_mask)\n"
" Add a vlan_id, to the set of VLAN identifiers"
"filtered for VF(s) from port_id.\n\n"
"rx_vlan rm (vlan_id) port (port_id) vf (vf_mask)\n"
" Remove a vlan_id, to the set of VLAN identifiers"
"filtered for VF(s) from port_id.\n\n"
"rx_vxlan_port add (udp_port) (port_id)\n"
" Add an UDP port for VXLAN packet filter on a port\n\n"
"rx_vxlan_port rm (udp_port) (port_id)\n"
" Remove an UDP port for VXLAN packet filter on a port\n\n"
"tx_vlan set (port_id) vlan_id[, vlan_id_outer]\n"
" Set hardware insertion of VLAN IDs (single or double VLAN "
"depends on the number of VLAN IDs) in packets sent on a port.\n\n"
"tx_vlan set pvid port_id vlan_id (on|off)\n"
" Set port based TX VLAN insertion.\n\n"
"tx_vlan reset (port_id)\n"
" Disable hardware insertion of a VLAN header in"
" packets sent on a port.\n\n"
"csum set (ip|udp|tcp|sctp|outer-ip|outer-udp) (hw|sw) (port_id)\n"
" Select hardware or software calculation of the"
" checksum when transmitting a packet using the"
" csum forward engine.\n"
" ip|udp|tcp|sctp always concern the inner layer.\n"
" outer-ip concerns the outer IP layer in"
" outer-udp concerns the outer UDP layer in"
" case the packet is recognized as a tunnel packet by"
" the forward engine (vxlan, gre and ipip are supported)\n"
" Please check the NIC datasheet for HW limits.\n\n"
"csum parse-tunnel (on|off) (tx_port_id)\n"
" If disabled, treat tunnel packets as non-tunneled"
" packets (treat inner headers as payload). The port\n"
" argument is the port used for TX in csum forward"
" engine.\n\n"
"csum show (port_id)\n"
" Display tx checksum offload configuration\n\n"
"tso set (segsize) (portid)\n"
" Enable TCP Segmentation Offload in csum forward"
" engine.\n"
" Please check the NIC datasheet for HW limits.\n\n"
"tso show (portid)"
" Display the status of TCP Segmentation Offload.\n\n"
#ifdef RTE_LIB_GRO
"set port (port_id) gro on|off\n"
" Enable or disable Generic Receive Offload in"
" csum forwarding engine.\n\n"
"show port (port_id) gro\n"
" Display GRO configuration.\n\n"
"set gro flush (cycles)\n"
" Set the cycle to flush GROed packets from"
" reassembly tables.\n\n"
#endif
#ifdef RTE_LIB_GSO
"set port (port_id) gso (on|off)"
" Enable or disable Generic Segmentation Offload in"
" csum forwarding engine.\n\n"
"set gso segsz (length)\n"
" Set max packet length for output GSO segments,"
" including packet header and payload.\n\n"
"show port (port_id) gso\n"
" Show GSO configuration.\n\n"
#endif
"set fwd (%s)\n"
" Set packet forwarding mode.\n\n"
"mac_addr add (port_id) (XX:XX:XX:XX:XX:XX)\n"
" Add a MAC address on port_id.\n\n"
"mac_addr remove (port_id) (XX:XX:XX:XX:XX:XX)\n"
" Remove a MAC address from port_id.\n\n"
"mac_addr set (port_id) (XX:XX:XX:XX:XX:XX)\n"
" Set the default MAC address for port_id.\n\n"
"mac_addr add port (port_id) vf (vf_id) (mac_address)\n"
" Add a MAC address for a VF on the port.\n\n"
"set vf mac addr (port_id) (vf_id) (XX:XX:XX:XX:XX:XX)\n"
" Set the MAC address for a VF from the PF.\n\n"
"set eth-peer (port_id) (peer_addr)\n"
" set the peer address for certain port.\n\n"
"set port (port_id) uta (mac_address|all) (on|off)\n"
" Add/Remove a or all unicast hash filter(s)"
"from port X.\n\n"
"set promisc (port_id|all) (on|off)\n"
" Set the promiscuous mode on port_id, or all.\n\n"
"set allmulti (port_id|all) (on|off)\n"
" Set the allmulti mode on port_id, or all.\n\n"
"set vf promisc (port_id) (vf_id) (on|off)\n"
" Set unicast promiscuous mode for a VF from the PF.\n\n"
"set vf allmulti (port_id) (vf_id) (on|off)\n"
" Set multicast promiscuous mode for a VF from the PF.\n\n"
"set flow_ctrl rx (on|off) tx (on|off) (high_water)"
" (low_water) (pause_time) (send_xon) mac_ctrl_frame_fwd"
" (on|off) autoneg (on|off) (port_id)\n"
"set flow_ctrl rx (on|off) (portid)\n"
"set flow_ctrl tx (on|off) (portid)\n"
"set flow_ctrl high_water (high_water) (portid)\n"
"set flow_ctrl low_water (low_water) (portid)\n"
"set flow_ctrl pause_time (pause_time) (portid)\n"
"set flow_ctrl send_xon (send_xon) (portid)\n"
"set flow_ctrl mac_ctrl_frame_fwd (on|off) (portid)\n"
"set flow_ctrl autoneg (on|off) (port_id)\n"
" Set the link flow control parameter on a port.\n\n"
"set pfc_ctrl rx (on|off) tx (on|off) (high_water)"
" (low_water) (pause_time) (priority) (port_id)\n"
" Set the priority flow control parameter on a"
" port.\n\n"
"set stat_qmap (tx|rx) (port_id) (queue_id) (qmapping)\n"
" Set statistics mapping (qmapping 0..15) for RX/TX"
" queue on port.\n"
" e.g., 'set stat_qmap rx 0 2 5' sets rx queue 2"
" on port 0 to mapping 5.\n\n"
"set xstats-hide-zero on|off\n"
" Set the option to hide the zero values"
" for xstats display.\n"
"set record-core-cycles on|off\n"
" Set the option to enable measurement of CPU cycles.\n"
"set record-burst-stats on|off\n"
" Set the option to enable display of RX and TX bursts.\n"
"set port (port_id) vf (vf_id) rx|tx on|off\n"
" Enable/Disable a VF receive/transmit from a port\n\n"
"set port (port_id) vf (vf_id) rxmode (AUPE|ROPE|BAM"
"|MPE) (on|off)\n"
" AUPE:accepts untagged VLAN;"
"ROPE:accept unicast hash\n\n"
" BAM:accepts broadcast packets;"
"MPE:accepts all multicast packets\n\n"
" Enable/Disable a VF receive mode of a port\n\n"
"set port (port_id) queue (queue_id) rate (rate_num)\n"
" Set rate limit for a queue of a port\n\n"
"set port (port_id) vf (vf_id) rate (rate_num) "
"queue_mask (queue_mask_value)\n"
" Set rate limit for queues in VF of a port\n\n"
"set flush_rx (on|off)\n"
" Flush (default) or don't flush RX streams before"
" forwarding. Mainly used with PCAP drivers.\n\n"
"set bypass mode (normal|bypass|isolate) (port_id)\n"
" Set the bypass mode for the lowest port on bypass enabled"
" NIC.\n\n"
"set bypass event (timeout|os_on|os_off|power_on|power_off) "
"mode (normal|bypass|isolate) (port_id)\n"
" Set the event required to initiate specified bypass mode for"
" the lowest port on a bypass enabled NIC where:\n"
" timeout = enable bypass after watchdog timeout.\n"
" os_on = enable bypass when OS/board is powered on.\n"
" os_off = enable bypass when OS/board is powered off.\n"
" power_on = enable bypass when power supply is turned on.\n"
" power_off = enable bypass when power supply is turned off."
"\n\n"
"set bypass timeout (0|1.5|2|3|4|8|16|32)\n"
" Set the bypass watchdog timeout to 'n' seconds"
" where 0 = instant.\n\n"
"show bypass config (port_id)\n"
" Show the bypass configuration for a bypass enabled NIC"
" using the lowest port on the NIC.\n\n"
#ifdef RTE_NET_BOND
"create bonded device (mode) (socket)\n"
" Create a new bonded device with specific bonding mode and socket.\n\n"
"add bonding slave (slave_id) (port_id)\n"
" Add a slave device to a bonded device.\n\n"
"remove bonding slave (slave_id) (port_id)\n"
" Remove a slave device from a bonded device.\n\n"
"set bonding mode (value) (port_id)\n"
" Set the bonding mode on a bonded device.\n\n"
"set bonding primary (slave_id) (port_id)\n"
" Set the primary slave for a bonded device.\n\n"
"show bonding config (port_id)\n"
" Show the bonding config for port_id.\n\n"
"show bonding lacp info (port_id)\n"
" Show the bonding lacp information for port_id.\n\n"
"set bonding mac_addr (port_id) (address)\n"
" Set the MAC address of a bonded device.\n\n"
"set bonding mode IEEE802.3AD aggregator policy (port_id) (agg_name)"
" Set Aggregation mode for IEEE802.3AD (mode 4)"
"set bonding balance_xmit_policy (port_id) (l2|l23|l34)\n"
" Set the transmit balance policy for bonded device running in balance mode.\n\n"
"set bonding mon_period (port_id) (value)\n"
" Set the bonding link status monitoring polling period in ms.\n\n"
"set bonding lacp dedicated_queues <port_id> (enable|disable)\n"
" Enable/disable dedicated queues for LACP control traffic.\n\n"
#endif
"set link-up port (port_id)\n"
" Set link up for a port.\n\n"
"set link-down port (port_id)\n"
" Set link down for a port.\n\n"
"ddp add (port_id) (profile_path[,backup_profile_path])\n"
" Load a profile package on a port\n\n"
"ddp del (port_id) (backup_profile_path)\n"
" Delete a profile package from a port\n\n"
"ptype mapping get (port_id) (valid_only)\n"
" Get ptype mapping on a port\n\n"
"ptype mapping replace (port_id) (target) (mask) (pky_type)\n"
" Replace target with the pkt_type in ptype mapping\n\n"
"ptype mapping reset (port_id)\n"
" Reset ptype mapping on a port\n\n"
"ptype mapping update (port_id) (hw_ptype) (sw_ptype)\n"
" Update a ptype mapping item on a port\n\n"
"set port (port_id) ptype_mask (ptype_mask)\n"
" set packet types classification for a specific port\n\n"
"set port (port_id) queue-region region_id (value) "
"queue_start_index (value) queue_num (value)\n"
" Set a queue region on a port\n\n"
"set port (port_id) queue-region region_id (value) "
"flowtype (value)\n"
" Set a flowtype region index on a port\n\n"
"set port (port_id) queue-region UP (value) region_id (value)\n"
" Set the mapping of User Priority to "
"queue region on a port\n\n"
"set port (port_id) queue-region flush (on|off)\n"
" flush all queue region related configuration\n\n"
"show port meter cap (port_id)\n"
" Show port meter capability information\n\n"
"add port meter profile srtcm_rfc2697 (port_id) (profile_id) (cir) (cbs) (ebs) (packet_mode)\n"
" meter profile add - srtcm rfc 2697\n\n"
"add port meter profile trtcm_rfc2698 (port_id) (profile_id) (cir) (pir) (cbs) (pbs) (packet_mode)\n"
" meter profile add - trtcm rfc 2698\n\n"
"add port meter profile trtcm_rfc4115 (port_id) (profile_id) (cir) (eir) (cbs) (ebs) (packet_mode)\n"
" meter profile add - trtcm rfc 4115\n\n"
"del port meter profile (port_id) (profile_id)\n"
" meter profile delete\n\n"
"create port meter (port_id) (mtr_id) (profile_id) (policy_id) (meter_enable)\n"
"(stats_mask) (shared) (use_pre_meter_color) [(dscp_tbl_entry0) (dscp_tbl_entry1)...\n"
"(dscp_tbl_entry63)]\n"
" meter create\n\n"
"enable port meter (port_id) (mtr_id)\n"
" meter enable\n\n"
"disable port meter (port_id) (mtr_id)\n"
" meter disable\n\n"
"del port meter (port_id) (mtr_id)\n"
" meter delete\n\n"
"add port meter policy (port_id) (policy_id) g_actions (actions)\n"
"y_actions (actions) r_actions (actions)\n"
" meter policy add\n\n"
"del port meter policy (port_id) (policy_id)\n"
" meter policy delete\n\n"
"set port meter profile (port_id) (mtr_id) (profile_id)\n"
" meter update meter profile\n\n"
"set port meter dscp table (port_id) (mtr_id) [(dscp_tbl_entry0)\n"
"(dscp_tbl_entry1)...(dscp_tbl_entry63)]\n"
" update meter dscp table entries\n\n"
"set port meter policer action (port_id) (mtr_id) (action_mask)\n"
"(action0) [(action1) (action2)]\n"
" meter update policer action\n\n"
"set port meter stats mask (port_id) (mtr_id) (stats_mask)\n"
" meter update stats\n\n"
"show port (port_id) queue-region\n"
" show all queue region related configuration info\n\n"
"set port (port_id) fec_mode auto|off|rs|baser\n"
" set fec mode for a specific port\n\n"
, list_pkt_forwarding_modes()
);
}
if (show_all || !strcmp(res->section, "ports")) {
cmdline_printf(
cl,
"\n"
"Port Operations:\n"
"----------------\n\n"
"port start (port_id|all)\n"
" Start all ports or port_id.\n\n"
"port stop (port_id|all)\n"
" Stop all ports or port_id.\n\n"
"port close (port_id|all)\n"
" Close all ports or port_id.\n\n"
"port reset (port_id|all)\n"
" Reset all ports or port_id.\n\n"
"port attach (ident)\n"
" Attach physical or virtual dev by pci address or virtual device name\n\n"
"port detach (port_id)\n"
" Detach physical or virtual dev by port_id\n\n"
"port config (port_id|all)"
" speed (10|100|1000|10000|25000|40000|50000|100000|200000|auto)"
" duplex (half|full|auto)\n"
" Set speed and duplex for all ports or port_id\n\n"
"port config (port_id|all) loopback (mode)\n"
" Set loopback mode for all ports or port_id\n\n"
"port config all (rxq|txq|rxd|txd) (value)\n"
" Set number for rxq/txq/rxd/txd.\n\n"
"port config all max-pkt-len (value)\n"
" Set the max packet length.\n\n"
"port config all max-lro-pkt-size (value)\n"
" Set the max LRO aggregated packet size.\n\n"
"port config all drop-en (on|off)\n"
" Enable or disable packet drop on all RX queues of all ports when no "
"receive buffers available.\n\n"
"port config all rss (all|default|ip|tcp|udp|sctp|"
"ether|port|vxlan|geneve|nvgre|vxlan-gpe|ecpri|mpls|none|level-default|"
"level-outer|level-inner|<flowtype_id>)\n"
" Set the RSS mode.\n\n"
"port config port-id rss reta (hash,queue)[,(hash,queue)]\n"
" Set the RSS redirection table.\n\n"
"port config (port_id) dcb vt (on|off) (traffic_class)"
" pfc (on|off)\n"
" Set the DCB mode.\n\n"
"port config all burst (value)\n"
" Set the number of packets per burst.\n\n"
"port config all (txpt|txht|txwt|rxpt|rxht|rxwt)"
" (value)\n"
" Set the ring prefetch/host/writeback threshold"
" for tx/rx queue.\n\n"
"port config all (txfreet|txrst|rxfreet) (value)\n"
" Set free threshold for rx/tx, or set"
" tx rs bit threshold.\n\n"
"port config mtu X value\n"
" Set the MTU of port X to a given value\n\n"
"port config (port_id) (rxq|txq) (queue_id) ring_size (value)\n"
" Set a rx/tx queue's ring size configuration, the new"
" value will take effect after command that (re-)start the port"
" or command that setup the specific queue\n\n"
"port (port_id) (rxq|txq) (queue_id) (start|stop)\n"
" Start/stop a rx/tx queue of port X. Only take effect"
" when port X is started\n\n"
"port (port_id) (rxq|txq) (queue_id) deferred_start (on|off)\n"
" Switch on/off a deferred start of port X rx/tx queue. Only"
" take effect when port X is stopped.\n\n"
"port (port_id) (rxq|txq) (queue_id) setup\n"
" Setup a rx/tx queue of port X.\n\n"
"port config (port_id) pctype mapping reset\n"
" Reset flow type to pctype mapping on a port\n\n"
"port config (port_id) pctype mapping update"
" (pctype_id_0[,pctype_id_1]*) (flow_type_id)\n"
" Update a flow type to pctype mapping item on a port\n\n"
"port config (port_id) pctype (pctype_id) hash_inset|"
"fdir_inset|fdir_flx_inset get|set|clear field\n"
" (field_idx)\n"
" Configure RSS|FDIR|FDIR_FLX input set for some pctype\n\n"
"port config (port_id) pctype (pctype_id) hash_inset|"
"fdir_inset|fdir_flx_inset clear all"
" Clear RSS|FDIR|FDIR_FLX input set completely for some pctype\n\n"
"port config (port_id) udp_tunnel_port add|rm vxlan|geneve|ecpri (udp_port)\n\n"
" Add/remove UDP tunnel port for tunneling offload\n\n"
"port config <port_id> rx_offload vlan_strip|"
"ipv4_cksum|udp_cksum|tcp_cksum|tcp_lro|qinq_strip|"
"outer_ipv4_cksum|macsec_strip|header_split|"
"vlan_filter|vlan_extend|jumbo_frame|scatter|"
"buffer_split|timestamp|security|keep_crc on|off\n"
" Enable or disable a per port Rx offloading"
" on all Rx queues of a port\n\n"
"port (port_id) rxq (queue_id) rx_offload vlan_strip|"
"ipv4_cksum|udp_cksum|tcp_cksum|tcp_lro|qinq_strip|"
"outer_ipv4_cksum|macsec_strip|header_split|"
"vlan_filter|vlan_extend|jumbo_frame|scatter|"
"buffer_split|timestamp|security|keep_crc on|off\n"
" Enable or disable a per queue Rx offloading"
" only on a specific Rx queue\n\n"
"port config (port_id) tx_offload vlan_insert|"
"ipv4_cksum|udp_cksum|tcp_cksum|sctp_cksum|tcp_tso|"
"udp_tso|outer_ipv4_cksum|qinq_insert|vxlan_tnl_tso|"
"gre_tnl_tso|ipip_tnl_tso|geneve_tnl_tso|"
"macsec_insert|mt_lockfree|multi_segs|mbuf_fast_free|"
"security on|off\n"
" Enable or disable a per port Tx offloading"
" on all Tx queues of a port\n\n"
"port (port_id) txq (queue_id) tx_offload vlan_insert|"
"ipv4_cksum|udp_cksum|tcp_cksum|sctp_cksum|tcp_tso|"
"udp_tso|outer_ipv4_cksum|qinq_insert|vxlan_tnl_tso|"
"gre_tnl_tso|ipip_tnl_tso|geneve_tnl_tso|macsec_insert"
"|mt_lockfree|multi_segs|mbuf_fast_free|security"
" on|off\n"
" Enable or disable a per queue Tx offloading"
" only on a specific Tx queue\n\n"
"bpf-load rx|tx (port) (queue) (J|M|B) (file_name)\n"
" Load an eBPF program as a callback"
" for particular RX/TX queue\n\n"
"bpf-unload rx|tx (port) (queue)\n"
" Unload previously loaded eBPF program"
" for particular RX/TX queue\n\n"
"port config (port_id) tx_metadata (value)\n"
" Set Tx metadata value per port. Testpmd will add this value"
" to any Tx packet sent from this port\n\n"
"port config (port_id) dynf (name) set|clear\n"
" Register a dynf and Set/clear this flag on Tx. "
"Testpmd will set this value to any Tx packet "
"sent from this port\n\n"
"port cleanup (port_id) txq (queue_id) (free_cnt)\n"
" Cleanup txq mbufs for a specific Tx queue\n\n"
);
}
if (show_all || !strcmp(res->section, "registers")) {
cmdline_printf(
cl,
"\n"
"Registers:\n"
"----------\n\n"
"read reg (port_id) (address)\n"
" Display value of a port register.\n\n"
"read regfield (port_id) (address) (bit_x) (bit_y)\n"
" Display a port register bit field.\n\n"
"read regbit (port_id) (address) (bit_x)\n"
" Display a single port register bit.\n\n"
"write reg (port_id) (address) (value)\n"
" Set value of a port register.\n\n"
"write regfield (port_id) (address) (bit_x) (bit_y)"
" (value)\n"
" Set bit field of a port register.\n\n"
"write regbit (port_id) (address) (bit_x) (value)\n"
" Set single bit value of a port register.\n\n"
);
}
if (show_all || !strcmp(res->section, "filters")) {
cmdline_printf(
cl,
"\n"
"filters:\n"
"--------\n\n"
#ifdef RTE_NET_I40E
"flow_director_filter (port_id) mode raw (add|del|update)"
" flow (flow_id) (drop|fwd) queue (queue_id)"
" fd_id (fd_id_value) packet (packet file name)\n"
" Add/Del a raw type flow director filter.\n\n"
#endif
"flow_director_mask (port_id) mode IP vlan (vlan_value)"
" src_mask (ipv4_src) (ipv6_src) (src_port)"
" dst_mask (ipv4_dst) (ipv6_dst) (dst_port)\n"
" Set flow director IP mask.\n\n"
"flow_director_mask (port_id) mode MAC-VLAN"
" vlan (vlan_value)\n"
" Set flow director MAC-VLAN mask.\n\n"
"flow_director_mask (port_id) mode Tunnel"
" vlan (vlan_value) mac (mac_value)"
" tunnel-type (tunnel_type_value)"
" tunnel-id (tunnel_id_value)\n"
" Set flow director Tunnel mask.\n\n"
"flow_director_flex_payload (port_id)"
" (raw|l2|l3|l4) (config)\n"
" Configure flex payload selection.\n\n"
"flow validate {port_id}"
" [group {group_id}] [priority {level}]"
" [ingress] [egress]"
" pattern {item} [/ {item} [...]] / end"
" actions {action} [/ {action} [...]] / end\n"
" Check whether a flow rule can be created.\n\n"
"flow create {port_id}"
" [group {group_id}] [priority {level}]"
" [ingress] [egress]"
" pattern {item} [/ {item} [...]] / end"
" actions {action} [/ {action} [...]] / end\n"
" Create a flow rule.\n\n"
"flow destroy {port_id} rule {rule_id} [...]\n"
" Destroy specific flow rules.\n\n"
"flow flush {port_id}\n"
" Destroy all flow rules.\n\n"
"flow query {port_id} {rule_id} {action}\n"
" Query an existing flow rule.\n\n"
"flow list {port_id} [group {group_id}] [...]\n"
" List existing flow rules sorted by priority,"
" filtered by group identifiers.\n\n"