intel / intel-ipsec-mb

Intel(R) Multi-Buffer Crypto for IPSec
BSD 3-Clause "New" or "Revised" License
292 stars 88 forks source link

Performance degradation with AES cipher on Intel Xeon D-1548 (Broadwell) CPU #90

Closed klem23 closed 2 years ago

klem23 commented 2 years ago

Hi,

I encounter a slight performance loss (~10%) with AES cipher (cbc & ctr) on Intel Xeon D-1548 (Broadwell arch -> avx2) accross intel-ipsec-mb version from 0.52 to 1.1. I notice the problem when updating DPDK (19.11.2 -> 20.11.3) and then investigate with different intel-ipsec-mb version. So I finally run your perf tools with several versions and confirm my observation. The results are at the bottom of this message. I used the following command for testing : ipsec_perf --cipher-algo aes-cbc-256 --arch avx2

Is there a new way to compile or use the intel-ipsec-mb library that I miss ? Have you any advice or idea about this ?

Thanks

KEY SIZE | v0.52 | v0.53 | v1.0 | v1.1

16 | 108 | 106 | 129 | 129 32 | 123 | 121 | 144 | 145 48 | 135 | 138 | 160 | 155 64 | 154 | 151 | 177 | 172 80 | 166 | 166 | 193 | 188 96 | 181 | 180 | 209 | 200 112 | 201 | 200 | 226 | 218 128 | 215 | 210 | 237 | 228 144 | 232 | 230 | 255 | 245 160 | 246 | 244 | 270 | 261 176 | 259 | 257 | 287 | 276 192 | 275 | 273 | 298 | 288 208 | 288 | 289 | 313 | 302 224 | 306 | 309 | 335 | 325 240 | 320 | 323 | 355 | 342 256 | 343 | 329 | 368 | 347 272 | 345 | 346 | 373 | 360 288 | 358 | 360 | 388 | 374 304 | 373 | 375 | 403 | 389 320 | 387 | 397 | 418 | 407 336 | 413 | 401 | 439 | 422 352 | 428 | 415 | 454 | 437 368 | 431 | 437 | 464 | 457 384 | 451 | 452 | 487 | 485 400 | 464 | 467 | 503 | 501 416 | 480 | 481 | 517 | 516 432 | 500 | 504 | 526 | 518 448 | 519 | 507 | 540 | 530 464 | 534 | 524 | 553 | 553 480 | 541 | 552 | 566 | 563 496 | 556 | 557 | 592 | 587 512 | 570 | 572 | 606 | 604 528 | 584 | 596 | 611 | 611 544 | 611 | 592 | 630 | 631 560 | 612 | 614 | 636 | 634 576 | 636 | 624 | 654 | 656 592 | 652 | 640 | 670 | 672 608 | 656 | 657 | 681 | 695 624 | 675 | 673 | 704 | 697 640 | 694 | 683 | 715 | 715 656 | 698 | 703 | 722 | 720 672 | 712 | 719 | 736 | 735 688 | 730 | 743 | 756 | 753 704 | 756 | 752 | 767 | 775 720 | 770 | 771 | 784 | 790 736 | 785 | 774 | 803 | 810 752 | 790 | 800 | 813 | 812 768 | 814 | 803 | 835 | 840 784 | 816 | 820 | 855 | 849 800 | 839 | 838 | 867 | 860 816 | 855 | 855 | 872 | 880 832 | 873 | 856 | 890 | 898 848 | 872 | 882 | 914 | 907 864 | 892 | 892 | 928 | 940 880 | 903 | 909 | 940 | 937 896 | 919 | 924 | 956 | 951 912 | 932 | 942 | 969 | 967 928 | 950 | 960 | 986 | 985 944 | 974 | 973 | 990 | 996 960 | 982 | 994 | 1008 | 1005 976 | 1006 | 997 | 1026 | 1024 992 | 1019 | 1003 | 1043 | 1050 1008 | 1033 | 1018 | 1059 | 1069 1024 | 1051 | 1036 | 1080 | 1090 1040 | 1051 | 1056 | 1089 | 1105 1056 | 1067 | 1081 | 1089 | 1094 1072 | 1081 | 1086 | 1119 | 1134 1088 | 1102 | 1105 | 1133 | 1126 1104 | 1120 | 1107 | 1149 | 1180 1120 | 1129 | 1145 | 1164 | 1165 1136 | 1147 | 1152 | 1163 | 1161 1152 | 1162 | 1165 | 1179 | 1176 1168 | 1178 | 1180 | 1193 | 1190 1184 | 1195 | 1199 | 1211 | 1210 1200 | 1212 | 1217 | 1228 | 1229 1216 | 1225 | 1216 | 1248 | 1248 1232 | 1230 | 1246 | 1266 | 1264 1248 | 1255 | 1266 | 1285 | 1278 1264 | 1267 | 1271 | 1283 | 1281 1280 | 1282 | 1294 | 1312 | 1306 1296 | 1295 | 1299 | 1312 | 1309 1312 | 1304 | 1320 | 1342 | 1341 1328 | 1328 | 1318 | 1360 | 1358 1344 | 1328 | 1333 | 1365 | 1376 1360 | 1342 | 1352 | 1379 | 1394 1376 | 1370 | 1361 | 1400 | 1405 1392 | 1391 | 1393 | 1400 | 1402 1408 | 1401 | 1386 | 1430 | 1439 1424 | 1417 | 1418 | 1429 | 1433 1440 | 1429 | 1415 | 1459 | 1468 1456 | 1448 | 1448 | 1462 | 1462 1472 | 1448 | 1462 | 1485 | 1499 1488 | 1473 | 1462 | 1500 | 1502 1504 | 1493 | 1484 | 1523 | 1524 1520 | 1506 | 1493 | 1535 | 1545 1536 | 1521 | 1527 | 1547 | 1545 1552 | 1520 | 1536 | 1556 | 1582 1568 | 1539 | 1556 | 1576 | 1605 1584 | 1559 | 1564 | 1576 | 1583 1600 | 1585 | 1593 | 1611 | 1609 1616 | 1589 | 1595 | 1607 | 1613 1632 | 1600 | 1620 | 1636 | 1657 1648 | 1630 | 1633 | 1650 | 1646 1664 | 1639 | 1632 | 1668 | 1672 1680 | 1645 | 1641 | 1676 | 1689 1696 | 1662 | 1663 | 1689 | 1701 1712 | 1669 | 1687 | 1700 | 1718 1728 | 1687 | 1706 | 1720 | 1740 1744 | 1709 | 1710 | 1736 | 1748 1760 | 1716 | 1718 | 1748 | 1762 1776 | 1733 | 1735 | 1765 | 1780 1792 | 1750 | 1750 | 1777 | 1788 1808 | 1784 | 1787 | 1801 | 1797 1824 | 1776 | 1782 | 1793 | 1795 1840 | 1794 | 1799 | 1811 | 1811 1856 | 1824 | 1826 | 1839 | 1835 1872 | 1822 | 1819 | 1854 | 1861 1888 | 1845 | 1852 | 1873 | 1871 1904 | 1858 | 1854 | 1881 | 1894 1920 | 1872 | 1873 | 1906 | 1918 1936 | 1894 | 1899 | 1913 | 1935 1952 | 1906 | 1908 | 1923 | 1918 1968 | 1922 | 1923 | 1939 | 1934 1984 | 1938 | 1939 | 1954 | 1947 2000 | 1952 | 1952 | 1967 | 1962 2016 | 1968 | 1968 | 1983 | 1976 2032 | 1983 | 1983 | 1997 | 1991 2048 | 1996 | 2001 | 2010 | 2009

pablodelara commented 2 years ago

Hi @klem23. There are new security parameters that were introduced after version 0.52: SAFE_PARAM, SAFE_DATA and SAFE_LOOKUP (see section 6 or README file). The first two will affect the performance of any algorithm, so could you compile the library disabling them, with the following command line: make SAFE_DATA=n SAFE_PARAM=n

Please, also read section 6 to know the implications of disabling such options.

klem23 commented 2 years ago

Thanks a lot for the information. I will double read the README.