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
|
m4_define([CONFIGURE_VETH_OFFLOADS],
[AT_CHECK([ethtool -K $1 tx off], [0], [ignore], [ignore])])
AT_BANNER([OVS-DPDK unit tests])
m4_define([SYSTEM_DPDK_ALLOWED_LOGS],[
\@does not exist. The Open vSwitch kernel module is probably not loaded.@d
\@does not support MTU configuration,@d
\@EAL: No \(available\|free\) .*hugepages reported@d
\@Failed to enable flow control@d
\@Rx checksum offload is not supported on@d
\@TELEMETRY: No legacy callbacks, legacy socket not created@d
])
dnl CHECK_MEMPOOL_PARAM([mtu], [numa], [+line])
dnl
dnl Waits for logs to indicate that the user has configured a mempool
dnl for 'mtu' on 'numa'. Checking starts from line number 'line' in
dnl ovs-vswitchd.log.
m4_define([CHECK_MEMPOOL_PARAM], [
line_st=$3
if [[ -z "$line_st" ]]
then
line_st="+0"
fi
OVS_WAIT_UNTIL([tail -n $line_st ovs-vswitchd.log dnl
| grep "User configured shared mempool set for: MTU $1, NUMA $2."])
])
dnl --------------------------------------------------------------------------
dnl Check if EAL init is successful
AT_SETUP([OVS-DPDK - EAL init])
AT_KEYWORDS([dpdk])
OVS_DPDK_PRE_CHECK()
OVS_DPDK_START()
AT_CHECK([grep "DPDK Enabled - initializing..." ovs-vswitchd.log], [], [stdout])
AT_CHECK([grep "EAL" ovs-vswitchd.log], [], [stdout])
AT_CHECK([grep "DPDK Enabled - initialized" ovs-vswitchd.log], [], [stdout])
OVS_VSWITCHD_STOP("[SYSTEM_DPDK_ALLOWED_LOGS]")
AT_CLEANUP
dnl --------------------------------------------------------------------------
dnl --------------------------------------------------------------------------
dnl Add standard DPDK PHY port
AT_SETUP([OVS-DPDK - add standard DPDK port])
AT_KEYWORDS([dpdk])
OVS_DPDK_PRE_PHY_SKIP()
OVS_DPDK_START()
dnl Add userspace bridge and attach it to OVS
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
AT_CHECK([ovs-vsctl add-port br10 phy0 -- set Interface phy0 type=dpdk options:dpdk-devargs=$(cat PCI_ADDR)], [], [stdout], [stderr])
AT_CHECK([ovs-vsctl show], [], [stdout])
sleep 2
dnl Clean up
AT_CHECK([ovs-vsctl del-port br10 phy0], [], [stdout], [stderr])
OVS_VSWITCHD_STOP("[SYSTEM_DPDK_ALLOWED_LOGS]")
AT_CLEANUP
dnl --------------------------------------------------------------------------
dnl --------------------------------------------------------------------------
dnl Add vhost-user-client port
AT_SETUP([OVS-DPDK - add vhost-user-client port])
AT_KEYWORDS([dpdk])
OVS_DPDK_PRE_CHECK()
OVS_DPDK_START()
dnl Add userspace bridge and attach it to OVS
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
AT_CHECK([ovs-vsctl add-port br10 dpdkvhostuserclient0 -- set Interface dpdkvhostuserclient0 type=dpdkvhostuserclient options:vhost-server-path=$OVS_RUNDIR/dpdkvhostclient0], [], [stdout], [stderr])
AT_CHECK([ovs-vsctl show], [], [stdout])
sleep 2
dnl Parse log file
AT_CHECK([grep "VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) vhost-user client: socket created" ovs-vswitchd.log], [], [stdout])
AT_CHECK([grep "vHost User device 'dpdkvhostuserclient0' created in 'client' mode, using client socket" ovs-vswitchd.log], [], [stdout])
AT_CHECK([grep "VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) reconnecting..." ovs-vswitchd.log], [], [stdout])
dnl Clean up
AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr])
OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [
\@VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) failed to connect: No such file or directory@d
])")
AT_CLEANUP
dnl --------------------------------------------------------------------------
dnl --------------------------------------------------------------------------
dnl Ping vhost-user port
AT_SETUP([OVS-DPDK - ping vhost-user ports])
AT_KEYWORDS([dpdk])
OVS_DPDK_PRE_CHECK()
AT_SKIP_IF([! which dpdk-testpmd >/dev/null 2>/dev/null])
OVS_DPDK_START()
dnl Find number of sockets
AT_CHECK([lscpu], [], [stdout])
AT_CHECK([cat stdout | grep "NUMA node(s)" | awk '{c=1; while (c++<$(3)) {printf "512,"}; print "512"}' > NUMA_NODE])
dnl Add userspace bridge and attach it to OVS
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
AT_CHECK([ovs-vsctl add-port br10 dpdkvhostuser0 -- set Interface dpdkvhostuser0 \
type=dpdkvhostuser], [],
[stdout], [stderr])
AT_CHECK([ovs-vsctl show], [], [stdout])
dnl Parse log file
AT_CHECK([grep "VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostuser0) vhost-user server: socket created" \
ovs-vswitchd.log], [], [stdout])
AT_CHECK([grep "Socket $OVS_RUNDIR/dpdkvhostuser0 created for vhost-user port dpdkvhostuser0" \
ovs-vswitchd.log], [], [stdout])
AT_CHECK([grep "VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostuser0) binding succeeded" ovs-vswitchd.log], [],
[stdout])
dnl Set up namespaces
ADD_NAMESPACES(ns1, ns2)
dnl Add veth device
ADD_VETH(tap1, ns2, br10, "172.31.110.12/24")
dnl Execute testpmd in background
on_exit "pkill -f -x -9 'tail -f /dev/null'"
tail -f /dev/null | dpdk-testpmd --socket-mem="$(cat NUMA_NODE)" --no-pci\
--vdev="net_virtio_user,path=$OVS_RUNDIR/dpdkvhostuser0" \
--vdev="net_tap0,iface=tap0" --file-prefix page0 \
--single-file-segments -- -a >$OVS_RUNDIR/testpmd-dpdkvhostuser0.log 2>&1 &
OVS_WAIT_UNTIL([grep "virtio is now ready for processing" ovs-vswitchd.log])
OVS_WAIT_UNTIL([ip link show dev tap0 | grep -qw LOWER_UP])
dnl Move the tap devices to the namespaces
AT_CHECK([ps aux | grep testpmd], [], [stdout], [stderr])
AT_CHECK([ip link show], [], [stdout], [stderr])
AT_CHECK([ip link set tap0 netns ns1], [], [stdout], [stderr])
AT_CHECK([ip netns exec ns1 ip link show], [], [stdout], [stderr])
AT_CHECK([ip netns exec ns1 ip link show | grep tap0], [], [stdout], [stderr])
AT_CHECK([ip netns exec ns1 ip link set tap0 up], [], [stdout], [stderr])
AT_CHECK([ip netns exec ns1 ip addr add 172.31.110.11/24 dev tap0], [],
[stdout], [stderr])
AT_CHECK([ip netns exec ns1 ip link show], [], [stdout], [stderr])
AT_CHECK([ip netns exec ns2 ip link show], [], [stdout], [stderr])
AT_CHECK([ip netns exec ns1 ping -c 4 -I tap0 172.31.110.12], [], [stdout],
[stderr])
dnl Clean up the testpmd now
pkill -f -x -9 'tail -f /dev/null'
dnl Wait for vhost-user handling the socket disconnect.
OVS_WAIT_UNTIL([grep "vHost Device '$OVS_RUNDIR/dpdkvhostuser0' has been removed" ovs-vswitchd.log])
dnl Clean up
AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuser0], [], [stdout], [stderr])
OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [
\@VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostuser0) recvmsg failed@d
\@VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostuser0) failed to connect: No such file or directory@d
\@dpdkvhostuser ports are considered deprecated; please migrate to dpdkvhostuserclient ports.@d
\@failed to enumerate system datapaths: No such file or directory@d
])")
AT_CLEANUP
dnl --------------------------------------------------------------------------
dnl --------------------------------------------------------------------------
dnl Ping vhost-user-client port
AT_SETUP([OVS-DPDK - ping vhost-user-client ports])
AT_KEYWORDS([dpdk])
OVS_DPDK_PRE_CHECK()
AT_SKIP_IF([! which dpdk-testpmd >/dev/null 2>/dev/null])
OVS_DPDK_START()
dnl Find number of sockets
AT_CHECK([lscpu], [], [stdout])
AT_CHECK([cat stdout | grep "NUMA node(s)" | awk '{c=1; while (c++<$(3)) {printf "512,"}; print "512"}' > NUMA_NODE])
dnl Add userspace bridge and attach it to OVS
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
AT_CHECK([ovs-vsctl add-port br10 dpdkvhostuserclient0 -- set Interface \
dpdkvhostuserclient0 \
type=dpdkvhostuserclient \
options:vhost-server-path=$OVS_RUNDIR/dpdkvhostclient0], [],
[stdout], [stderr])
AT_CHECK([ovs-vsctl show], [], [stdout])
dnl Parse log file
AT_CHECK([grep "VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) vhost-user client: socket created" ovs-vswitchd.log], [], [stdout])
AT_CHECK([grep "vHost User device 'dpdkvhostuserclient0' created in 'client' mode, using client socket" ovs-vswitchd.log], [], [stdout])
AT_CHECK([grep "VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) reconnecting..." ovs-vswitchd.log], [], [stdout])
dnl Set up namespaces
ADD_NAMESPACES(ns1, ns2)
dnl Add veth device
ADD_VETH(tap1, ns2, br10, "172.31.110.12/24")
dnl Execute testpmd in background
on_exit "pkill -f -x -9 'tail -f /dev/null'"
tail -f /dev/null | dpdk-testpmd --socket-mem="$(cat NUMA_NODE)" --no-pci\
--vdev="net_virtio_user,path=$OVS_RUNDIR/dpdkvhostclient0,queues=2,server=1" \
--vdev="net_tap0,iface=tap0" --file-prefix page0 \
--single-file-segments -- -a --nb-cores 2 --rxq 2 --txq 2 \
>$OVS_RUNDIR/testpmd-dpdkvhostuserclient0.log 2>&1 &
OVS_WAIT_UNTIL([grep "virtio is now ready for processing" ovs-vswitchd.log])
OVS_WAIT_UNTIL([ip link show dev tap0 | grep -qw LOWER_UP])
dnl Move the tap devices to the namespaces
AT_CHECK([ps aux | grep testpmd], [], [stdout], [stderr])
AT_CHECK([ip link show], [], [stdout], [stderr])
AT_CHECK([ip link set tap0 netns ns1], [], [stdout], [stderr])
AT_CHECK([ip netns exec ns1 ip link show], [], [stdout], [stderr])
AT_CHECK([ip netns exec ns1 ip link show | grep tap0], [], [stdout], [stderr])
AT_CHECK([ip netns exec ns1 ip link set tap0 up], [], [stdout], [stderr])
AT_CHECK([ip netns exec ns1 ip addr add 172.31.110.11/24 dev tap0], [],
[stdout], [stderr])
AT_CHECK([ip netns exec ns1 ip link show], [], [stdout], [stderr])
AT_CHECK([ip netns exec ns2 ip link show], [], [stdout], [stderr])
AT_CHECK([ip netns exec ns1 ping -i 0.1 -c 10 -I tap0 172.31.110.12], [], [stdout],
[stderr])
AT_CHECK([ip netns exec ns1 ip link set tap0 down], [], [stdout], [stderr])
# Wait for stats to be queried ("stats-update-interval")
sleep 5
AT_CHECK([ovs-vsctl get interface dpdkvhostuserclient0 statistics], [], [stdout], [stderr])
AT_CHECK([test `ovs-vsctl get interface dpdkvhostuserclient0 statistics:rx_packets` -gt 0 -a dnl
`ovs-vsctl get interface dpdkvhostuserclient0 statistics:rx_bytes` -gt 0])
AT_CHECK([test `ovs-vsctl get interface dpdkvhostuserclient0 statistics:rx_packets` -eq dnl
$((`ovs-vsctl get interface dpdkvhostuserclient0 statistics:rx_q0_good_packets` + dnl
`ovs-vsctl get interface dpdkvhostuserclient0 statistics:rx_q1_good_packets`))])
AT_CHECK([test `ovs-vsctl get interface dpdkvhostuserclient0 statistics:rx_bytes` -eq dnl
$((`ovs-vsctl get interface dpdkvhostuserclient0 statistics:rx_q0_good_bytes` + dnl
`ovs-vsctl get interface dpdkvhostuserclient0 statistics:rx_q1_good_bytes`))])
AT_CHECK([test `ovs-vsctl get interface dpdkvhostuserclient0 statistics:tx_packets` -gt 0 -a dnl
`ovs-vsctl get interface dpdkvhostuserclient0 statistics:tx_bytes` -gt 0])
AT_CHECK([test `ovs-vsctl get interface dpdkvhostuserclient0 statistics:tx_packets` -eq dnl
$((`ovs-vsctl get interface dpdkvhostuserclient0 statistics:tx_q0_good_packets` + dnl
`ovs-vsctl get interface dpdkvhostuserclient0 statistics:tx_q1_good_packets`))])
AT_CHECK([test `ovs-vsctl get interface dpdkvhostuserclient0 statistics:tx_bytes` -eq dnl
$((`ovs-vsctl get interface dpdkvhostuserclient0 statistics:tx_q0_good_bytes` + dnl
`ovs-vsctl get interface dpdkvhostuserclient0 statistics:tx_q1_good_bytes`))])
dnl Clean up the testpmd now
pkill -f -x -9 'tail -f /dev/null'
dnl Clean up
AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr])
OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [
\@VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) recvmsg failed@d
\@VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) failed to connect: No such file or directory@d
\@dpdkvhostuser ports are considered deprecated; please migrate to dpdkvhostuserclient ports.@d
\@failed to enumerate system datapaths: No such file or directory@d
])")
AT_CLEANUP
dnl --------------------------------------------------------------------------
dnl --------------------------------------------------------------------------
dnl Ingress policing create delete phy port
AT_SETUP([OVS-DPDK - Ingress policing create delete phy port])
AT_KEYWORDS([dpdk])
OVS_DPDK_PRE_PHY_SKIP()
OVS_DPDK_START()
dnl Add userspace bridge and attach it to OVS and add policer
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
AT_CHECK([ovs-vsctl add-port br10 phy0 -- set Interface phy0 type=dpdk options:dpdk-devargs=$(cat PCI_ADDR)], [], [stdout], [stderr])
AT_CHECK([ovs-vsctl set interface phy0 ingress_policing_rate=10000 ingress_policing_burst=1000])
AT_CHECK([ovs-vsctl show], [], [stdout])
sleep 2
dnl Fail if policer could not be created
AT_FAIL_IF([grep "Could not create rte meter for ingress policer" ovs-vswitchd.log], [], [stdout])
dnl Remove policer
AT_CHECK([ovs-vsctl set interface phy0 ingress_policing_rate=0 ingress_policing_burst=0])
dnl Check policer was removed correctly
AT_CHECK([ovs-vsctl list interface phy0], [], [stdout])
AT_CHECK([grep -E 'ingress_policing_burst: 0' stdout], [], [stdout])
AT_CHECK([ovs-vsctl list interface phy0], [], [stdout])
AT_CHECK([grep -E 'ingress_policing_rate: 0' stdout], [], [stdout])
dnl Clean up
AT_CHECK([ovs-vsctl del-port br10 phy0], [], [stdout], [stderr])
OVS_VSWITCHD_STOP("[SYSTEM_DPDK_ALLOWED_LOGS]")
AT_CLEANUP
dnl --------------------------------------------------------------------------
dnl --------------------------------------------------------------------------
dnl Ingress policing create delete vport port
AT_SETUP([OVS-DPDK - Ingress policing create delete vport port])
AT_KEYWORDS([dpdk])
OVS_DPDK_PRE_CHECK()
OVS_DPDK_START()
dnl Add userspace bridge and attach it to OVS and add ingress policer
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
AT_CHECK([ovs-vsctl add-port br10 dpdkvhostuserclient0 -- set Interface dpdkvhostuserclient0 type=dpdkvhostuserclient options:vhost-server-path=$OVS_RUNDIR/dpdkvhostclient0], [], [stdout], [stderr])
AT_CHECK([ovs-vsctl set interface dpdkvhostuserclient0 ingress_policing_rate=10000 ingress_policing_burst=1000])
AT_CHECK([ovs-vsctl show], [], [stdout])
sleep 2
dnl Fail if ingress policer could not be created
AT_FAIL_IF([grep "Could not create rte meter for ingress policer" ovs-vswitchd.log], [], [stdout])
dnl Remove ingress policer
AT_CHECK([ovs-vsctl set interface dpdkvhostuserclient0 ingress_policing_rate=0 ingress_policing_burst=0])
dnl Check ingress policer was removed correctly
AT_CHECK([ovs-vsctl list interface dpdkvhostuserclient0], [], [stdout])
AT_CHECK([grep -E 'ingress_policing_burst: 0' stdout], [], [stdout])
AT_CHECK([ovs-vsctl list interface dpdkvhostuserclient0], [], [stdout])
AT_CHECK([grep -E 'ingress_policing_rate: 0' stdout], [], [stdout])
dnl Parse log file
AT_CHECK([grep "VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) vhost-user client: socket created" ovs-vswitchd.log], [], [stdout])
AT_CHECK([grep "vHost User device 'dpdkvhostuserclient0' created in 'client' mode, using client socket" ovs-vswitchd.log], [], [stdout])
AT_CHECK([grep "VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) reconnecting..." ovs-vswitchd.log], [], [stdout])
dnl Clean up
AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr])
OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [
\@VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) failed to connect: No such file or directory@d
])")
AT_CLEANUP
dnl --------------------------------------------------------------------------
dnl --------------------------------------------------------------------------
dnl Ingress policing no policing rate
AT_SETUP([OVS-DPDK - Ingress policing no policing rate])
AT_KEYWORDS([dpdk])
OVS_DPDK_PRE_CHECK()
OVS_DPDK_START()
dnl Add userspace bridge and attach it to OVS and add ingress policer
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
AT_CHECK([ovs-vsctl add-port br10 dpdkvhostuserclient0 -- set Interface dpdkvhostuserclient0 type=dpdkvhostuserclient options:vhost-server-path=$OVS_RUNDIR/dpdkvhostclient0], [], [stdout], [stderr])
AT_CHECK([ovs-vsctl set interface dpdkvhostuserclient0 ingress_policing_burst=1000])
AT_CHECK([ovs-vsctl show], [], [stdout])
sleep 2
dnl Fail if ingress policer could not be created
AT_FAIL_IF([grep "Could not create rte meter for ingress policer" ovs-vswitchd.log], [], [stdout])
dnl Check ingress policer was created correctly
AT_CHECK([ovs-vsctl list interface dpdkvhostuserclient0], [], [stdout])
AT_CHECK([grep -E 'ingress_policing_burst: 1000' stdout], [], [stdout])
AT_CHECK([ovs-vsctl list interface dpdkvhostuserclient0], [], [stdout])
AT_CHECK([grep -E 'ingress_policing_rate: 0' stdout], [], [stdout])
dnl Parse log file
AT_CHECK([grep "VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) vhost-user client: socket created" ovs-vswitchd.log], [], [stdout])
AT_CHECK([grep "vHost User device 'dpdkvhostuserclient0' created in 'client' mode, using client socket" ovs-vswitchd.log], [], [stdout])
AT_CHECK([grep "VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) reconnecting..." ovs-vswitchd.log], [], [stdout])
dnl Clean up
AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr])
OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [
\@VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) failed to connect: No such file or directory@d
])")
AT_CLEANUP
dnl --------------------------------------------------------------------------
dnl --------------------------------------------------------------------------
dnl Ingress policing no policing burst
AT_SETUP([OVS-DPDK - Ingress policing no policing burst])
AT_KEYWORDS([dpdk])
OVS_DPDK_PRE_CHECK()
OVS_DPDK_START()
dnl Add userspace bridge and attach it to OVS and add ingress policer
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
AT_CHECK([ovs-vsctl add-port br10 dpdkvhostuserclient0 -- set Interface dpdkvhostuserclient0 type=dpdkvhostuserclient options:vhost-server-path=$OVS_RUNDIR/dpdkvhostclient0], [], [stdout], [stderr])
AT_CHECK([ovs-vsctl set interface dpdkvhostuserclient0 ingress_policing_rate=10000])
AT_CHECK([ovs-vsctl show], [], [stdout])
sleep 2
dnl Fail if ingress policer could not be created
AT_FAIL_IF([grep "Could not create rte meter for ingress policer" ovs-vswitchd.log], [], [stdout])
dnl Check ingress policer was created correctly
AT_CHECK([ovs-vsctl list interface dpdkvhostuserclient0], [], [stdout])
AT_CHECK([grep -E 'ingress_policing_burst: 0' stdout], [], [stdout])
AT_CHECK([ovs-vsctl list interface dpdkvhostuserclient0], [], [stdout])
AT_CHECK([grep -E 'ingress_policing_rate: 10000' stdout], [], [stdout])
dnl Parse log file
AT_CHECK([grep "VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) vhost-user client: socket created" ovs-vswitchd.log], [], [stdout])
AT_CHECK([grep "vHost User device 'dpdkvhostuserclient0' created in 'client' mode, using client socket" ovs-vswitchd.log], [], [stdout])
AT_CHECK([grep "VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) reconnecting..." ovs-vswitchd.log], [], [stdout])
dnl Clean up
AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr])
OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [
\@VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) failed to connect: No such file or directory@d
])")
AT_CLEANUP
dnl --------------------------------------------------------------------------
dnl --------------------------------------------------------------------------
dnl QoS create delete phy port
AT_SETUP([OVS-DPDK - QoS create delete phy port])
AT_KEYWORDS([dpdk])
OVS_DPDK_PRE_PHY_SKIP()
OVS_DPDK_START()
dnl Add userspace bridge and attach it to OVS and add egress policer
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
AT_CHECK([ovs-vsctl add-port br10 phy0 -- set Interface phy0 type=dpdk options:dpdk-devargs=$(cat PCI_ADDR)], [], [stdout], [stderr])
OVS_WAIT_UNTIL([ovs-vsctl set port phy0 qos=@newqos -- --id=@newqos create qos type=egress-policer other-config:cir=1250000 other-config:cbs=2048])
AT_CHECK([ovs-appctl -t ovs-vswitchd qos/show phy0], [], [stdout])
sleep 2
dnl Fail if egress policer could not be created
AT_FAIL_IF([grep "Could not create rte meter for egress policer" ovs-vswitchd.log], [], [stdout])
dnl Remove egress policer
AT_CHECK([ovs-vsctl destroy QoS phy0 -- clear Port phy0 qos])
dnl Check egress policer was removed correctly
AT_CHECK([ovs-appctl -t ovs-vswitchd qos/show phy0], [], [stdout])
AT_CHECK([grep -E 'QoS not configured on phy0' stdout], [], [stdout])
dnl Clean up
AT_CHECK([ovs-vsctl del-port br10 phy0], [], [stdout], [stderr])
OVS_VSWITCHD_STOP("[SYSTEM_DPDK_ALLOWED_LOGS]")
AT_CLEANUP
dnl --------------------------------------------------------------------------
dnl --------------------------------------------------------------------------
dnl QoS create delete vport port
AT_SETUP([OVS-DPDK - QoS create delete vport port])
AT_KEYWORDS([dpdk])
OVS_DPDK_PRE_CHECK()
OVS_DPDK_START()
dnl Add userspace bridge and attach it to OVS and add egress policer
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
AT_CHECK([ovs-vsctl add-port br10 dpdkvhostuserclient0 -- set Interface dpdkvhostuserclient0 type=dpdkvhostuserclient options:vhost-server-path=$OVS_RUNDIR/dpdkvhostclient0], [], [stdout], [stderr])
OVS_WAIT_UNTIL([ovs-vsctl set port dpdkvhostuserclient0 qos=@newqos -- --id=@newqos create qos type=egress-policer other-config:cir=1250000 \
other-config:cbs=2048])
AT_CHECK([ovs-appctl -t ovs-vswitchd qos/show dpdkvhostuserclient0], [], [stdout])
sleep 2
dnl Parse log file
AT_CHECK([grep "VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) vhost-user client: socket created" ovs-vswitchd.log], [], [stdout])
AT_CHECK([grep "vHost User device 'dpdkvhostuserclient0' created in 'client' mode, using client socket" ovs-vswitchd.log], [], [stdout])
AT_CHECK([grep "VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) reconnecting..." ovs-vswitchd.log], [], [stdout])
dnl Fail if egress policer could not be created
AT_FAIL_IF([grep "Could not create rte meter for egress policer" ovs-vswitchd.log], [], [stdout])
dnl Remove egress policer
AT_CHECK([ovs-vsctl destroy QoS dpdkvhostuserclient0 -- clear Port dpdkvhostuserclient0 qos])
dnl Check egress policer was removed correctly
AT_CHECK([ovs-appctl -t ovs-vswitchd qos/show dpdkvhostuserclient0], [], [stdout])
AT_CHECK([grep -E 'QoS not configured on dpdkvhostuserclient0' stdout], [], [stdout])
dnl Clean up
AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr])
OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [
\@VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) failed to connect: No such file or directory@d
])")
AT_CLEANUP
dnl --------------------------------------------------------------------------
dnl --------------------------------------------------------------------------
dnl QoS no cir
AT_SETUP([OVS-DPDK - QoS no cir])
AT_KEYWORDS([dpdk])
OVS_DPDK_PRE_CHECK()
OVS_DPDK_START()
dnl Add userspace bridge and attach it to OVS and add egress policer
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
AT_CHECK([ovs-vsctl add-port br10 dpdkvhostuserclient0 -- set Interface dpdkvhostuserclient0 type=dpdkvhostuserclient options:vhost-server-path=$OVS_RUNDIR/dpdkvhostclient0], [], [stdout], [stderr])
OVS_WAIT_UNTIL([ovs-vsctl set port dpdkvhostuserclient0 qos=@newqos -- --id=@newqos create qos type=egress-policer other-config:cbs=2048])
sleep 2
dnl Parse log file
AT_CHECK([grep "VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) vhost-user client: socket created" ovs-vswitchd.log], [], [stdout])
AT_CHECK([grep "vHost User device 'dpdkvhostuserclient0' created in 'client' mode, using client socket" ovs-vswitchd.log], [], [stdout])
AT_CHECK([grep "VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) reconnecting..." ovs-vswitchd.log], [], [stdout])
dnl Check egress policer was not created
AT_CHECK([ovs-appctl -t ovs-vswitchd qos/show dpdkvhostuserclient0], [], [stdout])
AT_CHECK([grep -E 'QoS not configured on dpdkvhostuserclient0' stdout], [], [stdout])
dnl Clean up
AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr])
OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [
\@VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) failed to connect: No such file or directory@d
\@Could not create rte meter for egress policer@d
\@Failed to set QoS type egress-policer on port dpdkvhostuserclient0: Invalid argument@d
])")
AT_CLEANUP
dnl --------------------------------------------------------------------------
dnl --------------------------------------------------------------------------
dnl QoS no cbs
AT_SETUP([OVS-DPDK - QoS no cbs])
AT_KEYWORDS([dpdk])
OVS_DPDK_PRE_CHECK()
OVS_DPDK_START()
dnl Add userspace bridge and attach it to OVS and add egress policer
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
AT_CHECK([ovs-vsctl add-port br10 dpdkvhostuserclient0 -- set Interface dpdkvhostuserclient0 type=dpdkvhostuserclient options:vhost-server-path=$OVS_RUNDIR/dpdkvhostclient0], [], [stdout], [stderr])
OVS_WAIT_UNTIL([ovs-vsctl set port dpdkvhostuserclient0 qos=@newqos -- --id=@newqos create qos type=egress-policer other-config:cir=1250000])
sleep 2
dnl Parse log file
AT_CHECK([grep "VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) vhost-user client: socket created" ovs-vswitchd.log], [], [stdout])
AT_CHECK([grep "vHost User device 'dpdkvhostuserclient0' created in 'client' mode, using client socket" ovs-vswitchd.log], [], [stdout])
AT_CHECK([grep "VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) reconnecting..." ovs-vswitchd.log], [], [stdout])
dnl Check egress policer was not created
AT_CHECK([ovs-appctl -t ovs-vswitchd qos/show dpdkvhostuserclient0], [], [stdout])
AT_CHECK([grep -E 'QoS not configured on dpdkvhostuserclient0' stdout], [], [stdout])
dnl Clean up
AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr])
OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [
\@VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) failed to connect: No such file or directory@d
\@Could not create rte meter for egress policer@d
\@Failed to set QoS type egress-policer on port dpdkvhostuserclient0: Invalid argument@d
])")
AT_CLEANUP
dnl --------------------------------------------------------------------------
dnl --------------------------------------------------------------------------
dnl MTU increase phy port
AT_SETUP([OVS-DPDK - MTU increase phy port])
AT_KEYWORDS([dpdk])
OVS_DPDK_PRE_PHY_SKIP()
OVS_DPDK_START()
dnl First set MTU to its default value and confirm that value, then increase the MTU value and confirm the new value
dnl Add userspace bridge and attach it to OVS with default MTU value
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
AT_CHECK([ovs-vsctl add-port br10 phy0 -- set Interface phy0 type=dpdk options:dpdk-devargs=$(cat PCI_ADDR)], [], [stdout], [stderr])
AT_CHECK([ovs-vsctl show], [], [stdout])
sleep 2
dnl Check default MTU value in the datapath
AT_CHECK([ovs-appctl dpctl/show], [], [stdout])
AT_CHECK([grep -E 'mtu=1500' stdout], [], [stdout])
dnl Increase MTU value and check in the datapath
AT_CHECK([ovs-vsctl set Interface phy0 mtu_request=9000])
dnl Fail if MTU is not supported
AT_FAIL_IF([grep "Interface phy0 does not support MTU configuration" ovs-vswitchd.log], [], [stdout])
dnl Fail if error is encountered during MTU setup
AT_FAIL_IF([grep "Interface phy0 MTU (9000) setup error" ovs-vswitchd.log], [], [stdout])
AT_CHECK([ovs-appctl dpctl/show], [], [stdout])
AT_CHECK([grep -E 'mtu=9000' stdout], [], [stdout])
dnl Clean up
AT_CHECK([ovs-vsctl del-port br10 phy0], [], [stdout], [stderr])
OVS_VSWITCHD_STOP("[SYSTEM_DPDK_ALLOWED_LOGS]")
AT_CLEANUP
dnl --------------------------------------------------------------------------
dnl --------------------------------------------------------------------------
dnl MTU decrease phy port
AT_SETUP([OVS-DPDK - MTU decrease phy port])
AT_KEYWORDS([dpdk])
OVS_DPDK_PRE_PHY_SKIP()
OVS_DPDK_START()
dnl First set an increased MTU value and confirm that value, then decrease the MTU value and confirm the new value
dnl Add userspace bridge and attach it to OVS and modify MTU value
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
AT_CHECK([ovs-vsctl add-port br10 phy0 -- set Interface phy0 type=dpdk options:dpdk-devargs=$(cat PCI_ADDR)], [], [stdout], [stderr])
AT_CHECK([ovs-vsctl set Interface phy0 mtu_request=9000])
AT_CHECK([ovs-vsctl show], [], [stdout])
sleep 2
dnl Fail if MTU is not supported
AT_FAIL_IF([grep "Interface phy0 does not support MTU configuration" ovs-vswitchd.log], [], [stdout])
dnl Fail if error is encountered during MTU setup
AT_FAIL_IF([grep "Interface phy0 MTU (9000) setup error" ovs-vswitchd.log], [], [stdout])
dnl Check MTU value in the datapath
AT_CHECK([ovs-appctl dpctl/show], [], [stdout])
AT_CHECK([grep -E 'mtu=9000' stdout], [], [stdout])
dnl Decrease MTU value and check in the datapath
AT_CHECK([ovs-vsctl set Interface phy0 mtu_request=2000])
AT_CHECK([ovs-appctl dpctl/show], [], [stdout])
AT_CHECK([grep -E 'mtu=2000' stdout], [], [stdout])
dnl Clean up
AT_CHECK([ovs-vsctl del-port br10 phy0], [], [stdout], [stderr])
OVS_VSWITCHD_STOP("[SYSTEM_DPDK_ALLOWED_LOGS]")
AT_CLEANUP
dnl --------------------------------------------------------------------------
dnl --------------------------------------------------------------------------
dnl MTU increase vport port
AT_SETUP([OVS-DPDK - MTU increase vport port])
AT_KEYWORDS([dpdk])
AT_SKIP_IF([! which dpdk-testpmd >/dev/null 2>/dev/null])
OVS_DPDK_PRE_CHECK()
OVS_DPDK_START()
dnl Find number of sockets
AT_CHECK([lscpu], [], [stdout])
AT_CHECK([cat stdout | grep "NUMA node(s)" | awk '{c=1; while (c++<$(3)) {printf "512,"}; print "512"}' > NUMA_NODE])
dnl Add userspace bridge and attach it to OVS with default MTU value
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
AT_CHECK([ovs-vsctl add-port br10 dpdkvhostuserclient0 -- set Interface dpdkvhostuserclient0 type=dpdkvhostuserclient options:vhost-server-path=$OVS_RUNDIR/dpdkvhostclient0], [], [stdout], [stderr])
AT_CHECK([ovs-vsctl show], [], [stdout])
sleep 2
dnl Parse log file
AT_CHECK([grep "VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) vhost-user client: socket created" ovs-vswitchd.log], [], [stdout])
AT_CHECK([grep "vHost User device 'dpdkvhostuserclient0' created in 'client' mode, using client socket" ovs-vswitchd.log], [], [stdout])
AT_CHECK([grep "VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) reconnecting..." ovs-vswitchd.log], [], [stdout])
dnl Execute testpmd in background
on_exit "pkill -f -x -9 'tail -f /dev/null'"
tail -f /dev/null | dpdk-testpmd --socket-mem="$(cat NUMA_NODE)" --no-pci\
--vdev="net_virtio_user,path=$OVS_RUNDIR/dpdkvhostclient0,server=1" \
--vdev="net_tap0,iface=tap0" --file-prefix page0 \
--single-file-segments -- -a >$OVS_RUNDIR/testpmd-dpdkvhostuserclient0.log 2>&1 &
OVS_WAIT_UNTIL([grep "virtio is now ready for processing" ovs-vswitchd.log])
dnl Check default MTU value in the datapath
AT_CHECK([ovs-appctl dpctl/show], [], [stdout])
AT_CHECK([grep -E 'mtu=1500' stdout], [], [stdout])
dnl Increase MTU value and check in the datapath
AT_CHECK([ovs-vsctl set Interface dpdkvhostuserclient0 mtu_request=9000])
AT_CHECK([ovs-appctl dpctl/show], [], [stdout])
AT_CHECK([grep -E 'mtu=9000' stdout], [], [stdout])
dnl Clean up the testpmd now
pkill -f -x -9 'tail -f /dev/null'
dnl Clean up
AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr])
OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [
\@VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) failed to connect: No such file or directory@d
])")
AT_CLEANUP
dnl --------------------------------------------------------------------------
dnl --------------------------------------------------------------------------
dnl MTU decrease vport port
AT_SETUP([OVS-DPDK - MTU decrease vport port])
AT_KEYWORDS([dpdk])
AT_SKIP_IF([! which dpdk-testpmd >/dev/null 2>/dev/null])
OVS_DPDK_PRE_CHECK()
OVS_DPDK_START()
dnl Find number of sockets
AT_CHECK([lscpu], [], [stdout])
AT_CHECK([cat stdout | grep "NUMA node(s)" | awk '{c=1; while (c++<$(3)) {printf "512,"}; print "512"}' > NUMA_NODE])
dnl Add userspace bridge and attach it to OVS and modify MTU value
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
AT_CHECK([ovs-vsctl add-port br10 dpdkvhostuserclient0 -- set Interface dpdkvhostuserclient0 type=dpdkvhostuserclient options:vhost-server-path=$OVS_RUNDIR/dpdkvhostclient0], [], [stdout], [stderr])
AT_CHECK([ovs-vsctl set Interface dpdkvhostuserclient0 mtu_request=9000])
AT_CHECK([ovs-vsctl show], [], [stdout])
sleep 2
dnl Parse log file
AT_CHECK([grep "VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) vhost-user client: socket created" ovs-vswitchd.log], [], [stdout])
AT_CHECK([grep "vHost User device 'dpdkvhostuserclient0' created in 'client' mode, using client socket" ovs-vswitchd.log], [], [stdout])
AT_CHECK([grep "VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) reconnecting..." ovs-vswitchd.log], [], [stdout])
dnl Execute testpmd in background
on_exit "pkill -f -x -9 'tail -f /dev/null'"
tail -f /dev/null | dpdk-testpmd --socket-mem="$(cat NUMA_NODE)" --no-pci\
--vdev="net_virtio_user,path=$OVS_RUNDIR/dpdkvhostclient0,server=1" \
--vdev="net_tap0,iface=tap0" --file-prefix page0 \
--single-file-segments -- -a >$OVS_RUNDIR/testpmd-dpdkvhostuserclient0.log 2>&1 &
OVS_WAIT_UNTIL([grep "virtio is now ready for processing" ovs-vswitchd.log])
dnl Check MTU value in the datapath
AT_CHECK([ovs-appctl dpctl/show], [], [stdout])
AT_CHECK([grep -E 'mtu=9000' stdout], [], [stdout])
dnl Decrease MTU value and check in the datapath
AT_CHECK([ovs-vsctl set Interface dpdkvhostuserclient0 mtu_request=2000])
AT_CHECK([ovs-appctl dpctl/show], [], [stdout])
AT_CHECK([grep -E 'mtu=2000' stdout], [], [stdout])
dnl Clean up the testpmd now
pkill -f -x -9 'tail -f /dev/null'
dnl Clean up
AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr])
OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [
\@VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) failed to connect: No such file or directory@d
])")
AT_CLEANUP
dnl --------------------------------------------------------------------------
dnl --------------------------------------------------------------------------
dnl MTU upper bound phy port
AT_SETUP([OVS-DPDK - MTU upper bound phy port])
AT_KEYWORDS([dpdk])
OVS_DPDK_PRE_PHY_SKIP()
OVS_DPDK_START()
dnl Add userspace bridge and attach it to OVS and set MTU value to max upper bound
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
AT_CHECK([ovs-vsctl add-port br10 phy0 -- set Interface phy0 type=dpdk options:dpdk-devargs=$(cat PCI_ADDR)], [], [stdout], [stderr])
AT_CHECK([ovs-vsctl set Interface phy0 mtu_request=9702])
AT_CHECK([ovs-vsctl show], [], [stdout])
sleep 2
dnl Fail if MTU is not supported
AT_FAIL_IF([grep "Interface phy0 does not support MTU configuration" ovs-vswitchd.log], [], [stdout])
dnl Fail if error is encountered during MTU setup
AT_FAIL_IF([grep "Interface phy0 MTU (9702) setup error" ovs-vswitchd.log], [], [stdout])
dnl Check MTU value in the datapath
AT_CHECK([ovs-appctl dpctl/show], [], [stdout])
AT_CHECK([grep -E 'mtu=9702' stdout], [], [stdout])
dnl Set MTU value above upper bound and check for error
AT_CHECK([ovs-vsctl set Interface phy0 mtu_request=9711])
AT_CHECK([grep "phy0: unsupported MTU 9711" ovs-vswitchd.log], [], [stdout])
dnl Clean up
AT_CHECK([ovs-vsctl del-port br10 phy0], [], [stdout], [stderr])
OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [
\@phy0: unsupported MTU 9711@d
\@failed to set MTU for network device phy0: Invalid argument@d
])")
AT_CLEANUP
dnl --------------------------------------------------------------------------
dnl --------------------------------------------------------------------------
dnl MTU lower bound phy port
AT_SETUP([OVS-DPDK - MTU lower bound phy port])
AT_KEYWORDS([dpdk])
OVS_DPDK_PRE_PHY_SKIP()
OVS_DPDK_START()
dnl Add userspace bridge and attach it to OVS and set MTU value to min lower bound
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
AT_CHECK([ovs-vsctl add-port br10 phy0 -- set Interface phy0 type=dpdk options:dpdk-devargs=$(cat PCI_ADDR)], [], [stdout], [stderr])
AT_CHECK([ovs-vsctl set Interface phy0 mtu_request=68])
AT_CHECK([ovs-vsctl show], [], [stdout])
sleep 2
dnl Fail if MTU is not supported
AT_FAIL_IF([grep "Interface phy0 does not support MTU configuration" ovs-vswitchd.log], [], [stdout])
dnl Fail if error is encountered during MTU setup
AT_FAIL_IF([grep "Interface phy0 MTU (68) setup error" ovs-vswitchd.log], [], [stdout])
dnl Check MTU value in the datapath
AT_CHECK([ovs-appctl dpctl/show], [], [stdout])
AT_CHECK([grep -E 'mtu=68' stdout], [], [stdout])
dnl Set MTU value below lower bound and check for error
AT_CHECK([ovs-vsctl set Interface phy0 mtu_request=67])
AT_CHECK([grep "phy0: unsupported MTU 67" ovs-vswitchd.log], [], [stdout])
dnl Clean up
AT_CHECK([ovs-vsctl del-port br10 phy0], [], [stdout], [stderr])
OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [
\@phy0: unsupported MTU 67@d
\@failed to set MTU for network device phy0: Invalid argument@d
])")
AT_CLEANUP
dnl --------------------------------------------------------------------------
dnl --------------------------------------------------------------------------
dnl MTU upper bound vport port
AT_SETUP([OVS-DPDK - MTU upper bound vport port])
AT_KEYWORDS([dpdk])
AT_SKIP_IF([! which dpdk-testpmd >/dev/null 2>/dev/null])
OVS_DPDK_PRE_CHECK()
OVS_DPDK_START()
dnl Find number of sockets
AT_CHECK([lscpu], [], [stdout])
AT_CHECK([cat stdout | grep "NUMA node(s)" | awk '{c=1; while (c++<$(3)) {printf "512,"}; print "512"}' > NUMA_NODE])
dnl Add userspace bridge and attach it to OVS and set MTU value to max upper bound
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
AT_CHECK([ovs-vsctl add-port br10 dpdkvhostuserclient0 -- set Interface dpdkvhostuserclient0 type=dpdkvhostuserclient options:vhost-server-path=$OVS_RUNDIR/dpdkvhostclient0], [], [stdout], [stderr])
AT_CHECK([ovs-vsctl set Interface dpdkvhostuserclient0 mtu_request=9702])
AT_CHECK([ovs-vsctl show], [], [stdout])
sleep 2
dnl Execute testpmd in background
on_exit "pkill -f -x -9 'tail -f /dev/null'"
tail -f /dev/null | dpdk-testpmd --socket-mem="$(cat NUMA_NODE)" --no-pci\
--vdev="net_virtio_user,path=$OVS_RUNDIR/dpdkvhostclient0,server=1" \
--vdev="net_tap0,iface=tap0" --file-prefix page0 \
--single-file-segments -- -a >$OVS_RUNDIR/testpmd-dpdkvhostuserclient0.log 2>&1 &
OVS_WAIT_UNTIL([grep "virtio is now ready for processing" ovs-vswitchd.log])
dnl Check MTU value in the datapath
AT_CHECK([ovs-appctl dpctl/show], [], [stdout])
AT_CHECK([grep -E 'mtu=9702' stdout], [], [stdout])
dnl Set MTU value above upper bound and check for error
AT_CHECK([ovs-vsctl set Interface dpdkvhostuserclient0 mtu_request=9711])
AT_CHECK([grep "dpdkvhostuserclient0: unsupported MTU 9711" ovs-vswitchd.log], [], [stdout])
dnl Clean up the testpmd now
pkill -f -x -9 'tail -f /dev/null'
dnl Clean up
AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr])
OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [
\@VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) failed to connect: No such file or directory@d
\@dpdkvhostuserclient0: unsupported MTU 9711@d
\@failed to set MTU for network device dpdkvhostuserclient0: Invalid argument@d
])")
AT_CLEANUP
dnl --------------------------------------------------------------------------
dnl --------------------------------------------------------------------------
dnl MTU lower bound vport port
AT_SETUP([OVS-DPDK - MTU lower bound vport port])
AT_KEYWORDS([dpdk])
AT_SKIP_IF([! which dpdk-testpmd >/dev/null 2>/dev/null])
OVS_DPDK_PRE_CHECK()
OVS_DPDK_START()
dnl Find number of sockets
AT_CHECK([lscpu], [], [stdout])
AT_CHECK([cat stdout | grep "NUMA node(s)" | awk '{c=1; while (c++<$(3)) {printf "512,"}; print "512"}' > NUMA_NODE])
dnl Add userspace bridge and attach it to OVS and set MTU value to min lower bound
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
AT_CHECK([ovs-vsctl add-port br10 dpdkvhostuserclient0 -- set Interface dpdkvhostuserclient0 type=dpdkvhostuserclient options:vhost-server-path=$OVS_RUNDIR/dpdkvhostclient0], [], [stdout], [stderr])
AT_CHECK([ovs-vsctl set Interface dpdkvhostuserclient0 mtu_request=68])
AT_CHECK([ovs-vsctl show], [], [stdout])
sleep 2
dnl Parse log file
AT_CHECK([grep "VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) vhost-user client: socket created" ovs-vswitchd.log], [], [stdout])
AT_CHECK([grep "vHost User device 'dpdkvhostuserclient0' created in 'client' mode, using client socket" ovs-vswitchd.log], [], [stdout])
AT_CHECK([grep "VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) reconnecting..." ovs-vswitchd.log], [], [stdout])
dnl Execute testpmd in background
on_exit "pkill -f -x -9 'tail -f /dev/null'"
tail -f /dev/null | dpdk-testpmd --socket-mem="$(cat NUMA_NODE)" --no-pci\
--vdev="net_virtio_user,path=$OVS_RUNDIR/dpdkvhostclient0,server=1" \
--vdev="net_tap0,iface=tap0" --file-prefix page0 \
--single-file-segments -- -a >$OVS_RUNDIR/testpmd-dpdkvhostuserclient0.log 2>&1 &
OVS_WAIT_UNTIL([grep "virtio is now ready for processing" ovs-vswitchd.log])
dnl Check MTU value in the datapath
AT_CHECK([ovs-appctl dpctl/show], [], [stdout])
AT_CHECK([grep -E 'mtu=68' stdout], [], [stdout])
dnl Set MTU value below lower bound and check for error
AT_CHECK([ovs-vsctl set Interface dpdkvhostuserclient0 mtu_request=67])
AT_CHECK([grep "dpdkvhostuserclient0: unsupported MTU 67" ovs-vswitchd.log], [], [stdout])
dnl Clean up the testpmd now
pkill -f -x -9 'tail -f /dev/null'
dnl Clean up
AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr])
OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [
\@VHOST_CONFIG: ($OVS_RUNDIR/dpdkvhostclient0) failed to connect: No such file or directory@d
\@dpdkvhostuserclient0: unsupported MTU 67@d
\@failed to set MTU for network device dpdkvhostuserclient0: Invalid argument@d
])")
AT_CLEANUP
dnl --------------------------------------------------------------------------
dnl --------------------------------------------------------------------------
dnl MFEX Autovalidator
AT_SETUP([OVS-DPDK - MFEX Autovalidator])
AT_KEYWORDS([dpdk])
OVS_DPDK_PRE_CHECK()
OVS_DPDK_START()
AT_CHECK([ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev])
AT_SKIP_IF([! ovs-appctl dpif-netdev/miniflow-parser-get | sed 1,4d | grep "True"], [], [dnl
])
AT_SKIP_IF([! $PYTHON3 -c "import scapy"], [], [])
AT_CHECK([$PYTHON3 $srcdir/mfex_fuzzy.py test_traffic.pcap 2000], [], [stdout])
dnl Add userspace bridge and attach it to OVS
AT_CHECK([ovs-vsctl add-port br0 p1 -- set Interface p1 type=dpdk options:dpdk-devargs=net_pcap1,rx_pcap=test_traffic.pcap,infinite_rx=1], [], [stdout], [stderr])
AT_CHECK([ovs-vsctl show], [], [stdout])
AT_CHECK([ovs-appctl dpif-netdev/dpif-impl-set dpif_avx512], [0], [dnl
DPIF implementation set to dpif_avx512.
])
AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set autovalidator], [0], [dnl
Miniflow extract implementation set to autovalidator.
])
OVS_WAIT_UNTIL([test `ovs-vsctl get interface p1 statistics | grep -oP 'rx_packets=\s*\K\d+'` -ge 16000])
dnl Clean up
AT_CHECK([ovs-vsctl del-port br0 p1], [], [stdout], [stderr])
OVS_VSWITCHD_STOP("[SYSTEM_DPDK_ALLOWED_LOGS]")
AT_CLEANUP
dnl --------------------------------------------------------------------------
dnl --------------------------------------------------------------------------
dnl MFEX Autovalidator Fuzzy
AT_SETUP([OVS-DPDK - MFEX Autovalidator Fuzzy])
AT_KEYWORDS([dpdk])
OVS_DPDK_PRE_CHECK()
OVS_DPDK_START()
AT_CHECK([ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev])
AT_SKIP_IF([! ovs-appctl dpif-netdev/miniflow-parser-get | sed 1,4d | grep "True"], [], [dnl
])
AT_SKIP_IF([! $PYTHON3 -c "import scapy"], [], [])
AT_CHECK([$PYTHON3 $srcdir/mfex_fuzzy.py fuzzy.pcap 2000 fuzzy], [], [stdout])
dnl Add userspace bridge and attach it to OVS
AT_CHECK([ovs-vsctl add-port br0 p1 -- set Interface p1 type=dpdk options:dpdk-devargs=net_pcap1,rx_pcap=fuzzy.pcap,infinite_rx=1], [], [stdout], [stderr])
AT_CHECK([ovs-vsctl show], [], [stdout])
AT_CHECK([ovs-appctl dpif-netdev/dpif-impl-set dpif_avx512], [0], [dnl
DPIF implementation set to dpif_avx512.
])
AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set autovalidator], [0], [dnl
Miniflow extract implementation set to autovalidator.
])
OVS_WAIT_UNTIL([test `ovs-vsctl get interface p1 statistics | grep -oP 'rx_packets=\s*\K\d+'` -ge 16000])
dnl Clean up
AT_CHECK([ovs-vsctl del-port br0 p1], [], [stdout], [stderr])
OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [
\@upcall: datapath reached the dynamic limit of .* flows.@d
])")
AT_CLEANUP
dnl --------------------------------------------------------------------------
dnl --------------------------------------------------------------------------
AT_SETUP([OVS-DPDK - MFEX Configuration])
AT_KEYWORDS([dpdk])
OVS_DPDK_PRE_CHECK()
AT_SKIP_IF([! $PYTHON3 -c "import scapy"], [], [])
AT_CHECK([$PYTHON3 $srcdir/mfex_fuzzy.py test_traffic.pcap 1], [], [stdout])
OVS_DPDK_START()
AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:pmd-cpu-mask=0x1])
dnl Add userspace bridge and attach it to OVS
AT_CHECK([ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev])
AT_CHECK([ovs-vsctl add-port br0 p1 -- set Interface p1 type=dpdk options:dpdk-devargs=net_pcap1,rx_pcap=test_traffic.pcap,infinite_rx=1], [], [stdout], [stderr])
AT_CHECK([ovs-vsctl show], [], [stdout])
AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set scalar 1], [2],
[], [dnl
Error: unknown argument 1.
ovs-appctl: ovs-vswitchd: server returned an error
])
AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 6 study 300 xyz], [2],
[], [dnl
Error: invalid study_pkt_cnt value: xyz.
ovs-appctl: ovs-vswitchd: server returned an error
])
AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set scalar abcd], [2],
[], [dnl
Error: unknown argument abcd.
ovs-appctl: ovs-vswitchd: server returned an error
])
AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 0 scalar abcd], [2],
[], [dnl
Error: unknown argument abcd.
ovs-appctl: ovs-vswitchd: server returned an error
])
AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd], [2],
[], [dnl
Error: -pmd option requires a thread id argument.
ovs-appctl: ovs-vswitchd: server returned an error
])
AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set tudy abcd], [2],
[], [dnl
Error: unknown argument abcd.
ovs-appctl: ovs-vswitchd: server returned an error
])
AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 7 study abcd], [2],
[], [dnl
Error: invalid study_pkt_cnt value: abcd.
ovs-appctl: ovs-vswitchd: server returned an error
])
AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 0 study], [0], [dnl
Miniflow extract implementation set to study, on pmd thread 0, studying 128 packets.
])
AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 0 study 512], [0], [dnl
Miniflow extract implementation set to study, on pmd thread 0, studying 512 packets.
])
AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set study 512], [0], [dnl
Miniflow extract implementation set to study, studying 512 packets.
])
AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set study], [0], [dnl
Miniflow extract implementation set to study, studying 128 packets.
])
AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 0 autovalidator], [0], [dnl
Miniflow extract implementation set to autovalidator, on pmd thread 0.
])
AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd zero study], [2],
[], [dnl
Error: miniflow extract parser not changed, PMD thread passed is not valid: 'zero'. Pass a valid pmd thread ID.
ovs-appctl: ovs-vswitchd: server returned an error
])
AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 1], [2],
[], [dnl
Error: no miniflow extract name provided. Output of miniflow-parser-get shows implementation list.
ovs-appctl: ovs-vswitchd: server returned an error
])
AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 1 superstudy], [2],
[], [dnl
Error: unknown miniflow extract implementation superstudy.
ovs-appctl: ovs-vswitchd: server returned an error
])
AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set superstudy], [2],
[], [dnl
Error: unknown miniflow extract implementation superstudy.
ovs-appctl: ovs-vswitchd: server returned an error
])
AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 1 study -pmd], [2],
[], [dnl
Error: invalid study_pkt_cnt value: -pmd.
ovs-appctl: ovs-vswitchd: server returned an error
])
dnl Clean up
AT_CHECK([ovs-vsctl del-port br0 p1], [], [stdout], [stderr])
OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [
\@Error: unknown argument 1.@d
\@Error: invalid study_pkt_cnt value: xyz.@d
\@Error: unknown argument abcd.@d
\@Error: -pmd option requires a thread id argument.@d
\@Error: invalid study_pkt_cnt value: abcd.@d
\@Error: miniflow extract parser not changed, PMD thread passed is not valid: 'zero'. Pass a valid pmd thread ID.@d
\@Error: no miniflow extract name provided. Output of miniflow-parser-get shows implementation list.@d
\@Error: unknown miniflow extract implementation superstudy.@d
\@Error: invalid study_pkt_cnt value: -pmd.@d
])")
AT_CLEANUP dnl
dnl --------------------------------------------------------------------------
dnl --------------------------------------------------------------------------
dnl Setup user configured mempools
AT_SETUP([OVS-DPDK - user configured mempool])
AT_KEYWORDS([dpdk])
OVS_DPDK_PRE_CHECK()
OVS_DPDK_START_OVSDB()
OVS_DPDK_START_VSWITCHD()
AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:shared-mempool-config=8000,6000,1500])
AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true])
CHECK_MEMPOOL_PARAM([8000], [ALL], [])
CHECK_MEMPOOL_PARAM([6000], [ALL], [])
CHECK_MEMPOOL_PARAM([1500], [ALL], [])
AT_CHECK(ovs-appctl vlog/set netdev_dpdk:dbg)
dnl Add userspace bridge and a dpdk port
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
AT_CHECK([ovs-vsctl add-port br10 p1 -- set Interface p1 type=dpdk options:dpdk-devargs=net_null0,no-rx=1], [], [stdout], [stderr])
AT_CHECK([ovs-vsctl show], [], [stdout])
sleep 2
dnl Check if the right user configured mempool is found for default MTU (1500)
AT_CHECK([grep "Found user configured shared mempool .* suitable for port with MTU 1500" ovs-vswitchd.log], [], [stdout])
AT_CHECK([grep "Port p1: Requesting a mempool" ovs-vswitchd.log], [], [stdout])
dnl Change the MTU value to 7000 to trigger mempool change
TMP=$(($(cat ovs-vswitchd.log | wc -l | tr -d [[:blank:]])+1))
AT_CHECK(ovs-vsctl set Interface p1 mtu_request=7000)
OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "Found user configured shared mempool .* suitable for port with MTU 7000"])
OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "Port p1: Requesting a mempool"])
dnl Change back the MTU value to 1500 to trigger mempool change (re-use)
TMP=$(($(cat ovs-vswitchd.log | wc -l | tr -d [[:blank:]])+1))
AT_CHECK(ovs-vsctl set Interface p1 mtu_request=1500)
OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "Found user configured shared mempool .* suitable for port with MTU 1500"])
OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "Reusing mempool"])
dnl Change the MTU value beyond the max value in shared-mempool-config list
TMP=$(($(cat ovs-vswitchd.log | wc -l | tr -d [[:blank:]])+1))
AT_CHECK(ovs-vsctl set Interface p1 mtu_request=9000)
OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "No user configured shared mempool mbuf sizes found suitable for port with MTU 9000"])
OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "Port p1: Requesting a mempool"])
dnl Clean up
AT_CHECK([ovs-vsctl del-port br10 p1], [], [stdout], [stderr])
OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [
])")
AT_CLEANUP
dnl --------------------------------------------------------------------------
|