Newer
Older
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
diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index 3e5136fd4e..1acf5012db 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -201,7 +201,7 @@ fi
if [ "$DPDK" ] || [ "$DPDK_SHARED" ]; then
if [ -z "$DPDK_VER" ]; then
- DPDK_VER="20.11"
+ DPDK_VER="20.11.1"
fi
install_dpdk $DPDK_VER
if [ "$CC" = "clang" ]; then
@@ -235,7 +235,7 @@ if [ "$TESTSUITE" ]; then
configure_ovs
export DISTCHECK_CONFIGURE_FLAGS="$OPTS"
- if ! make distcheck CFLAGS="${CFLAGS_FOR_OVS}" \
+ if ! make distcheck -j4 CFLAGS="${CFLAGS_FOR_OVS}" \
TESTSUITEFLAGS=-j4 RECHECK=yes; then
# testsuite.log is necessary for debugging.
cat */_build/sub/tests/testsuite.log
diff --git a/.cirrus.yml b/.cirrus.yml
index 2caf36b85c..358f2ba256 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -8,8 +8,8 @@ freebsd_build_task:
memory: 8G
env:
- DEPENDENCIES: automake libtool gmake gcc wget openssl
- python3 py37-openssl py37-sphinx
+ DEPENDENCIES: automake libtool gmake gcc wget openssl python3
+ PY_DEPS: sphinx|openssl
matrix:
COMPILER: gcc
COMPILER: clang
@@ -18,6 +18,7 @@ freebsd_build_task:
- sysctl -w kern.coredump=0
- pkg update -f
- pkg install -y ${DEPENDENCIES}
+ $(pkg search -xq "^py3[0-9]+-(${PY_DEPS})-[0-9]+" | xargs)
configure_script:
- ./boot.sh
diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
index c4487226be..c96666b305 100644
--- a/.github/workflows/build-and-test.yml
+++ b/.github/workflows/build-and-test.yml
@@ -113,6 +113,12 @@ jobs:
- name: checkout
uses: actions/checkout@v2
+ - name: fix up /etc/hosts
+ # https://github.com/actions/virtual-environments/issues/3353
+ run: |
+ cat /etc/hosts
+ sudo sed -i "/don't remove this line/d" /etc/hosts || true
+
- name: create ci signature file for the dpdk cache key
if: matrix.dpdk != '' || matrix.dpdk_shared != ''
# This will collect most of DPDK related lines, so hash will be different
diff --git a/Documentation/automake.mk b/Documentation/automake.mk
index ea3475f356..2a590b3a79 100644
--- a/Documentation/automake.mk
+++ b/Documentation/automake.mk
@@ -216,8 +216,13 @@ install-man-rst: docs-check
$(extract_stem_and_section); \
echo " $(MKDIR_P) '$(DESTDIR)'\"$$mandir\""; \
$(MKDIR_P) '$(DESTDIR)'"$$mandir"; \
- echo " $(INSTALL_DATA) $(SPHINXBUILDDIR)/man/$$stem.$$section '$(DESTDIR)'\"$$mandir/$$stem.$$section\""; \
- $(INSTALL_DATA) $(SPHINXBUILDDIR)/man/$$stem.$$section '$(DESTDIR)'"$$mandir/$$stem.$$section"; \
+ if test -f $(SPHINXBUILDDIR)/man/$$stem.$$section; then \
+ filepath=$(SPHINXBUILDDIR)/man/$$stem.$$section; \
+ else \
+ filepath=$(SPHINXBUILDDIR)/man/$$section/$$stem.$$section; \
+ fi; \
+ echo " $(INSTALL_DATA) $$filepath '$(DESTDIR)'\"$$mandir/$$stem.$$section\""; \
+ $(INSTALL_DATA) $$filepath '$(DESTDIR)'"$$mandir/$$stem.$$section"; \
done
else
install-man-rst:
diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index 6a5e4141f1..3bc34c892f 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -204,9 +204,9 @@ Q: What DPDK version does each Open vSwitch release work with?
2.10.x 17.11.10
2.11.x 18.11.9
2.12.x 18.11.9
- 2.13.x 19.11.2
- 2.14.x 19.11.2
- 2.15.x 20.11.0
+ 2.13.x 19.11.8
+ 2.14.x 19.11.8
+ 2.15.x 20.11.1
============ ========
Q: Are all the DPDK releases that OVS versions work with maintained?
diff --git a/Documentation/intro/install/dpdk.rst b/Documentation/intro/install/dpdk.rst
index 3a24e54f97..612f2fdbc3 100644
--- a/Documentation/intro/install/dpdk.rst
+++ b/Documentation/intro/install/dpdk.rst
@@ -42,7 +42,7 @@ Build requirements
In addition to the requirements described in :doc:`general`, building Open
vSwitch with DPDK will require the following:
-- DPDK 20.11
+- DPDK 20.11.1
- A `DPDK supported NIC`_
@@ -73,9 +73,9 @@ Install DPDK
#. Download the `DPDK sources`_, extract the file and set ``DPDK_DIR``::
$ cd /usr/src/
- $ wget https://fast.dpdk.org/rel/dpdk-20.11.tar.xz
- $ tar xf dpdk-20.11.tar.xz
- $ export DPDK_DIR=/usr/src/dpdk-20.11
+ $ wget https://fast.dpdk.org/rel/dpdk-20.11.1.tar.xz
+ $ tar xf dpdk-20.11.1.tar.xz
+ $ export DPDK_DIR=/usr/src/dpdk-stable-20.11.1
$ cd $DPDK_DIR
#. Configure and install DPDK using Meson
diff --git a/Documentation/topics/dpdk/pmd.rst b/Documentation/topics/dpdk/pmd.rst
index caa7d97bef..e481e79414 100644
--- a/Documentation/topics/dpdk/pmd.rst
+++ b/Documentation/topics/dpdk/pmd.rst
@@ -239,7 +239,9 @@ If not set, the default variance improvement threshold is 25%.
PMD Auto Load Balancing doesn't currently work if queues are assigned
cross NUMA as actual processing load could get worse after assignment
- as compared to what dry run predicts.
+ as compared to what dry run predicts. The only exception is when all
+ PMD threads are running on cores from a single NUMA node. In this case
+ Auto Load Balancing is still possible.
The minimum time between 2 consecutive PMD auto load balancing iterations can
also be configured by::
diff --git a/Documentation/topics/dpdk/qos.rst b/Documentation/topics/dpdk/qos.rst
index 103495415a..a98ec672fc 100644
--- a/Documentation/topics/dpdk/qos.rst
+++ b/Documentation/topics/dpdk/qos.rst
@@ -69,22 +69,24 @@ to prioritize certain traffic over others at a port level.
For example, the following configuration will limit the traffic rate at a
port level to a maximum of 2000 packets a second (64 bytes IPv4 packets).
-100pps as CIR (Committed Information Rate) and 1000pps as EIR (Excess
-Information Rate). High priority traffic is routed to queue 10, which marks
+1000pps as CIR (Committed Information Rate) and 1000pps as EIR (Excess
+Information Rate). CIR and EIR are measured in bytes without Ethernet header.
+As a result, 1000pps means (64-byte - 14-byte) * 1000 = 50,000 in the
+configuration below. High priority traffic is routed to queue 10, which marks
all traffic as CIR, i.e. Green. All low priority traffic, queue 20, is
marked as EIR, i.e. Yellow::
$ ovs-vsctl --timeout=5 set port dpdk1 qos=@myqos -- \
--id=@myqos create qos type=trtcm-policer \
- other-config:cir=52000 other-config:cbs=2048 \
- other-config:eir=52000 other-config:ebs=2048 \
+ other-config:cir=50000 other-config:cbs=2048 \
+ other-config:eir=50000 other-config:ebs=2048 \
queues:10=@dpdk1Q10 queues:20=@dpdk1Q20 -- \
--id=@dpdk1Q10 create queue \
- other-config:cir=41600000 other-config:cbs=2048 \
+ other-config:cir=100000 other-config:cbs=2048 \
other-config:eir=0 other-config:ebs=0 -- \
--id=@dpdk1Q20 create queue \
other-config:cir=0 other-config:cbs=0 \
- other-config:eir=41600000 other-config:ebs=2048 \
+ other-config:eir=50000 other-config:ebs=2048
This configuration accomplishes that the high priority traffic has a
guaranteed bandwidth egressing the ports at CIR (1000pps), but it can also
diff --git a/NEWS b/NEWS
index bc901efdb1..154a299d93 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,21 @@
+v2.15.2 - xx xxx xxxx
+---------------------
+ - OVS now reports the datapath capability 'ct_zero_snat', which reflects
+ whether the SNAT with all-zero IP address is supported.
+ See ovs-vswitchd.conf.db(5) for details.
+
+v2.15.1 - 01 Jul 2021
+---------------------
+ - Bug fixes
+ - ovs-ctl:
+ * New option '--no-record-hostname' to disable hostname configuration
+ in ovsdb on startup.
+ * New command 'record-hostname-if-not-set' to update hostname in ovsdb.
+ - DPDK:
+ * OVS validated with DPDK 20.11.1. It is recommended to use this version
+ until further releases.
+
+
v2.15.0 - 15 Feb 2021
---------------------
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
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
- OVSDB:
diff --git a/acinclude.m4 b/acinclude.m4
index 435685c93d..15a54d636f 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -209,10 +209,10 @@ dnl Configure Linux tc compat.
AC_DEFUN([OVS_CHECK_LINUX_TC], [
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([#include <linux/pkt_cls.h>], [
- int x = TCA_ACT_FLAGS;
+ int x = TCA_FLOWER_KEY_CT_FLAGS_REPLY;
])],
- [AC_DEFINE([HAVE_TCA_ACT_FLAGS], [1],
- [Define to 1 if TCA_ACT_FLAGS is available.])])
+ [AC_DEFINE([HAVE_TCA_FLOWER_KEY_CT_FLAGS_REPLY], [1],
+ [Define to 1 if TCA_FLOWER_KEY_CT_FLAGS_REPLY is available.])])
AC_CHECK_MEMBERS([struct tcf_t.firstuse], [], [], [#include <linux/pkt_cls.h>])
diff --git a/configure.ac b/configure.ac
index fd82d7d270..bcee218005 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,7 +13,7 @@
# limitations under the License.
AC_PREREQ(2.63)
-AC_INIT(openvswitch, 2.15.0, bugs@openvswitch.org)
+AC_INIT(openvswitch, 2.15.2, bugs@openvswitch.org)
AC_CONFIG_SRCDIR([datapath/datapath.c])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])
diff --git a/datapath-windows/ovsext/Actions.c b/datapath-windows/ovsext/Actions.c
index 4f43369844..e130c2f966 100644
--- a/datapath-windows/ovsext/Actions.c
+++ b/datapath-windows/ovsext/Actions.c
@@ -1550,9 +1550,21 @@ OvsUpdateAddressAndPort(OvsForwardingContext *ovsFwdCtx,
if (tcpHdr) {
portField = &tcpHdr->dest;
checkField = &tcpHdr->check;
+ l4Offload = isTx ? (BOOLEAN)csumInfo.Transmit.TcpChecksum :
+ ((BOOLEAN)csumInfo.Receive.TcpChecksumSucceeded ||
+ (BOOLEAN)csumInfo.Receive.TcpChecksumFailed);
} else if (udpHdr) {
portField = &udpHdr->dest;
checkField = &udpHdr->check;
+ l4Offload = isTx ? (BOOLEAN)csumInfo.Transmit.UdpChecksum :
+ ((BOOLEAN)csumInfo.Receive.UdpChecksumSucceeded ||
+ (BOOLEAN)csumInfo.Receive.UdpChecksumFailed);
+ }
+
+ if (l4Offload) {
+ *checkField = IPPseudoChecksum(&ipHdr->saddr, &newAddr,
+ tcpHdr ? IPPROTO_TCP : IPPROTO_UDP,
+ ntohs(ipHdr->tot_len) - ipHdr->ihl * 4);
}
}
diff --git a/datapath-windows/ovsext/ovsext.vcxproj b/datapath-windows/ovsext/ovsext.vcxproj
index d50a126b43..18f884f41b 100644
--- a/datapath-windows/ovsext/ovsext.vcxproj
+++ b/datapath-windows/ovsext/ovsext.vcxproj
@@ -192,22 +192,39 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win10 Release|x64'">
<Inf2CatUseLocalTime>true</Inf2CatUseLocalTime>
+ <ExternalIncludePath>$(CRT_IncludePath);$(KM_IncludePath);</ExternalIncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win10 Debug|x64'">
<Inf2CatUseLocalTime>true</Inf2CatUseLocalTime>
+ <ExternalIncludePath>$(CRT_IncludePath);$(KM_IncludePath);</ExternalIncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win10Analyze|x64'">
<Inf2CatUseLocalTime>true</Inf2CatUseLocalTime>
<CodeAnalysisRuleSet>..\misc\DriverRecommendedRules.ruleset</CodeAnalysisRuleSet>
<RunCodeAnalysis>true</RunCodeAnalysis>
+ <ExternalIncludePath>$(CRT_IncludePath);$(KM_IncludePath);</ExternalIncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8.1Analyze|x64'">
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>..\misc\DriverRecommendedRules.ruleset</CodeAnalysisRuleSet>
+ <ExternalIncludePath>$(CRT_IncludePath);$(KM_IncludePath);</ExternalIncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8Analyze|x64'">
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>..\misc\DriverRecommendedRules.ruleset</CodeAnalysisRuleSet>
+ <ExternalIncludePath>$(CRT_IncludePath);$(KM_IncludePath);</ExternalIncludePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|x64'">
+ <ExternalIncludePath>$(CRT_IncludePath);$(KM_IncludePath);</ExternalIncludePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Release|x64'">
+ <ExternalIncludePath>$(CRT_IncludePath);$(KM_IncludePath);</ExternalIncludePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8.1 Debug|x64'">
+ <ExternalIncludePath>$(CRT_IncludePath);$(KM_IncludePath);</ExternalIncludePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8.1 Release|x64'">
+ <ExternalIncludePath>$(CRT_IncludePath);$(KM_IncludePath);</ExternalIncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Release|x64'">
<ClCompile>
diff --git a/debian/changelog b/debian/changelog
index 1f2b7a3668..ed5b127e59 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+openvswitch (2.15.2-1) unstable; urgency=low
+ [ Open vSwitch team ]
+ * New upstream version
+
+ -- Open vSwitch team <dev@openvswitch.org> Thu, 01 Jul 2021 20:19:24 +0200
+
+openvswitch (2.15.1-1) unstable; urgency=low
+ [ Open vSwitch team ]
+ * New upstream version
+
+ -- Open vSwitch team <dev@openvswitch.org> Thu, 01 Jul 2021 20:19:24 +0200
+
openvswitch (2.15.0-1) unstable; urgency=low
* New upstream version
diff --git a/dpdk/VERSION b/dpdk/VERSION
index 8b0beab16a..2dbbe00e67 100644
--- a/dpdk/VERSION
+++ b/dpdk/VERSION
@@ -1 +1 @@
-20.11.0
+20.11.1
diff --git a/dpdk/app/meson.build b/dpdk/app/meson.build
index eb74f215a3..87fc195dbf 100644
--- a/dpdk/app/meson.build
+++ b/dpdk/app/meson.build
@@ -25,6 +25,10 @@ apps = [
lib_execinfo = cc.find_library('execinfo', required: false)
default_cflags = machine_args + ['-DALLOW_EXPERIMENTAL_API']
+default_ldflags = []
+if get_option('default_library') == 'static' and not is_windows
+ default_ldflags += ['-Wl,--export-dynamic']
+endif
foreach app:apps
build = true
@@ -32,6 +36,7 @@ foreach app:apps
sources = []
includes = []
cflags = default_cflags
+ ldflags = default_ldflags
objs = [] # other object files to link against, used e.g. for
# instruction-set optimized versions of code
@@ -58,8 +63,10 @@ foreach app:apps
executable('dpdk-' + name,
sources,
c_args: cflags,
+ link_args: ldflags,
link_whole: link_libs,
dependencies: dep_objs,
+ include_directories: includes,
install_rpath: join_paths(get_option('prefix'),
driver_install_path),
install: true)
diff --git a/dpdk/app/proc-info/main.c b/dpdk/app/proc-info/main.c
index d743209f0d..b9587f7ded 100644
--- a/dpdk/app/proc-info/main.c
+++ b/dpdk/app/proc-info/main.c
@@ -5,6 +5,7 @@
#include <stdio.h>
#include <string.h>
#include <stdint.h>
+#include <stdbool.h>
#include <errno.h>
#include <stdarg.h>
#include <inttypes.h>
@@ -301,14 +302,13 @@ proc_info_parse_args(int argc, char **argv)
} else if (!strncmp(long_option[option_index].name,
"xstats-ids",
MAX_LONG_OPT_SZ)) {
- nb_xstats_ids = parse_xstats_ids(optarg,
+ int ret = parse_xstats_ids(optarg,
xstats_ids, MAX_NB_XSTATS_IDS);
-
- if (nb_xstats_ids <= 0) {
+ if (ret <= 0) {
printf("xstats-id list parse error.\n");
return -1;
}
-
+ nb_xstats_ids = ret;
}
break;
default:
@@ -420,11 +420,9 @@ static void collectd_resolve_cnt_type(char *cnt_type, size_t cnt_type_len,
} else if ((type_end != NULL) &&
(strncmp(cnt_name, "flow_", strlen("flow_"))) == 0) {
if (strncmp(type_end, "_filters", strlen("_filters")) == 0)
- strlcpy(cnt_type, "operations", cnt_type_len);
+ strlcpy(cnt_type, "filter_result", cnt_type_len);
else if (strncmp(type_end, "_errors", strlen("_errors")) == 0)
strlcpy(cnt_type, "errors", cnt_type_len);
- else if (strncmp(type_end, "_filters", strlen("_filters")) == 0)
- strlcpy(cnt_type, "filter_result", cnt_type_len);
} else if ((type_end != NULL) &&
(strncmp(cnt_name, "mac_", strlen("mac_"))) == 0) {
if (strncmp(type_end, "_errors", strlen("_errors")) == 0)
@@ -648,11 +646,16 @@ metrics_display(int port_id)
}
static void
-show_security_context(uint16_t portid)
+show_security_context(uint16_t portid, bool inline_offload)
{
- void *p_ctx = rte_eth_dev_get_sec_ctx(portid);
+ void *p_ctx;
const struct rte_security_capability *s_cap;
+ if (inline_offload)
+ p_ctx = rte_eth_dev_get_sec_ctx(portid);
+ else
+ p_ctx = rte_cryptodev_get_sec_ctx(portid);
+
if (p_ctx == NULL)
return;
@@ -859,7 +862,7 @@ show_port(void)
}
#ifdef RTE_LIB_SECURITY
- show_security_context(i);
+ show_security_context(i, true);
#endif
}
}
@@ -1210,7 +1213,6 @@ show_crypto(void)
display_crypto_feature_info(dev_info.feature_flags);
- memset(&stats, 0, sizeof(0));
if (rte_cryptodev_stats_get(i, &stats) == 0) {
printf("\t -- stats\n");
printf("\t\t + enqueue count (%"PRIu64")"
@@ -1224,7 +1226,7 @@ show_crypto(void)
}
#ifdef RTE_LIB_SECURITY
- show_security_context(i);
+ show_security_context(i, false);
#endif
}
}
@@ -1268,8 +1270,6 @@ show_ring(char *name)
static void
show_mempool(char *name)
{
- uint64_t flags = 0;
-
snprintf(bdr_str, MAX_STRING_LEN, " show - MEMPOOL ");
STATS_BDR_STR(10, bdr_str);
@@ -1277,8 +1277,8 @@ show_mempool(char *name)
struct rte_mempool *ptr = rte_mempool_lookup(name);
if (ptr != NULL) {
struct rte_mempool_ops *ops;
+ uint64_t flags = ptr->flags;
- flags = ptr->flags;
ops = rte_mempool_get_ops(ptr->ops_index);
printf(" - Name: %s on socket %d\n"
" - flags:\n"
diff --git a/dpdk/app/test-crypto-perf/cperf_options_parsing.c b/dpdk/app/test-crypto-perf/cperf_options_parsing.c
index 03ed6f5942..0466f7baf8 100644
--- a/dpdk/app/test-crypto-perf/cperf_options_parsing.c
+++ b/dpdk/app/test-crypto-perf/cperf_options_parsing.c
@@ -24,7 +24,7 @@ usage(char *progname)
{
printf("%s [EAL options] --\n"
" --silent: disable options dump\n"
- " --ptest throughput / latency / verify / pmd-cycleount :"
+ " --ptest throughput / latency / verify / pmd-cyclecount :"
" set test type\n"
" --pool_sz N: set the number of crypto ops/mbufs allocated\n"
" --total-ops N: set the number of total operations performed\n"
diff --git a/dpdk/app/test-crypto-perf/cperf_test_latency.c b/dpdk/app/test-crypto-perf/cperf_test_latency.c
index 0e4d0e1538..159fe8492b 100644
--- a/dpdk/app/test-crypto-perf/cperf_test_latency.c
+++ b/dpdk/app/test-crypto-perf/cperf_test_latency.c
@@ -310,11 +310,11 @@ cperf_latency_test_runner(void *arg)
if (ctx->options->csv) {
if (rte_atomic16_test_and_set(&display_once))
printf("\n# lcore, Buffer Size, Burst Size, Pakt Seq #, "
- "Packet Size, cycles, time (us)");
+ "cycles, time (us)");
for (i = 0; i < ctx->options->total_ops; i++) {
- printf("\n%u;%u;%u;%"PRIu64";%"PRIu64";%.3f",
+ printf("\n%u,%u,%u,%"PRIu64",%"PRIu64",%.3f",
ctx->lcore_id, ctx->options->test_buffer_size,
test_burst_size, i + 1,
ctx->res[i].tsc_end - ctx->res[i].tsc_start,
diff --git a/dpdk/app/test-crypto-perf/cperf_test_pmd_cyclecount.c b/dpdk/app/test-crypto-perf/cperf_test_pmd_cyclecount.c
index 4e67d3aebd..844659aeca 100644
--- a/dpdk/app/test-crypto-perf/cperf_test_pmd_cyclecount.c
+++ b/dpdk/app/test-crypto-perf/cperf_test_pmd_cyclecount.c
@@ -16,7 +16,7 @@
#define PRETTY_HDR_FMT "%12s%12s%12s%12s%12s%12s%12s%12s%12s%12s\n\n"
#define PRETTY_LINE_FMT "%12u%12u%12u%12u%12u%12u%12u%12.0f%12.0f%12.0f\n"
#define CSV_HDR_FMT "%s,%s,%s,%s,%s,%s,%s,%s,%s,%s\n"
-#define CSV_LINE_FMT "%10u;%10u;%u;%u;%u;%u;%u;%.3f;%.3f;%.3f\n"
+#define CSV_LINE_FMT "%10u,%10u,%u,%u,%u,%u,%u,%.3f,%.3f,%.3f\n"
struct cperf_pmd_cyclecount_ctx {
uint8_t dev_id;
diff --git a/dpdk/app/test-crypto-perf/cperf_test_throughput.c b/dpdk/app/test-crypto-perf/cperf_test_throughput.c
index f30f7d5c2c..f6eb8cf259 100644
--- a/dpdk/app/test-crypto-perf/cperf_test_throughput.c
+++ b/dpdk/app/test-crypto-perf/cperf_test_throughput.c
@@ -299,8 +299,8 @@ cperf_throughput_test_runner(void *test_ctx)
"Failed Deq,Ops(Millions),Throughput(Gbps),"
"Cycles/Buf\n\n");
- printf("%u;%u;%u;%"PRIu64";%"PRIu64";%"PRIu64";%"PRIu64";"
- "%.3f;%.3f;%.3f\n",
+ printf("%u,%u,%u,%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64","
+ "%.3f,%.3f,%.3f\n",
ctx->lcore_id,
ctx->options->test_buffer_size,
test_burst_size,
diff --git a/dpdk/app/test-crypto-perf/cperf_test_verify.c b/dpdk/app/test-crypto-perf/cperf_test_verify.c
index 833bc9a552..2939aeaa93 100644
--- a/dpdk/app/test-crypto-perf/cperf_test_verify.c
+++ b/dpdk/app/test-crypto-perf/cperf_test_verify.c
@@ -406,7 +406,7 @@ cperf_verify_test_runner(void *test_ctx)
"Burst Size,Enqueued,Dequeued,Failed Enq,"
"Failed Deq,Failed Ops\n");
- printf("%10u;%10u;%u;%"PRIu64";%"PRIu64";%"PRIu64";%"PRIu64";"
+ printf("%10u,%10u,%u,%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64","
"%"PRIu64"\n",
ctx->lcore_id,
ctx->options->max_buffer_size,
diff --git a/dpdk/app/test-crypto-perf/main.c b/dpdk/app/test-crypto-perf/main.c
index 5f035519c3..49af812d8b 100644
--- a/dpdk/app/test-crypto-perf/main.c
+++ b/dpdk/app/test-crypto-perf/main.c
@@ -390,7 +390,7 @@ cperf_check_test_vector(struct cperf_options *opts,
if (opts->cipher_algo == RTE_CRYPTO_CIPHER_NULL) {
if (test_vec->plaintext.data == NULL)
return -1;
- } else if (opts->cipher_algo != RTE_CRYPTO_CIPHER_NULL) {
+ } else {
if (test_vec->plaintext.data == NULL)
return -1;
if (test_vec->plaintext.length < opts->max_buffer_size)
@@ -440,7 +440,7 @@ cperf_check_test_vector(struct cperf_options *opts,
return -1;
if (test_vec->plaintext.length < opts->max_buffer_size)
return -1;
- } else if (opts->cipher_algo != RTE_CRYPTO_CIPHER_NULL) {
+ } else {
if (test_vec->plaintext.data == NULL)
return -1;
if (test_vec->plaintext.length < opts->max_buffer_size)
@@ -530,14 +530,14 @@ main(int argc, char **argv)
ret = cperf_options_parse(&opts, argc, argv);
if (ret) {
- RTE_LOG(ERR, USER1, "Parsing on or more user options failed\n");
+ RTE_LOG(ERR, USER1, "Parsing one or more user options failed\n");
goto err;
}
ret = cperf_options_check(&opts);
if (ret) {
RTE_LOG(ERR, USER1,
- "Checking on or more user options failed\n");
+ "Checking one or more user options failed\n");
goto err;
}
diff --git a/dpdk/app/test-eventdev/test_perf_common.h b/dpdk/app/test-eventdev/test_perf_common.h
index ff9705df88..e7233e5a5b 100644
--- a/dpdk/app/test-eventdev/test_perf_common.h
+++ b/dpdk/app/test-eventdev/test_perf_common.h
@@ -97,8 +97,13 @@ perf_process_last_stage(struct rte_mempool *const pool,
void *bufs[], int const buf_sz, uint8_t count)
{
bufs[count++] = ev->event_ptr;
- w->processed_pkts++;
+
+ /* wmb here ensures event_prt is stored before
+ * updating the number of processed packets
+ * for worker lcores
+ */
rte_smp_wmb();
+ w->processed_pkts++;
if (unlikely(count == buf_sz)) {
count = 0;
@@ -116,6 +121,12 @@ perf_process_last_stage_latency(struct rte_mempool *const pool,
struct perf_elt *const m = ev->event_ptr;
bufs[count++] = ev->event_ptr;
+
+ /* wmb here ensures event_prt is stored before
+ * updating the number of processed packets
+ * for worker lcores
+ */
+ rte_smp_wmb();
w->processed_pkts++;
if (unlikely(count == buf_sz)) {
@@ -127,7 +138,6 @@ perf_process_last_stage_latency(struct rte_mempool *const pool,
}
w->latency += latency;
- rte_smp_wmb();
return count;
}
diff --git a/dpdk/app/test-eventdev/test_pipeline_queue.c b/dpdk/app/test-eventdev/test_pipeline_queue.c
index 7bebac34fc..9a9febb199 100644
--- a/dpdk/app/test-eventdev/test_pipeline_queue.c
+++ b/dpdk/app/test-eventdev/test_pipeline_queue.c
@@ -83,16 +83,15 @@ pipeline_queue_worker_single_stage_burst_tx(void *arg)
rte_prefetch0(ev[i + 1].mbuf);
if (ev[i].sched_type == RTE_SCHED_TYPE_ATOMIC) {
pipeline_event_tx(dev, port, &ev[i]);
- ev[i].op = RTE_EVENT_OP_RELEASE;
w->processed_pkts++;
} else {
ev[i].queue_id++;
pipeline_fwd_event(&ev[i],
RTE_SCHED_TYPE_ATOMIC);
+ pipeline_event_enqueue_burst(dev, port, ev,
+ nb_rx);
}
}
-
- pipeline_event_enqueue_burst(dev, port, ev, nb_rx);
}
return 0;
@@ -180,13 +179,13 @@ pipeline_queue_worker_multi_stage_fwd(void *arg)
ev.queue_id = tx_queue[ev.mbuf->port];
rte_event_eth_tx_adapter_txq_set(ev.mbuf, 0);
pipeline_fwd_event(&ev, RTE_SCHED_TYPE_ATOMIC);
+ pipeline_event_enqueue(dev, port, &ev);
w->processed_pkts++;
} else {
ev.queue_id++;
pipeline_fwd_event(&ev, sched_type_list[cq_id]);
+ pipeline_event_enqueue(dev, port, &ev);
}
-
- pipeline_event_enqueue(dev, port, &ev);
}
return 0;
@@ -213,7 +212,6 @@ pipeline_queue_worker_multi_stage_burst_tx(void *arg)
if (ev[i].queue_id == tx_queue[ev[i].mbuf->port]) {
pipeline_event_tx(dev, port, &ev[i]);
- ev[i].op = RTE_EVENT_OP_RELEASE;
w->processed_pkts++;
continue;
}
@@ -222,9 +220,8 @@ pipeline_queue_worker_multi_stage_burst_tx(void *arg)
pipeline_fwd_event(&ev[i], cq_id != last_queue ?
sched_type_list[cq_id] :
RTE_SCHED_TYPE_ATOMIC);
+ pipeline_event_enqueue_burst(dev, port, ev, nb_rx);
}
-
- pipeline_event_enqueue_burst(dev, port, ev, nb_rx);
}
return 0;
@@ -237,6 +234,7 @@ pipeline_queue_worker_multi_stage_burst_fwd(void *arg)
const uint8_t *tx_queue = t->tx_evqueue_id;
while (t->done == false) {
+ uint16_t processed_pkts = 0;
uint16_t nb_rx = rte_event_dequeue_burst(dev, port, ev,
BURST_SIZE, 0);
@@ -254,7 +252,7 @@ pipeline_queue_worker_multi_stage_burst_fwd(void *arg)
rte_event_eth_tx_adapter_txq_set(ev[i].mbuf, 0);
pipeline_fwd_event(&ev[i],
RTE_SCHED_TYPE_ATOMIC);
- w->processed_pkts++;
+ processed_pkts++;
} else {
ev[i].queue_id++;
pipeline_fwd_event(&ev[i],
@@ -263,6 +261,7 @@ pipeline_queue_worker_multi_stage_burst_fwd(void *arg)
}
pipeline_event_enqueue_burst(dev, port, ev, nb_rx);
+ w->processed_pkts += processed_pkts;
}
return 0;
diff --git a/dpdk/app/test-flow-perf/actions_gen.c b/dpdk/app/test-flow-perf/actions_gen.c
index ac525f6fdb..f265894247 100644
--- a/dpdk/app/test-flow-perf/actions_gen.c
+++ b/dpdk/app/test-flow-perf/actions_gen.c
@@ -145,12 +145,10 @@ add_set_meta(struct rte_flow_action *actions,
uint8_t actions_counter,
__rte_unused struct additional_para para)
{
- static struct rte_flow_action_set_meta meta_action;
-
- do {
- meta_action.data = RTE_BE32(META_DATA);
- meta_action.mask = RTE_BE32(0xffffffff);
- } while (0);
+ static struct rte_flow_action_set_meta meta_action = {
+ .data = RTE_BE32(META_DATA),
+ .mask = RTE_BE32(0xffffffff),
+ };
actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_SET_META;
actions[actions_counter].conf = &meta_action;
@@ -161,13 +159,11 @@ add_set_tag(struct rte_flow_action *actions,
uint8_t actions_counter,
__rte_unused struct additional_para para)
{
- static struct rte_flow_action_set_tag tag_action;
-
- do {
- tag_action.data = RTE_BE32(META_DATA);
- tag_action.mask = RTE_BE32(0xffffffff);
- tag_action.index = TAG_INDEX;
- } while (0);
+ static struct rte_flow_action_set_tag tag_action = {
+ .data = RTE_BE32(META_DATA),
+ .mask = RTE_BE32(0xffffffff),
+ .index = TAG_INDEX,
+ };
actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_SET_TAG;
actions[actions_counter].conf = &tag_action;
@@ -178,11 +174,9 @@ add_port_id(struct rte_flow_action *actions,
uint8_t actions_counter,
__rte_unused struct additional_para para)
{
- static struct rte_flow_action_port_id port_id;
-
- do {
- port_id.id = PORT_ID_DST;
- } while (0);
+ static struct rte_flow_action_port_id port_id = {
+ .id = PORT_ID_DST,
+ };
actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_PORT_ID;
actions[actions_counter].conf = &port_id;
diff --git a/dpdk/app/test-flow-perf/items_gen.c b/dpdk/app/test-flow-perf/items_gen.c
index 2b1ab41467..aaa243a7c4 100644
--- a/dpdk/app/test-flow-perf/items_gen.c
+++ b/dpdk/app/test-flow-perf/items_gen.c
@@ -25,9 +25,6 @@ add_ether(struct rte_flow_item *items,
static struct rte_flow_item_eth eth_spec;
static struct rte_flow_item_eth eth_mask;
- memset(ð_spec, 0, sizeof(struct rte_flow_item_eth));
- memset(ð_mask, 0, sizeof(struct rte_flow_item_eth));
-
items[items_counter].type = RTE_FLOW_ITEM_TYPE_ETH;
items[items_counter].spec = ð_spec;
items[items_counter].mask = ð_mask;
@@ -38,16 +35,12 @@ add_vlan(struct rte_flow_item *items,
uint8_t items_counter,
__rte_unused struct additional_para para)
{
- static struct rte_flow_item_vlan vlan_spec;
- static struct rte_flow_item_vlan vlan_mask;
-
- uint16_t vlan_value = VLAN_VALUE;
-
- memset(&vlan_spec, 0, sizeof(struct rte_flow_item_vlan));
- memset(&vlan_mask, 0, sizeof(struct rte_flow_item_vlan));
-
- vlan_spec.tci = RTE_BE16(vlan_value);
- vlan_mask.tci = RTE_BE16(0xffff);
+ static struct rte_flow_item_vlan vlan_spec = {
+ .tci = RTE_BE16(VLAN_VALUE),
+ };
+ static struct rte_flow_item_vlan vlan_mask = {
+ .tci = RTE_BE16(0xffff),
+ };
items[items_counter].type = RTE_FLOW_ITEM_TYPE_VLAN;
items[items_counter].spec = &vlan_spec;
@@ -61,9 +54,6 @@ add_ipv4(struct rte_flow_item *items,
static struct rte_flow_item_ipv4 ipv4_spec;
static struct rte_flow_item_ipv4 ipv4_mask;
- memset(&ipv4_spec, 0, sizeof(struct rte_flow_item_ipv4));
- memset(&ipv4_mask, 0, sizeof(struct rte_flow_item_ipv4));
-
ipv4_spec.hdr.src_addr = RTE_BE32(para.src_ip);
ipv4_mask.hdr.src_addr = RTE_BE32(0xffffffff);
@@ -80,9 +70,6 @@ add_ipv6(struct rte_flow_item *items,
static struct rte_flow_item_ipv6 ipv6_spec;
static struct rte_flow_item_ipv6 ipv6_mask;
- memset(&ipv6_spec, 0, sizeof(struct rte_flow_item_ipv6));
- memset(&ipv6_mask, 0, sizeof(struct rte_flow_item_ipv6));
-
/** Set ipv6 src **/
memset(&ipv6_spec.hdr.src_addr, para.src_ip,
sizeof(ipv6_spec.hdr.src_addr) / 2);
@@ -104,9 +91,6 @@ add_tcp(struct rte_flow_item *items,
static struct rte_flow_item_tcp tcp_spec;
static struct rte_flow_item_tcp tcp_mask;
- memset(&tcp_spec, 0, sizeof(struct rte_flow_item_tcp));
- memset(&tcp_mask, 0, sizeof(struct rte_flow_item_tcp));
-
items[items_counter].type = RTE_FLOW_ITEM_TYPE_TCP;
items[items_counter].spec = &tcp_spec;
items[items_counter].mask = &tcp_mask;
@@ -120,9 +104,6 @@ add_udp(struct rte_flow_item *items,
static struct rte_flow_item_udp udp_spec;
static struct rte_flow_item_udp udp_mask;
- memset(&udp_spec, 0, sizeof(struct rte_flow_item_udp));
- memset(&udp_mask, 0, sizeof(struct rte_flow_item_udp));
-
items[items_counter].type = RTE_FLOW_ITEM_TYPE_UDP;
items[items_counter].spec = &udp_spec;
items[items_counter].mask = &udp_mask;
@@ -141,9 +122,6 @@ add_vxlan(struct rte_flow_item *items,
vni_value = VNI_VALUE;
- memset(&vxlan_spec, 0, sizeof(struct rte_flow_item_vxlan));
- memset(&vxlan_mask, 0, sizeof(struct rte_flow_item_vxlan));
-
/* Set standard vxlan vni */
for (i = 0; i < 3; i++) {
vxlan_spec.vni[2 - i] = vni_value >> (i * 8);
@@ -171,9 +149,6 @@ add_vxlan_gpe(struct rte_flow_item *items,
vni_value = VNI_VALUE;
- memset(&vxlan_gpe_spec, 0, sizeof(struct rte_flow_item_vxlan_gpe));
- memset(&vxlan_gpe_mask, 0, sizeof(struct rte_flow_item_vxlan_gpe));
-
/* Set vxlan-gpe vni */
for (i = 0; i < 3; i++) {
vxlan_gpe_spec.vni[2 - i] = vni_value >> (i * 8);
@@ -193,18 +168,12 @@ add_gre(struct rte_flow_item *items,
uint8_t items_counter,
__rte_unused struct additional_para para)
{
- static struct rte_flow_item_gre gre_spec;
- static struct rte_flow_item_gre gre_mask;
-
- uint16_t proto;
-
- proto = RTE_ETHER_TYPE_TEB;
-
- memset(&gre_spec, 0, sizeof(struct rte_flow_item_gre));
- memset(&gre_mask, 0, sizeof(struct rte_flow_item_gre));
-
- gre_spec.protocol = RTE_BE16(proto);
- gre_mask.protocol = RTE_BE16(0xffff);
+ static struct rte_flow_item_gre gre_spec = {
+ .protocol = RTE_BE16(RTE_ETHER_TYPE_TEB),
+ };
+ static struct rte_flow_item_gre gre_mask = {
+ .protocol = RTE_BE16(0xffff),
+ };
items[items_counter].type = RTE_FLOW_ITEM_TYPE_GRE;
items[items_counter].spec = &gre_spec;
@@ -224,9 +193,6 @@ add_geneve(struct rte_flow_item *items,
vni_value = VNI_VALUE;
- memset(&geneve_spec, 0, sizeof(struct rte_flow_item_geneve));
- memset(&geneve_mask, 0, sizeof(struct rte_flow_item_geneve));
-
for (i = 0; i < 3; i++) {
geneve_spec.vni[2 - i] = vni_value >> (i * 8);
geneve_mask.vni[2 - i] = 0xff;
@@ -242,18 +208,12 @@ add_gtp(struct rte_flow_item *items,
uint8_t items_counter,
__rte_unused struct additional_para para)
{
- static struct rte_flow_item_gtp gtp_spec;
- static struct rte_flow_item_gtp gtp_mask;
-
- uint32_t teid_value;
-
- teid_value = TEID_VALUE;
-
- memset(>p_spec, 0, sizeof(struct rte_flow_item_gtp));
- memset(>p_mask, 0, sizeof(struct rte_flow_item_gtp));
-
- gtp_spec.teid = RTE_BE32(teid_value);
- gtp_mask.teid = RTE_BE32(0xffffffff);
+ static struct rte_flow_item_gtp gtp_spec = {
+ .teid = RTE_BE32(TEID_VALUE),
+ };
+ static struct rte_flow_item_gtp gtp_mask = {
+ .teid = RTE_BE32(0xffffffff),
+ };
items[items_counter].type = RTE_FLOW_ITEM_TYPE_GTP;
items[items_counter].spec = >p_spec;
@@ -265,18 +225,12 @@ add_meta_data(struct rte_flow_item *items,
uint8_t items_counter,
__rte_unused struct additional_para para)
{
- static struct rte_flow_item_meta meta_spec;
- static struct rte_flow_item_meta meta_mask;
-
- uint32_t data;
-
- data = META_DATA;
-
- memset(&meta_spec, 0, sizeof(struct rte_flow_item_meta));
- memset(&meta_mask, 0, sizeof(struct rte_flow_item_meta));
-
- meta_spec.data = RTE_BE32(data);
- meta_mask.data = RTE_BE32(0xffffffff);
+ static struct rte_flow_item_meta meta_spec = {
+ .data = RTE_BE32(META_DATA),
+ };
+ static struct rte_flow_item_meta meta_mask = {
+ .data = RTE_BE32(0xffffffff),
+ };
items[items_counter].type = RTE_FLOW_ITEM_TYPE_META;
items[items_counter].spec = &meta_spec;
@@ -289,21 +243,14 @@ add_meta_tag(struct rte_flow_item *items,
uint8_t items_counter,
__rte_unused struct additional_para para)
{
- static struct rte_flow_item_tag tag_spec;
- static struct rte_flow_item_tag tag_mask;
- uint32_t data;
- uint8_t index;
-
- data = META_DATA;
- index = TAG_INDEX;
-
- memset(&tag_spec, 0, sizeof(struct rte_flow_item_tag));
- memset(&tag_mask, 0, sizeof(struct rte_flow_item_tag));
-
- tag_spec.data = RTE_BE32(data);
- tag_mask.data = RTE_BE32(0xffffffff);
- tag_spec.index = index;
- tag_mask.index = 0xff;
+ static struct rte_flow_item_tag tag_spec = {
+ .data = RTE_BE32(META_DATA),
+ .index = TAG_INDEX,
+ };
+ static struct rte_flow_item_tag tag_mask = {
+ .data = RTE_BE32(0xffffffff),
+ .index = 0xff,
+ };
items[items_counter].type = RTE_FLOW_ITEM_TYPE_TAG;
items[items_counter].spec = &tag_spec;
@@ -318,9 +265,6 @@ add_icmpv4(struct rte_flow_item *items,
static struct rte_flow_item_icmp icmpv4_spec;
static struct rte_flow_item_icmp icmpv4_mask;
- memset(&icmpv4_spec, 0, sizeof(struct rte_flow_item_icmp));
- memset(&icmpv4_mask, 0, sizeof(struct rte_flow_item_icmp));
-
items[items_counter].type = RTE_FLOW_ITEM_TYPE_ICMP;
items[items_counter].spec = &icmpv4_spec;
items[items_counter].mask = &icmpv4_mask;
@@ -334,9 +278,6 @@ add_icmpv6(struct rte_flow_item *items,
static struct rte_flow_item_icmp6 icmpv6_spec;
static struct rte_flow_item_icmp6 icmpv6_mask;
- memset(&icmpv6_spec, 0, sizeof(struct rte_flow_item_icmp6));
- memset(&icmpv6_mask, 0, sizeof(struct rte_flow_item_icmp6));
-
items[items_counter].type = RTE_FLOW_ITEM_TYPE_ICMP6;
items[items_counter].spec = &icmpv6_spec;
items[items_counter].mask = &icmpv6_mask;
diff --git a/dpdk/app/test-pmd/cmdline.c b/dpdk/app/test-pmd/cmdline.c
index 0d2d6aad05..2b9dd3e1f4 100644
--- a/dpdk/app/test-pmd/cmdline.c
+++ b/dpdk/app/test-pmd/cmdline.c
@@ -163,7 +163,7 @@ static void cmd_help_long_parsed(void *parsed_result,
"Display:\n"
"--------\n\n"
- "show port (info|stats|summary|xstats|fdir|stat_qmap|dcb_tc|cap) (port_id|all)\n"
+ "show port (info|stats|summary|xstats|fdir|dcb_tc|cap) (port_id|all)\n"
" Display information for port_id, or all.\n\n"
"show port port_id (module_eeprom|eeprom)\n"
@@ -177,7 +177,7 @@ static void cmd_help_long_parsed(void *parsed_result,
"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|stat_qmap) (port_id|all)\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"
@@ -1877,7 +1877,9 @@ cmd_config_max_pkt_len_parsed(void *parsed_result,
__rte_unused void *data)
{
struct cmd_config_max_pkt_len_result *res = parsed_result;
+ uint32_t max_rx_pkt_len_backup = 0;
portid_t pid;
+ int ret;
if (!all_ports_stopped()) {
printf("Please stop all ports first\n");
@@ -1886,7 +1888,6 @@ cmd_config_max_pkt_len_parsed(void *parsed_result,
RTE_ETH_FOREACH_DEV(pid) {
struct rte_port *port = &ports[pid];
- uint64_t rx_offloads = port->dev_conf.rxmode.offloads;
if (!strcmp(res->name, "max-pkt-len")) {
if (res->value < RTE_ETHER_MIN_LEN) {
@@ -1897,12 +1898,18 @@ cmd_config_max_pkt_len_parsed(void *parsed_result,
if (res->value == port->dev_conf.rxmode.max_rx_pkt_len)
return;
+ ret = eth_dev_info_get_print_err(pid, &port->dev_info);
+ if (ret != 0) {
+ printf("rte_eth_dev_info_get() failed for port %u\n",
+ pid);
+ return;
+ }
+
+ max_rx_pkt_len_backup = port->dev_conf.rxmode.max_rx_pkt_len;
+
port->dev_conf.rxmode.max_rx_pkt_len = res->value;
- if (res->value > RTE_ETHER_MAX_LEN)
- rx_offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME;
- else
- rx_offloads &= ~DEV_RX_OFFLOAD_JUMBO_FRAME;
- port->dev_conf.rxmode.offloads = rx_offloads;
+ if (update_jumbo_frame_offload(pid) != 0)
+ port->dev_conf.rxmode.max_rx_pkt_len = max_rx_pkt_len_backup;
} else {
printf("Unknown parameter\n");
return;
@@ -3782,6 +3789,7 @@ cmd_set_rxoffs_parsed(void *parsed_result,
MAX_SEGS_BUFFER_SPLIT, seg_offsets, 0);
if (nb_segs > 0)
set_rx_pkt_offsets(seg_offsets, nb_segs);
+ cmd_reconfig_device_queue(RTE_PORT_ALL, 0, 1);
}
cmdline_parse_token_string_t cmd_set_rxoffs_keyword =
@@ -3828,6 +3836,7 @@ cmd_set_rxpkts_parsed(void *parsed_result,
MAX_SEGS_BUFFER_SPLIT, seg_lengths, 0);
if (nb_segs > 0)
set_rx_pkt_segments(seg_lengths, nb_segs);
+ cmd_reconfig_device_queue(RTE_PORT_ALL, 0, 1);
}
cmdline_parse_token_string_t cmd_set_rxpkts_keyword =
@@ -7555,9 +7564,6 @@ static void cmd_showportall_parsed(void *parsed_result,
RTE_ETH_FOREACH_DEV(i)
fdir_get_infos(i);
#endif
- else if (!strcmp(res->what, "stat_qmap"))
- RTE_ETH_FOREACH_DEV(i)
- nic_stats_mapping_display(i);
else if (!strcmp(res->what, "dcb_tc"))
RTE_ETH_FOREACH_DEV(i)
port_dcb_info_display(i);
@@ -7573,14 +7579,14 @@ cmdline_parse_token_string_t cmd_showportall_port =
TOKEN_STRING_INITIALIZER(struct cmd_showportall_result, port, "port");
cmdline_parse_token_string_t cmd_showportall_what =
TOKEN_STRING_INITIALIZER(struct cmd_showportall_result, what,
- "info#summary#stats#xstats#fdir#stat_qmap#dcb_tc#cap");
+ "info#summary#stats#xstats#fdir#dcb_tc#cap");
cmdline_parse_token_string_t cmd_showportall_all =
TOKEN_STRING_INITIALIZER(struct cmd_showportall_result, all, "all");
cmdline_parse_inst_t cmd_showportall = {
.f = cmd_showportall_parsed,
.data = NULL,
.help_str = "show|clear port "
- "info|summary|stats|xstats|fdir|stat_qmap|dcb_tc|cap all",
+ "info|summary|stats|xstats|fdir|dcb_tc|cap all",
.tokens = {
(void *)&cmd_showportall_show,
(void *)&cmd_showportall_port,
@@ -7622,8 +7628,6 @@ static void cmd_showport_parsed(void *parsed_result,
else if (!strcmp(res->what, "fdir"))
fdir_get_infos(res->portnum);
#endif
- else if (!strcmp(res->what, "stat_qmap"))
- nic_stats_mapping_display(res->portnum);
else if (!strcmp(res->what, "dcb_tc"))
port_dcb_info_display(res->portnum);
else if (!strcmp(res->what, "cap"))
@@ -7637,7 +7641,7 @@ cmdline_parse_token_string_t cmd_showport_port =
TOKEN_STRING_INITIALIZER(struct cmd_showport_result, port, "port");
cmdline_parse_token_string_t cmd_showport_what =
TOKEN_STRING_INITIALIZER(struct cmd_showport_result, what,
- "info#summary#stats#xstats#fdir#stat_qmap#dcb_tc#cap");
+ "info#summary#stats#xstats#fdir#dcb_tc#cap");
cmdline_parse_token_num_t cmd_showport_portnum =
TOKEN_NUM_INITIALIZER(struct cmd_showport_result, portnum, RTE_UINT16);
@@ -7645,7 +7649,7 @@ cmdline_parse_inst_t cmd_showport = {
.f = cmd_showport_parsed,
.data = NULL,
.help_str = "show|clear port "
- "info|summary|stats|xstats|fdir|stat_qmap|dcb_tc|cap "
+ "info|summary|stats|xstats|fdir|dcb_tc|cap "
"<port_id>",
.tokens = {
(void *)&cmd_showport_show,
@@ -17112,6 +17116,7 @@ cmdline_read_from_file(const char *filename)
void
prompt(void)
{
+ int ret;
/* initialize non-constant commands */
cmd_set_fwd_mode_init();
cmd_set_fwd_retry_mode_init();
@@ -17119,15 +17124,23 @@ prompt(void)
testpmd_cl = cmdline_stdin_new(main_ctx, "testpmd> ");
if (testpmd_cl == NULL)
return;
+
+ ret = atexit(prompt_exit);
+ if (ret != 0)
+ printf("Cannot set exit function for cmdline\n");
+
cmdline_interact(testpmd_cl);
- cmdline_stdin_exit(testpmd_cl);
+ if (ret != 0)
+ cmdline_stdin_exit(testpmd_cl);
}
void
prompt_exit(void)
{
- if (testpmd_cl != NULL)
+ if (testpmd_cl != NULL) {
cmdline_quit(testpmd_cl);
+ cmdline_stdin_exit(testpmd_cl);
+ }
}
static void
diff --git a/dpdk/app/test-pmd/cmdline_flow.c b/dpdk/app/test-pmd/cmdline_flow.c
index 585cab98b4..de80924e7c 100644
--- a/dpdk/app/test-pmd/cmdline_flow.c
+++ b/dpdk/app/test-pmd/cmdline_flow.c
@@ -3403,7 +3403,10 @@ static const struct token token_list[] = {
.name = "key",
.help = "RSS hash key",
.next = NEXT(action_rss, NEXT_ENTRY(HEX)),
- .args = ARGS(ARGS_ENTRY_ARB(0, 0),
+ .args = ARGS(ARGS_ENTRY_ARB
+ (offsetof(struct action_rss_data, conf) +
+ offsetof(struct rte_flow_action_rss, key),
+ sizeof(((struct rte_flow_action_rss *)0)->key)),
ARGS_ENTRY_ARB
(offsetof(struct action_rss_data, conf) +
offsetof(struct rte_flow_action_rss, key_len),
diff --git a/dpdk/app/test-pmd/cmdline_mtr.c b/dpdk/app/test-pmd/cmdline_mtr.c
index 399ee56e07..3982787d20 100644
--- a/dpdk/app/test-pmd/cmdline_mtr.c
+++ b/dpdk/app/test-pmd/cmdline_mtr.c
@@ -312,7 +312,7 @@ static void cmd_show_port_meter_cap_parsed(void *parsed_result,
cmdline_parse_inst_t cmd_show_port_meter_cap = {
.f = cmd_show_port_meter_cap_parsed,
.data = NULL,
- .help_str = "Show port meter cap",
+ .help_str = "show port meter cap <port_id>",
.tokens = {
(void *)&cmd_show_port_meter_cap_show,
(void *)&cmd_show_port_meter_cap_port,
@@ -408,7 +408,7 @@ static void cmd_add_port_meter_profile_srtcm_parsed(void *parsed_result,
cmdline_parse_inst_t cmd_add_port_meter_profile_srtcm = {
.f = cmd_add_port_meter_profile_srtcm_parsed,
.data = NULL,
- .help_str = "Add port meter profile srtcm (rfc2697)",
+ .help_str = "add port meter profile srtcm_rfc2697 <port_id> <profile_id> <cir> <cbs> <ebs>",
.tokens = {
(void *)&cmd_add_port_meter_profile_srtcm_add,
(void *)&cmd_add_port_meter_profile_srtcm_port,
@@ -515,7 +515,7 @@ static void cmd_add_port_meter_profile_trtcm_parsed(void *parsed_result,
cmdline_parse_inst_t cmd_add_port_meter_profile_trtcm = {
.f = cmd_add_port_meter_profile_trtcm_parsed,
.data = NULL,
- .help_str = "Add port meter profile trtcm (rfc2698)",
+ .help_str = "add port meter profile trtcm_rfc2698 <port_id> <profile_id> <cir> <pir> <cbs> <pbs>",
.tokens = {
(void *)&cmd_add_port_meter_profile_trtcm_add,
(void *)&cmd_add_port_meter_profile_trtcm_port,
@@ -627,7 +627,7 @@ static void cmd_add_port_meter_profile_trtcm_rfc4115_parsed(
cmdline_parse_inst_t cmd_add_port_meter_profile_trtcm_rfc4115 = {
.f = cmd_add_port_meter_profile_trtcm_rfc4115_parsed,
.data = NULL,
- .help_str = "Add port meter profile trtcm (rfc4115)",
+ .help_str = "add port meter profile trtcm_rfc4115 <port_id> <profile_id> <cir> <eir> <cbs> <ebs>",
.tokens = {
(void *)&cmd_add_port_meter_profile_trtcm_rfc4115_add,
(void *)&cmd_add_port_meter_profile_trtcm_rfc4115_port,
@@ -702,7 +702,7 @@ static void cmd_del_port_meter_profile_parsed(void *parsed_result,
cmdline_parse_inst_t cmd_del_port_meter_profile = {
.f = cmd_del_port_meter_profile_parsed,
.data = NULL,
- .help_str = "Delete port meter profile",
+ .help_str = "del port meter profile <port_id> <profile_id>",
.tokens = {
(void *)&cmd_del_port_meter_profile_del,
(void *)&cmd_del_port_meter_profile_port,
@@ -827,7 +827,10 @@ static void cmd_create_port_meter_parsed(void *parsed_result,
cmdline_parse_inst_t cmd_create_port_meter = {
.f = cmd_create_port_meter_parsed,
.data = NULL,
- .help_str = "Create port meter",
+ .help_str = "create port meter <port_id> <mtr_id> <profile_id> <meter_enable>(yes|no) "
+ "<g_action>(R|Y|G|D) <y_action>(R|Y|G|D) <r_action>(R|Y|G|D) "
+ "<stats_mask> <shared> <use_pre_meter_color> "
+ "[<dscp_tbl_entry0> <dscp_tbl_entry1> ...<dscp_tbl_entry63>]",
.tokens = {
(void *)&cmd_create_port_meter_create,
(void *)&cmd_create_port_meter_port,
@@ -896,7 +899,7 @@ static void cmd_enable_port_meter_parsed(void *parsed_result,
cmdline_parse_inst_t cmd_enable_port_meter = {
.f = cmd_enable_port_meter_parsed,
.data = NULL,
- .help_str = "Enable port meter",
+ .help_str = "enable port meter <port_id> <mtr_id>",
.tokens = {
(void *)&cmd_enable_port_meter_enable,
(void *)&cmd_enable_port_meter_port,
@@ -957,7 +960,7 @@ static void cmd_disable_port_meter_parsed(void *parsed_result,
cmdline_parse_inst_t cmd_disable_port_meter = {
.f = cmd_disable_port_meter_parsed,
.data = NULL,
- .help_str = "Disable port meter",
+ .help_str = "disable port meter <port_id> <mtr_id>",
.tokens = {
(void *)&cmd_disable_port_meter_disable,
(void *)&cmd_disable_port_meter_port,
@@ -1018,7 +1021,7 @@ static void cmd_del_port_meter_parsed(void *parsed_result,
cmdline_parse_inst_t cmd_del_port_meter = {
.f = cmd_del_port_meter_parsed,
.data = NULL,
- .help_str = "Delete port meter",
+ .help_str = "del port meter <port_id> <mtr_id>",
.tokens = {
(void *)&cmd_del_port_meter_del,
(void *)&cmd_del_port_meter_port,
@@ -1092,7 +1095,7 @@ static void cmd_set_port_meter_profile_parsed(void *parsed_result,
cmdline_parse_inst_t cmd_set_port_meter_profile = {
.f = cmd_set_port_meter_profile_parsed,
.data = NULL,
- .help_str = "Set port meter profile",
+ .help_str = "set port meter profile <port_id> <mtr_id> <profile_id>",
.tokens = {
(void *)&cmd_set_port_meter_profile_set,
(void *)&cmd_set_port_meter_profile_port,
@@ -1166,7 +1169,8 @@ static void cmd_set_port_meter_dscp_table_parsed(void *parsed_result,
cmdline_parse_inst_t cmd_set_port_meter_dscp_table = {
.f = cmd_set_port_meter_dscp_table_parsed,
.data = NULL,
- .help_str = "Update port meter dscp table",
+ .help_str = "set port meter dscp table <port_id> <mtr_id> "
+ "[<dscp_tbl_entry0> <dscp_tbl_entry1> ... <dscp_tbl_entry63>]",
.tokens = {
(void *)&cmd_set_port_meter_dscp_table_set,
(void *)&cmd_set_port_meter_dscp_table_port,
@@ -1276,7 +1280,8 @@ static void cmd_set_port_meter_policer_action_parsed(void *parsed_result,
cmdline_parse_inst_t cmd_set_port_meter_policer_action = {
.f = cmd_set_port_meter_policer_action_parsed,
.data = NULL,
- .help_str = "Set port meter policer action",
+ .help_str = "set port meter policer action <port_id> <mtr_id> "
+ "<action_mask> <action0> [<action1> <action2>]",
.tokens = {
(void *)&cmd_set_port_meter_policer_action_set,
(void *)&cmd_set_port_meter_policer_action_port,
@@ -1355,7 +1360,7 @@ static void cmd_set_port_meter_stats_mask_parsed(void *parsed_result,
cmdline_parse_inst_t cmd_set_port_meter_stats_mask = {
.f = cmd_set_port_meter_stats_mask_parsed,
.data = NULL,
- .help_str = "Set port meter stats mask",
+ .help_str = "set port meter stats mask <port_id> <mtr_id> <stats_mask>",
.tokens = {
(void *)&cmd_set_port_meter_stats_mask_set,
(void *)&cmd_set_port_meter_stats_mask_port,
@@ -1459,7 +1464,7 @@ static void cmd_show_port_meter_stats_parsed(void *parsed_result,
cmdline_parse_inst_t cmd_show_port_meter_stats = {
.f = cmd_show_port_meter_stats_parsed,
.data = NULL,
- .help_str = "Show port meter stats",
+ .help_str = "show port meter stats <port_id> <mtr_id> <clear>(yes|no)",
.tokens = {
(void *)&cmd_show_port_meter_stats_show,
(void *)&cmd_show_port_meter_stats_port,
diff --git a/dpdk/app/test-pmd/config.c b/dpdk/app/test-pmd/config.c
index b51de59e1e..dab8afe5dd 100644
--- a/dpdk/app/test-pmd/config.c
+++ b/dpdk/app/test-pmd/config.c
@@ -183,8 +183,6 @@ nic_stats_display(portid_t port_id)
diff_ns;
uint64_t mpps_rx, mpps_tx, mbps_rx, mbps_tx;
struct rte_eth_stats stats;
- struct rte_port *port = &ports[port_id];
- uint8_t i;
static const char *nic_stats_border = "########################";
@@ -196,46 +194,12 @@ nic_stats_display(portid_t port_id)
printf("\n %s NIC statistics for port %-2d %s\n",
nic_stats_border, port_id, nic_stats_border);
- if ((!port->rx_queue_stats_mapping_enabled) && (!port->tx_queue_stats_mapping_enabled)) {
- printf(" RX-packets: %-10"PRIu64" RX-missed: %-10"PRIu64" RX-bytes: "
- "%-"PRIu64"\n",
- stats.ipackets, stats.imissed, stats.ibytes);
- printf(" RX-errors: %-"PRIu64"\n", stats.ierrors);
- printf(" RX-nombuf: %-10"PRIu64"\n",
- stats.rx_nombuf);
- printf(" TX-packets: %-10"PRIu64" TX-errors: %-10"PRIu64" TX-bytes: "
- "%-"PRIu64"\n",
- stats.opackets, stats.oerrors, stats.obytes);
- }
- else {
- printf(" RX-packets: %10"PRIu64" RX-errors: %10"PRIu64
- " RX-bytes: %10"PRIu64"\n",
- stats.ipackets, stats.ierrors, stats.ibytes);
- printf(" RX-errors: %10"PRIu64"\n", stats.ierrors);
- printf(" RX-nombuf: %10"PRIu64"\n",
- stats.rx_nombuf);
- printf(" TX-packets: %10"PRIu64" TX-errors: %10"PRIu64
- " TX-bytes: %10"PRIu64"\n",
- stats.opackets, stats.oerrors, stats.obytes);
- }
-
- if (port->rx_queue_stats_mapping_enabled) {
- printf("\n");
- for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS; i++) {
- printf(" Stats reg %2d RX-packets: %10"PRIu64
- " RX-errors: %10"PRIu64
- " RX-bytes: %10"PRIu64"\n",
- i, stats.q_ipackets[i], stats.q_errors[i], stats.q_ibytes[i]);
- }
- }
- if (port->tx_queue_stats_mapping_enabled) {
- printf("\n");
- for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS; i++) {
- printf(" Stats reg %2d TX-packets: %10"PRIu64
- " TX-bytes: %10"PRIu64"\n",
- i, stats.q_opackets[i], stats.q_obytes[i]);
- }
- }
+ printf(" RX-packets: %-10"PRIu64" RX-missed: %-10"PRIu64" RX-bytes: "
+ "%-"PRIu64"\n", stats.ipackets, stats.imissed, stats.ibytes);
+ printf(" RX-errors: %-"PRIu64"\n", stats.ierrors);
+ printf(" RX-nombuf: %-10"PRIu64"\n", stats.rx_nombuf);
+ printf(" TX-packets: %-10"PRIu64" TX-errors: %-10"PRIu64" TX-bytes: "
+ "%-"PRIu64"\n", stats.opackets, stats.oerrors, stats.obytes);
diff_ns = 0;
if (clock_gettime(CLOCK_TYPE_ID, &cur_time) == 0) {
@@ -398,54 +362,6 @@ nic_xstats_clear(portid_t port_id)
}
}
-void
-nic_stats_mapping_display(portid_t port_id)
-{
- struct rte_port *port = &ports[port_id];
- uint16_t i;
-
- static const char *nic_stats_mapping_border = "########################";
-
- if (port_id_is_invalid(port_id, ENABLED_WARN)) {
- print_valid_ports();
- return;
- }
-
- if ((!port->rx_queue_stats_mapping_enabled) && (!port->tx_queue_stats_mapping_enabled)) {
- printf("Port id %d - either does not support queue statistic mapping or"
- " no queue statistic mapping set\n", port_id);
- return;
- }
-
- printf("\n %s NIC statistics mapping for port %-2d %s\n",
- nic_stats_mapping_border, port_id, nic_stats_mapping_border);
-
- if (port->rx_queue_stats_mapping_enabled) {
- for (i = 0; i < nb_rx_queue_stats_mappings; i++) {
- if (rx_queue_stats_mappings[i].port_id == port_id) {
- printf(" RX-queue %2d mapped to Stats Reg %2d\n",
- rx_queue_stats_mappings[i].queue_id,
- rx_queue_stats_mappings[i].stats_counter_id);
- }
- }
- printf("\n");
- }
-
-
- if (port->tx_queue_stats_mapping_enabled) {
- for (i = 0; i < nb_tx_queue_stats_mappings; i++) {
- if (tx_queue_stats_mappings[i].port_id == port_id) {
- printf(" TX-queue %2d mapped to Stats Reg %2d\n",
- tx_queue_stats_mappings[i].queue_id,
- tx_queue_stats_mappings[i].stats_counter_id);
- }
- }
- }
-
- printf(" %s####################################%s\n",
- nic_stats_mapping_border, nic_stats_mapping_border);
-}
-
void
rx_queue_infos_display(portid_t port_id, uint16_t queue_id)
{
@@ -1518,7 +1434,7 @@ port_mtu_set(portid_t port_id, uint16_t mtu)
* device supports jumbo frame.
*/
eth_overhead = dev_info.max_rx_pktlen - dev_info.max_mtu;
- if (mtu > RTE_ETHER_MAX_LEN - eth_overhead) {
+ if (mtu > RTE_ETHER_MTU) {
rte_port->dev_conf.rxmode.offloads |=
DEV_RX_OFFLOAD_JUMBO_FRAME;
rte_port->dev_conf.rxmode.max_rx_pkt_len =
@@ -1963,6 +1879,7 @@ port_shared_action_query(portid_t port_id, uint32_t id)
return -EINVAL;
switch (psa->type) {
case RTE_FLOW_ACTION_TYPE_RSS:
+ case RTE_FLOW_ACTION_TYPE_AGE:
data = &default_data;
break;
default:
@@ -1979,6 +1896,20 @@ port_shared_action_query(portid_t port_id, uint32_t id)
*((uint32_t *)data));
data = NULL;
break;
+ case RTE_FLOW_ACTION_TYPE_AGE:
+ if (!ret) {
+ struct rte_flow_query_age *resp = data;
+
+ printf("AGE:\n"
+ " aged: %u\n"
+ " sec_since_last_hit_valid: %u\n"
+ " sec_since_last_hit: %" PRIu32 "\n",
+ resp->aged,
+ resp->sec_since_last_hit_valid,
+ resp->sec_since_last_hit);
+ }
+ data = NULL;
+ break;
default:
printf("Shared action %u (type: %d) on port %u doesn't support"
" query\n", id, psa->type, port_id);
@@ -1986,6 +1917,7 @@ port_shared_action_query(portid_t port_id, uint32_t id)
}
return ret;
}
+
static struct port_flow_tunnel *
port_flow_tunnel_offload_cmd_prep(portid_t port_id,
const struct rte_flow_item *pattern,
@@ -2573,7 +2505,7 @@ tx_queue_id_is_invalid(queueid_t txq_id)
{
if (txq_id < nb_txq)
return 0;
- printf("Invalid TX queue %d (must be < nb_rxq=%d)\n", txq_id, nb_txq);
+ printf("Invalid TX queue %d (must be < nb_txq=%d)\n", txq_id, nb_txq);
return 1;
}
@@ -3785,7 +3717,7 @@ show_fec_capability(unsigned int num, struct rte_eth_fec_capa *speed_fec_capa)
printf("%s : ",
rte_eth_link_speed_to_str(speed_fec_capa[i].speed));
- for (j = RTE_ETH_FEC_AUTO; j < RTE_DIM(fec_mode_name); j++) {
+ for (j = 0; j < RTE_DIM(fec_mode_name); j++) {
if (RTE_ETH_FEC_MODE_TO_CAPA(j) &
speed_fec_capa[i].capa)
printf("%s ", fec_mode_name[j].name);
@@ -4528,8 +4460,7 @@ tx_vlan_pvid_set(portid_t port_id, uint16_t vlan_id, int on)
void
set_qmap(portid_t port_id, uint8_t is_rx, uint16_t queue_id, uint8_t map_value)
{
- uint16_t i;
- uint8_t existing_mapping_found = 0;
+ int ret;
if (port_id_is_invalid(port_id, ENABLED_WARN))
return;
@@ -4539,40 +4470,23 @@ set_qmap(portid_t port_id, uint8_t is_rx, uint16_t queue_id, uint8_t map_value)
if (map_value >= RTE_ETHDEV_QUEUE_STAT_CNTRS) {
printf("map_value not in required range 0..%d\n",
- RTE_ETHDEV_QUEUE_STAT_CNTRS - 1);
+ RTE_ETHDEV_QUEUE_STAT_CNTRS - 1);
return;
}
- if (!is_rx) { /*then tx*/
- for (i = 0; i < nb_tx_queue_stats_mappings; i++) {
- if ((tx_queue_stats_mappings[i].port_id == port_id) &&
- (tx_queue_stats_mappings[i].queue_id == queue_id)) {
- tx_queue_stats_mappings[i].stats_counter_id = map_value;
- existing_mapping_found = 1;
- break;
- }
- }
- if (!existing_mapping_found) { /* A new additional mapping... */
- tx_queue_stats_mappings[nb_tx_queue_stats_mappings].port_id = port_id;
- tx_queue_stats_mappings[nb_tx_queue_stats_mappings].queue_id = queue_id;
- tx_queue_stats_mappings[nb_tx_queue_stats_mappings].stats_counter_id = map_value;
- nb_tx_queue_stats_mappings++;
- }
- }
- else { /*rx*/
- for (i = 0; i < nb_rx_queue_stats_mappings; i++) {
- if ((rx_queue_stats_mappings[i].port_id == port_id) &&
- (rx_queue_stats_mappings[i].queue_id == queue_id)) {
- rx_queue_stats_mappings[i].stats_counter_id = map_value;
- existing_mapping_found = 1;
- break;
- }
+ if (!is_rx) { /* tx */
+ ret = rte_eth_dev_set_tx_queue_stats_mapping(port_id, queue_id,
+ map_value);
+ if (ret) {
+ printf("failed to set tx queue stats mapping.\n");
+ return;
}
- if (!existing_mapping_found) { /* A new additional mapping... */
- rx_queue_stats_mappings[nb_rx_queue_stats_mappings].port_id = port_id;
- rx_queue_stats_mappings[nb_rx_queue_stats_mappings].queue_id = queue_id;
- rx_queue_stats_mappings[nb_rx_queue_stats_mappings].stats_counter_id = map_value;
- nb_rx_queue_stats_mappings++;
+ } else { /* rx */
+ ret = rte_eth_dev_set_rx_queue_stats_mapping(port_id, queue_id,
+ map_value);
+ if (ret) {
+ printf("failed to set rx queue stats mapping.\n");
+ return;
}
}
}
diff --git a/dpdk/app/test-pmd/flowgen.c b/dpdk/app/test-pmd/flowgen.c
index acf3e24605..cabfc688ff 100644
--- a/dpdk/app/test-pmd/flowgen.c
+++ b/dpdk/app/test-pmd/flowgen.c
@@ -53,8 +53,11 @@ static struct rte_ether_addr cfg_ether_dst =
#define IP_DEFTTL 64 /* from RFC 1340. */
+/* Use this type to inform GCC that ip_sum violates aliasing rules. */
+typedef unaligned_uint16_t alias_int16_t __attribute__((__may_alias__));
+
static inline uint16_t
-ip_sum(const unaligned_uint16_t *hdr, int hdr_len)
+ip_sum(const alias_int16_t *hdr, int hdr_len)
{
uint32_t sum = 0;
@@ -150,7 +153,7 @@ pkt_burst_flow_gen(struct fwd_stream *fs)
next_flow);
ip_hdr->total_length = RTE_CPU_TO_BE_16(pkt_size -
sizeof(*eth_hdr));
- ip_hdr->hdr_checksum = ip_sum((unaligned_uint16_t *)ip_hdr,
+ ip_hdr->hdr_checksum = ip_sum((const alias_int16_t *)ip_hdr,
sizeof(*ip_hdr));
/* Initialize UDP header. */
diff --git a/dpdk/app/test-pmd/parameters.c b/dpdk/app/test-pmd/parameters.c
index bbb68a55ff..df5eb10d84 100644
--- a/dpdk/app/test-pmd/parameters.c
+++ b/dpdk/app/test-pmd/parameters.c
@@ -176,12 +176,6 @@ usage(char* progname)
"(0 <= N <= value of txd).\n");
printf(" --txrst=N: set the transmit RS bit threshold of TX rings to N "
"(0 <= N <= value of txd).\n");
- printf(" --tx-queue-stats-mapping=(port,queue,mapping)[,(port,queue,mapping]: "
- "tx queues statistics counters mapping "
- "(0 <= mapping <= %d).\n", RTE_ETHDEV_QUEUE_STAT_CNTRS - 1);
- printf(" --rx-queue-stats-mapping=(port,queue,mapping)[,(port,queue,mapping]: "
- "rx queues statistics counters mapping "
- "(0 <= mapping <= %d).\n", RTE_ETHDEV_QUEUE_STAT_CNTRS - 1);
printf(" --no-flush-rx: Don't flush RX streams before forwarding."
" Used mainly with PCAP drivers.\n");
printf(" --rxoffs=X[,Y]*: set RX segment offsets for split.\n");
@@ -300,93 +294,6 @@ parse_fwd_portmask(const char *portmask)
set_fwd_ports_mask((uint64_t) pm);
}
-
-static int
-parse_queue_stats_mapping_config(const char *q_arg, int is_rx)
-{
- char s[256];
- const char *p, *p0 = q_arg;
- char *end;
- enum fieldnames {
- FLD_PORT = 0,
- FLD_QUEUE,
- FLD_STATS_COUNTER,
- _NUM_FLD
- };
- unsigned long int_fld[_NUM_FLD];
- char *str_fld[_NUM_FLD];
- int i;
- unsigned size;
-
- /* reset from value set at definition */
- is_rx ? (nb_rx_queue_stats_mappings = 0) : (nb_tx_queue_stats_mappings = 0);
-
- while ((p = strchr(p0,'(')) != NULL) {
- ++p;
- if((p0 = strchr(p,')')) == NULL)
- return -1;
-
- size = p0 - p;
- if(size >= sizeof(s))
- return -1;
-
- snprintf(s, sizeof(s), "%.*s", size, p);
- if (rte_strsplit(s, sizeof(s), str_fld, _NUM_FLD, ',') != _NUM_FLD)
- return -1;
- for (i = 0; i < _NUM_FLD; i++){
- errno = 0;
- int_fld[i] = strtoul(str_fld[i], &end, 0);
- if (errno != 0 || end == str_fld[i] || int_fld[i] > 255)
- return -1;
- }
- /* Check mapping field is in correct range (0..RTE_ETHDEV_QUEUE_STAT_CNTRS-1) */
- if (int_fld[FLD_STATS_COUNTER] >= RTE_ETHDEV_QUEUE_STAT_CNTRS) {
- printf("Stats counter not in the correct range 0..%d\n",
- RTE_ETHDEV_QUEUE_STAT_CNTRS - 1);
- return -1;
- }
-
- if (!is_rx) {
- if ((nb_tx_queue_stats_mappings >=
- MAX_TX_QUEUE_STATS_MAPPINGS)) {
- printf("exceeded max number of TX queue "
- "statistics mappings: %hu\n",
- nb_tx_queue_stats_mappings);
- return -1;
- }
- tx_queue_stats_mappings_array[nb_tx_queue_stats_mappings].port_id =
- (uint8_t)int_fld[FLD_PORT];
- tx_queue_stats_mappings_array[nb_tx_queue_stats_mappings].queue_id =
- (uint8_t)int_fld[FLD_QUEUE];
- tx_queue_stats_mappings_array[nb_tx_queue_stats_mappings].stats_counter_id =
- (uint8_t)int_fld[FLD_STATS_COUNTER];
- ++nb_tx_queue_stats_mappings;
- }
- else {
- if ((nb_rx_queue_stats_mappings >=
- MAX_RX_QUEUE_STATS_MAPPINGS)) {
- printf("exceeded max number of RX queue "
- "statistics mappings: %hu\n",
- nb_rx_queue_stats_mappings);
- return -1;
- }
- rx_queue_stats_mappings_array[nb_rx_queue_stats_mappings].port_id =
- (uint8_t)int_fld[FLD_PORT];
- rx_queue_stats_mappings_array[nb_rx_queue_stats_mappings].queue_id =
- (uint8_t)int_fld[FLD_QUEUE];
- rx_queue_stats_mappings_array[nb_rx_queue_stats_mappings].stats_counter_id =
- (uint8_t)int_fld[FLD_STATS_COUNTER];
- ++nb_rx_queue_stats_mappings;
- }
-
- }
-/* Reassign the rx/tx_queue_stats_mappings pointer to point to this newly populated array rather */
-/* than to the default array (that was set at its definition) */
- is_rx ? (rx_queue_stats_mappings = rx_queue_stats_mappings_array) :
- (tx_queue_stats_mappings = tx_queue_stats_mappings_array);
- return 0;
-}
-
static void
print_invalid_socket_id_error(void)
{
@@ -664,8 +571,6 @@ launch_args_parse(int argc, char** argv)
{ "rxht", 1, 0, 0 },
{ "rxwt", 1, 0, 0 },
{ "rxfreet", 1, 0, 0 },
- { "tx-queue-stats-mapping", 1, 0, 0 },
- { "rx-queue-stats-mapping", 1, 0, 0 },
{ "no-flush-rx", 0, 0, 0 },
{ "flow-isolate-all", 0, 0, 0 },
{ "rxoffs", 1, 0, 0 },
@@ -929,12 +834,9 @@ launch_args_parse(int argc, char** argv)
}
if (!strcmp(lgopts[opt_idx].name, "max-pkt-len")) {
n = atoi(optarg);
- if (n >= RTE_ETHER_MIN_LEN) {
+ if (n >= RTE_ETHER_MIN_LEN)
rx_mode.max_rx_pkt_len = (uint32_t) n;
- if (n > RTE_ETHER_MAX_LEN)
- rx_offloads |=
- DEV_RX_OFFLOAD_JUMBO_FRAME;
- } else
+ else
rte_exit(EXIT_FAILURE,
"Invalid max-pkt-len=%d - should be > %d\n",
n, RTE_ETHER_MIN_LEN);
@@ -1279,18 +1181,6 @@ launch_args_parse(int argc, char** argv)
else
rte_exit(EXIT_FAILURE, "rxfreet must be >= 0\n");
}
- if (!strcmp(lgopts[opt_idx].name, "tx-queue-stats-mapping")) {
- if (parse_queue_stats_mapping_config(optarg, TX)) {
- rte_exit(EXIT_FAILURE,
- "invalid TX queue statistics mapping config entered\n");
- }
- }
- if (!strcmp(lgopts[opt_idx].name, "rx-queue-stats-mapping")) {
- if (parse_queue_stats_mapping_config(optarg, RX)) {
- rte_exit(EXIT_FAILURE,
- "invalid RX queue statistics mapping config entered\n");
- }
- }
if (!strcmp(lgopts[opt_idx].name, "rxoffs")) {
unsigned int seg_off[MAX_SEGS_BUFFER_SPLIT];
unsigned int nb_offs;
diff --git a/dpdk/app/test-pmd/testpmd.c b/dpdk/app/test-pmd/testpmd.c
index 33fc0fddf5..555852ae5e 100644
--- a/dpdk/app/test-pmd/testpmd.c
+++ b/dpdk/app/test-pmd/testpmd.c
@@ -443,8 +443,11 @@ lcoreid_t latencystats_lcore_id = -1;
* Ethernet device configuration.
*/
struct rte_eth_rxmode rx_mode = {
- .max_rx_pkt_len = RTE_ETHER_MAX_LEN,
- /**< Default maximum frame length. */
+ /* Default maximum frame length.
+ * Zero is converted to "RTE_ETHER_MTU + PMD Ethernet overhead"
+ * in init_config().
+ */
+ .max_rx_pkt_len = 0,
};
struct rte_eth_txmode tx_mode = {
@@ -476,15 +479,6 @@ struct rte_fdir_conf fdir_conf = {
volatile int test_done = 1; /* stop packet forwarding when set to 1. */
-struct queue_stats_mappings tx_queue_stats_mappings_array[MAX_TX_QUEUE_STATS_MAPPINGS];
-struct queue_stats_mappings rx_queue_stats_mappings_array[MAX_RX_QUEUE_STATS_MAPPINGS];
-
-struct queue_stats_mappings *tx_queue_stats_mappings = tx_queue_stats_mappings_array;
-struct queue_stats_mappings *rx_queue_stats_mappings = rx_queue_stats_mappings_array;
-
-uint16_t nb_tx_queue_stats_mappings = 0;
-uint16_t nb_rx_queue_stats_mappings = 0;
-
/*
* Display zero values by default for xstats
*/
@@ -520,8 +514,6 @@ enum rte_eth_rx_mq_mode rx_mq_mode = ETH_MQ_RX_VMDQ_DCB_RSS;
/* Forward function declarations */
static void setup_attached_port(portid_t pi);
-static void map_port_queue_stats_mapping_registers(portid_t pi,
- struct rte_port *port);
static void check_all_ports_link_status(uint32_t port_mask);
static int eth_event_callback(portid_t port_id,
enum rte_eth_event_type type,
@@ -1457,6 +1449,11 @@ init_config(void)
rte_exit(EXIT_FAILURE,
"rte_eth_dev_info_get() failed\n");
+ ret = update_jumbo_frame_offload(pid);
+ if (ret != 0)
+ printf("Updating jumbo frame offload failed for port %u\n",
+ pid);
+
if (!(port->dev_info.tx_offload_capa &
DEV_TX_OFFLOAD_MBUF_FAST_FREE))
port->dev_conf.txmode.offloads &=
@@ -1857,8 +1854,6 @@ fwd_stats_display(void)
fwd_cycles += fs->core_cycles;
}
for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
- uint8_t j;
-
pt_id = fwd_ports_ids[i];
port = &ports[pt_id];
@@ -1881,88 +1876,34 @@ fwd_stats_display(void)
printf("\n %s Forward statistics for port %-2d %s\n",
fwd_stats_border, pt_id, fwd_stats_border);
- if (!port->rx_queue_stats_mapping_enabled &&
- !port->tx_queue_stats_mapping_enabled) {
- printf(" RX-packets: %-14"PRIu64
- " RX-dropped: %-14"PRIu64
- "RX-total: %-"PRIu64"\n",
- stats.ipackets, stats.imissed,
- stats.ipackets + stats.imissed);
-
- if (cur_fwd_eng == &csum_fwd_engine)
- printf(" Bad-ipcsum: %-14"PRIu64
- " Bad-l4csum: %-14"PRIu64
- "Bad-outer-l4csum: %-14"PRIu64"\n",
- ports_stats[pt_id].rx_bad_ip_csum,
- ports_stats[pt_id].rx_bad_l4_csum,
- ports_stats[pt_id].rx_bad_outer_l4_csum);
- if (stats.ierrors + stats.rx_nombuf > 0) {
- printf(" RX-error: %-"PRIu64"\n",
- stats.ierrors);
- printf(" RX-nombufs: %-14"PRIu64"\n",
- stats.rx_nombuf);
- }
-
- printf(" TX-packets: %-14"PRIu64
- " TX-dropped: %-14"PRIu64
- "TX-total: %-"PRIu64"\n",
- stats.opackets, ports_stats[pt_id].tx_dropped,
- stats.opackets + ports_stats[pt_id].tx_dropped);
- } else {
- printf(" RX-packets: %14"PRIu64
- " RX-dropped:%14"PRIu64
- " RX-total:%14"PRIu64"\n",
- stats.ipackets, stats.imissed,
- stats.ipackets + stats.imissed);
-
- if (cur_fwd_eng == &csum_fwd_engine)
- printf(" Bad-ipcsum:%14"PRIu64
- " Bad-l4csum:%14"PRIu64
- " Bad-outer-l4csum: %-14"PRIu64"\n",
- ports_stats[pt_id].rx_bad_ip_csum,
- ports_stats[pt_id].rx_bad_l4_csum,
- ports_stats[pt_id].rx_bad_outer_l4_csum);
- if ((stats.ierrors + stats.rx_nombuf) > 0) {
- printf(" RX-error:%"PRIu64"\n", stats.ierrors);
- printf(" RX-nombufs: %14"PRIu64"\n",
- stats.rx_nombuf);
- }
+ printf(" RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64
+ "RX-total: %-"PRIu64"\n", stats.ipackets, stats.imissed,
+ stats.ipackets + stats.imissed);
- printf(" TX-packets: %14"PRIu64
- " TX-dropped:%14"PRIu64
- " TX-total:%14"PRIu64"\n",
- stats.opackets, ports_stats[pt_id].tx_dropped,
- stats.opackets + ports_stats[pt_id].tx_dropped);
+ if (cur_fwd_eng == &csum_fwd_engine)
+ printf(" Bad-ipcsum: %-14"PRIu64
+ " Bad-l4csum: %-14"PRIu64
+ "Bad-outer-l4csum: %-14"PRIu64"\n",
+ ports_stats[pt_id].rx_bad_ip_csum,
+ ports_stats[pt_id].rx_bad_l4_csum,
+ ports_stats[pt_id].rx_bad_outer_l4_csum);
+ if (stats.ierrors + stats.rx_nombuf > 0) {
+ printf(" RX-error: %-"PRIu64"\n", stats.ierrors);
+ printf(" RX-nombufs: %-14"PRIu64"\n", stats.rx_nombuf);
}
+ printf(" TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64
+ "TX-total: %-"PRIu64"\n",
+ stats.opackets, ports_stats[pt_id].tx_dropped,
+ stats.opackets + ports_stats[pt_id].tx_dropped);
+
if (record_burst_stats) {
if (ports_stats[pt_id].rx_stream)
pkt_burst_stats_display("RX",
&ports_stats[pt_id].rx_stream->rx_burst_stats);
if (ports_stats[pt_id].tx_stream)
pkt_burst_stats_display("TX",
- &ports_stats[pt_id].tx_stream->tx_burst_stats);
- }
-
- if (port->rx_queue_stats_mapping_enabled) {
- printf("\n");
- for (j = 0; j < RTE_ETHDEV_QUEUE_STAT_CNTRS; j++) {
- printf(" Stats reg %2d RX-packets:%14"PRIu64
- " RX-errors:%14"PRIu64
- " RX-bytes:%14"PRIu64"\n",
- j, stats.q_ipackets[j],
- stats.q_errors[j], stats.q_ibytes[j]);
- }
- printf("\n");
- }
- if (port->tx_queue_stats_mapping_enabled) {
- for (j = 0; j < RTE_ETHDEV_QUEUE_STAT_CNTRS; j++) {
- printf(" Stats reg %2d TX-packets:%14"PRIu64
- " TX-bytes:%14"
- PRIu64"\n",
- j, stats.q_opackets[j],
- stats.q_obytes[j]);
- }
+ &ports_stats[pt_id].tx_stream->tx_burst_stats);
}
printf(" %s--------------------------------%s\n",
@@ -2236,11 +2177,6 @@ start_packet_forwarding(int with_tx_first)
rxtx_config_display();
fwd_stats_reset();
- for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
- pt_id = fwd_ports_ids[i];
- port = &ports[pt_id];
- map_port_queue_stats_mapping_registers(pt_id, port);
- }
if (with_tx_first) {
port_fwd_begin = tx_only_engine.port_fwd_begin;
if (port_fwd_begin != NULL) {
@@ -2806,6 +2742,9 @@ stop_port(portid_t pid)
}
}
+ if (port->flow_list)
+ port_flow_flush(pi);
+
if (rte_eth_dev_stop(pi) != 0)
RTE_LOG(ERR, EAL, "rte_eth_dev_stop failed for port %u\n",
pi);
@@ -3352,84 +3291,6 @@ dev_event_callback(const char *device_name, enum rte_dev_event_type type,
}
}
-static int
-set_tx_queue_stats_mapping_registers(portid_t port_id, struct rte_port *port)
-{
- uint16_t i;
- int diag;
- uint8_t mapping_found = 0;
-
- for (i = 0; i < nb_tx_queue_stats_mappings; i++) {
- if ((tx_queue_stats_mappings[i].port_id == port_id) &&
- (tx_queue_stats_mappings[i].queue_id < nb_txq )) {
- diag = rte_eth_dev_set_tx_queue_stats_mapping(port_id,
- tx_queue_stats_mappings[i].queue_id,
- tx_queue_stats_mappings[i].stats_counter_id);
- if (diag != 0)
- return diag;
- mapping_found = 1;
- }
- }
- if (mapping_found)
- port->tx_queue_stats_mapping_enabled = 1;
- return 0;
-}
-
-static int
-set_rx_queue_stats_mapping_registers(portid_t port_id, struct rte_port *port)
-{
- uint16_t i;
- int diag;
- uint8_t mapping_found = 0;
-
- for (i = 0; i < nb_rx_queue_stats_mappings; i++) {
- if ((rx_queue_stats_mappings[i].port_id == port_id) &&
- (rx_queue_stats_mappings[i].queue_id < nb_rxq )) {
- diag = rte_eth_dev_set_rx_queue_stats_mapping(port_id,
- rx_queue_stats_mappings[i].queue_id,
- rx_queue_stats_mappings[i].stats_counter_id);
- if (diag != 0)
- return diag;
- mapping_found = 1;
- }
- }
- if (mapping_found)
- port->rx_queue_stats_mapping_enabled = 1;
- return 0;
-}
-
-static void
-map_port_queue_stats_mapping_registers(portid_t pi, struct rte_port *port)
-{
- int diag = 0;
-
- diag = set_tx_queue_stats_mapping_registers(pi, port);
- if (diag != 0) {
- if (diag == -ENOTSUP) {
- port->tx_queue_stats_mapping_enabled = 0;
- printf("TX queue stats mapping not supported port id=%d\n", pi);
- }
- else
- rte_exit(EXIT_FAILURE,
- "set_tx_queue_stats_mapping_registers "
- "failed for port id=%d diag=%d\n",
- pi, diag);
- }
-
- diag = set_rx_queue_stats_mapping_registers(pi, port);
- if (diag != 0) {
- if (diag == -ENOTSUP) {
- port->rx_queue_stats_mapping_enabled = 0;
- printf("RX queue stats mapping not supported port id=%d\n", pi);
- }
- else
- rte_exit(EXIT_FAILURE,
- "set_rx_queue_stats_mapping_registers "
- "failed for port id=%d diag=%d\n",
- pi, diag);
- }
-}
-
static void
rxtx_port_config(struct rte_port *port)
{
@@ -3487,6 +3348,80 @@ rxtx_port_config(struct rte_port *port)
}
}
+/*
+ * Helper function to arrange max_rx_pktlen value and JUMBO_FRAME offload,
+ * MTU is also aligned if JUMBO_FRAME offload is not set.
+ *
+ * port->dev_info should be set before calling this function.
+ *
+ * return 0 on success, negative on error
+ */
+int
+update_jumbo_frame_offload(portid_t portid)
+{
+ struct rte_port *port = &ports[portid];
+ uint32_t eth_overhead;
+ uint64_t rx_offloads;
+ int ret;
+ bool on;
+
+ /* Update the max_rx_pkt_len to have MTU as RTE_ETHER_MTU */
+ if (port->dev_info.max_mtu != UINT16_MAX &&
+ port->dev_info.max_rx_pktlen > port->dev_info.max_mtu)
+ eth_overhead = port->dev_info.max_rx_pktlen -
+ port->dev_info.max_mtu;
+ else
+ eth_overhead = RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN;
+
+ rx_offloads = port->dev_conf.rxmode.offloads;
+
+ /* Default config value is 0 to use PMD specific overhead */
+ if (port->dev_conf.rxmode.max_rx_pkt_len == 0)
+ port->dev_conf.rxmode.max_rx_pkt_len = RTE_ETHER_MTU + eth_overhead;
+
+ if (port->dev_conf.rxmode.max_rx_pkt_len <= RTE_ETHER_MTU + eth_overhead) {
+ rx_offloads &= ~DEV_RX_OFFLOAD_JUMBO_FRAME;
+ on = false;
+ } else {
+ if ((port->dev_info.rx_offload_capa & DEV_RX_OFFLOAD_JUMBO_FRAME) == 0) {
+ printf("Frame size (%u) is not supported by port %u\n",
+ port->dev_conf.rxmode.max_rx_pkt_len,
+ portid);
+ return -1;
+ }
+ rx_offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME;
+ on = true;
+ }
+
+ if (rx_offloads != port->dev_conf.rxmode.offloads) {
+ uint16_t qid;
+
+ port->dev_conf.rxmode.offloads = rx_offloads;
+
+ /* Apply JUMBO_FRAME offload configuration to Rx queue(s) */
+ for (qid = 0; qid < port->dev_info.nb_rx_queues; qid++) {
+ if (on)
+ port->rx_conf[qid].offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME;
+ else
+ port->rx_conf[qid].offloads &= ~DEV_RX_OFFLOAD_JUMBO_FRAME;
+ }
+ }
+
+ /* If JUMBO_FRAME is set MTU conversion done by ethdev layer,
+ * if unset do it here
+ */
+ if ((rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) == 0) {
+ ret = rte_eth_dev_set_mtu(portid,
+ port->dev_conf.rxmode.max_rx_pkt_len - eth_overhead);
+ if (ret)
+ printf("Failed to set MTU to %u for port %u\n",
+ port->dev_conf.rxmode.max_rx_pkt_len - eth_overhead,
+ portid);
+ }
+
+ return 0;
+}
+
void
init_port_config(void)
{
@@ -3526,7 +3461,6 @@ init_port_config(void)
if (ret != 0)
return;
- map_port_queue_stats_mapping_registers(pid, port);
#if defined RTE_NET_IXGBE && defined RTE_LIBRTE_IXGBE_BYPASS
rte_pmd_ixgbe_bypass_init(pid);
#endif
@@ -3737,8 +3671,6 @@ init_port_dcb_config(portid_t pid,
if (retval != 0)
return retval;
- map_port_queue_stats_mapping_registers(pid, rte_port);
-
rte_port->dcb_flag = 1;
return 0;
diff --git a/dpdk/app/test-pmd/testpmd.h b/dpdk/app/test-pmd/testpmd.h
index 6b901a894f..2f8f5a92e4 100644
--- a/dpdk/app/test-pmd/testpmd.h
+++ b/dpdk/app/test-pmd/testpmd.h
@@ -206,8 +206,6 @@ struct rte_port {
uint16_t tunnel_tso_segsz; /**< Segmentation offload MSS for tunneled pkts. */
uint16_t tx_vlan_id;/**< The tag ID */
uint16_t tx_vlan_id_outer;/**< The outer tag ID */
- uint8_t tx_queue_stats_mapping_enabled;
- uint8_t rx_queue_stats_mapping_enabled;
volatile uint16_t port_status; /**< port started or not */
uint8_t need_setup; /**< port just attached */
uint8_t need_reconfig; /**< need reconfiguring port or not */
@@ -326,25 +324,6 @@ enum dcb_mode_enable
DCB_ENABLED
};
-#define MAX_TX_QUEUE_STATS_MAPPINGS 1024 /* MAX_PORT of 32 @ 32 tx_queues/port */
-#define MAX_RX_QUEUE_STATS_MAPPINGS 4096 /* MAX_PORT of 32 @ 128 rx_queues/port */
-
-struct queue_stats_mappings {
- portid_t port_id;
- uint16_t queue_id;
- uint8_t stats_counter_id;
-} __rte_cache_aligned;
-
-extern struct queue_stats_mappings tx_queue_stats_mappings_array[];
-extern struct queue_stats_mappings rx_queue_stats_mappings_array[];
-
-/* Assign both tx and rx queue stats mappings to the same default values */
-extern struct queue_stats_mappings *tx_queue_stats_mappings;
-extern struct queue_stats_mappings *rx_queue_stats_mappings;
-
-extern uint16_t nb_tx_queue_stats_mappings;
-extern uint16_t nb_rx_queue_stats_mappings;
-
extern uint8_t xstats_hide_zero; /**< Hide zero values for xstats display */
/* globals used for configuration */
@@ -790,7 +769,6 @@ void nic_stats_display(portid_t port_id);
void nic_stats_clear(portid_t port_id);
void nic_xstats_display(portid_t port_id);
void nic_xstats_clear(portid_t port_id);
-void nic_stats_mapping_display(portid_t port_id);
void device_infos_display(const char *identifier);
void port_infos_display(portid_t port_id);
void port_summary_display(portid_t port_id);
@@ -1027,6 +1005,7 @@ uint16_t tx_pkt_set_dynf(uint16_t port_id, __rte_unused uint16_t queue,
__rte_unused void *user_param);
void add_tx_dynf_callback(portid_t portid);
void remove_tx_dynf_callback(portid_t portid);
+int update_jumbo_frame_offload(portid_t portid);
/*
* Work-around of a compilation error with ICC on invocations of the
diff --git a/dpdk/app/test-pmd/util.c b/dpdk/app/test-pmd/util.c
index 649bf8f53a..a9e431a8b2 100644
--- a/dpdk/app/test-pmd/util.c
+++ b/dpdk/app/test-pmd/util.c
@@ -15,12 +15,23 @@
#include "testpmd.h"
+#define MAX_STRING_LEN 8192
+
+#define MKDUMPSTR(buf, buf_size, cur_len, ...) \
+do { \
+ if (cur_len >= buf_size) \
+ break; \
+ cur_len += snprintf(buf + cur_len, buf_size - cur_len, __VA_ARGS__); \
+} while (0)
+
static inline void
-print_ether_addr(const char *what, const struct rte_ether_addr *eth_addr)
+print_ether_addr(const char *what, const struct rte_ether_addr *eth_addr,
+ char print_buf[], size_t buf_size, size_t *cur_len)
{
char buf[RTE_ETHER_ADDR_FMT_SIZE];
+
rte_ether_format_addr(buf, RTE_ETHER_ADDR_FMT_SIZE, eth_addr);
- printf("%s%s", what, buf);
+ MKDUMPSTR(print_buf, buf_size, *cur_len, "%s%s", what, buf);
}
Loading
Loading full blame...