summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/handle_esp.c
AgeCommit message (Collapse)AuthorFilesLines
2023-07-24Support packets in flightHEADmasterLuc Provoost1-45/+63
The handle_esp_bulk function might enqueue packets on a QAT device. These packets are not necessarily dequeued in the same call to the handle_bulk function since they might be asynchronously processed. Therefore, in some cases, we need to call this handle_bulk function again later, even when no new packets are received on the rx queue. To achieve this, the TASK_FEATURE_ZERO_RX flag is set. The number of packets in flight are stored to decide if packets need to be dequeued or not. The handle_esp_bulk function will continue to dequeue packets till none are left, even in case no new packets arrive. Signed-off-by: Luc Provoost <luc.provoost@gmail.com> Change-Id: I15e5b92c2413a1d3823557f70b1f437b35ca5a12
2023-06-29Renaming of defines for clarityLuc Provoost1-2/+2
Add the prefix TBASE_FLAG to all defines that are used in the flags field of the tbase structure Signed-off-by: Luc Provoost <luc.provoost@gmail.com> Change-Id: Ic7c6c1ba66fbda5a4a43e9a3bf966710157b5b17
2023-05-29Rework of handle_esp_bulkLuc Provoost1-365/+385
Merged the 2 handle_bulk functions into 1. We had a separate function for encryption and one for decryption. The code is almost the same. The way we enqueue and dequeue the cryptodev queueus has also changed and is now inline with the dpdk demo code (l2fwd_crypto). Signed-off-by: Luc Provoost <luc.provoost@gmail.com> Change-Id: Id9a9f6651884743bcdb4c0a509696489fedc554a
2023-04-17remove call to rte_cryptodev_pmd_get_devLuc Provoost1-8/+0
The handle_esp is not used a lot at this point and it was not compiled by default. When integrating this back into PROX, no DPDK backwards compatibility was taken into account. The rte_cryptodev_pmd_get_dev is not supported any more in recent DPDK versions. Signed-off-by: Luc Provoost <luc.provoost@gmail.com> Change-Id: I97793261dd52aa869a4857716518dc1ff7d5f22f
2023-04-13Asynchronous Encryption/DecryptionLuc Provoost1-74/+72
In the handle_esp_xxx_bulk functions, we are not dequeuing every crypto_op that was enqueued in this function. The while loop has been replaced by a single call to the dequeue function. If crypto_ops are still in flight, we count on the fact they will be dequeued when the handle_esp_xxx_bulk function is called next time. Note that this will only happen if new packets are coming in. If no new packets are coming in, there might be some packets in flight that will not be dequeued. When calling the rte_crypto_op_pool_create function, we now pass the number of mbufs as specified in the PROX config file (mempool size), and not a hard coded number. The init code has also been put more in sync with recent version of the l2fwd_crypto example code. Signed-off-by: Luc Provoost <luc.provoost@gmail.com> Change-Id: Idfab13a273bf76831e5133cf59149fc93949f1ab
2020-01-29Prepare for DPDK 19.08 supportXavier Simonart1-69/+69
This commit prepares PROX for supporting changes from DPDK 19.08 Mainly, the "sed" listed below were run. In addition, - some forward definition have been removed, - prox_compat.h has been updated - prox_compat.h has been included where necessary. Hence such a commit is rather easy to review and to reapply on other branches if necessary. sed -i 's/struct ether_hdr/prox_rte_ether_hdr/g' *.h sed -i 's/struct ether_hdr/prox_rte_ether_hdr/g' *.c sed -i 's/struct ether_addr/prox_rte_ether_addr/g' *.c sed -i 's/struct ether_addr/prox_rte_ether_addr/g' *.h sed -i 's/prox_rte_ether_addr_port/struct ether_addr_port/g' *.c sed -i 's/prox_rte_ether_addr_port/struct ether_addr_port/g' *.h sed -i 's/struct vlan_hdr/prox_rte_vlan_hdr/g' *.c sed -i 's/struct vlan_hdr/prox_rte_vlan_hdr/g' *.h sed -i 's/struct ipv4_hdr/prox_rte_ipv4_hdr/g' *.h sed -i 's/struct ipv4_hdr/prox_rte_ipv4_hdr/g' *.c sed -i 's/struct ipv6_hdr/prox_rte_ipv6_hdr/g' *.c sed -i 's/struct ipv6_hdr/prox_rte_ipv6_hdr/g' *.h sed -i 's/struct udp_hdr/prox_rte_udp_hdr/g' *.c sed -i 's/struct udp_hdr/prox_rte_udp_hdr/g' *.h sed -i 's/struct tcp_hdr/prox_rte_tcp_hdr/g' *.c sed -i 's/struct tcp_hdr/prox_rte_tcp_hdr/g' *.h sed -i 's/struct prox_rte_ether_addr_copy/ether_addr_copy/g' *.c sed -i 's/struct prox_rte_ether_addr_copy/ether_addr_copy/g' *.h sed -i 's/struct prox_rte_ether_addr_copy/prox_rte_ether_addr_copy/g' *.c sed -i 's/struct prox_rte_ether_addr_copy/ether_addr_copy/g' *.h sed -i 's/prox_rte_ether_addr_copy/ether_addr_copy/g' *.h sed -i 's/prox_rte_ether_addr_copy/ether_addr_copy/g' *.c sed -i 's/ether_addr_copy/prox_rte_ether_addr_copy/g' *.c sed -i 's/ether_addr_copy/prox_rte_ether_addr_copy/g' *.h sed -i 's/prox_rte_ether_hdr_arp/struct ether_hdr_arp/g' *.h sed -i 's/prox_rte_ether_hdr_arp/struct ether_hdr_arp/g' *.c sed -i 's/struct vxlan_gpe_hdr/prox_rte_vxlan_gpe_hdr/g' *.h sed -i 's/struct vxlan_gpe_hdr/prox_rte_vxlan_gpe_hdr/g' *.c sed -i 's/eth_random_addr/prox_rte_eth_random_addr/g' *.c sed -i 's/eth_random_addr/prox_rte_eth_random_addr/g' *.h sed -i 's/ETHER_CRC_LEN/PROX_RTE_ETHER_CRC_LEN/g' *.c sed -i 's/ETHER_CRC_LEN/PROX_RTE_ETHER_CRC_LEN/g' *.h sed -i 's/ETHER_HDR_LEN/PROX_RTE_ETHER_HDR_LEN/g' *.c sed -i 's/ETHER_HDR_LEN/PROX_RTE_ETHER_HDR_LEN/g' *.h sed -i 's/ETHER_MAX_LEN/PROX_RTE_ETHER_MAX_LEN/g' *.c sed -i 's/ETHER_MAX_LEN/PROX_RTE_ETHER_MAX_LEN/g' *.h sed -i 's/ETHER_MIN_LEN/PROX_RTE_ETHER_MIN_LEN/g' *.c sed -i 's/ETHER_MIN_LEN/PROX_RTE_ETHER_MIN_LEN/g' *.h sed -i 's/TCP_SYN_FLAG/PROX_RTE_TCP_SYN_FLAG/g' *.c sed -i 's/TCP_RST_FLAG/PROX_RTE_TCP_RST_FLAG/g' *.c sed -i 's/TCP_FIN_FLAG/PROX_RTE_TCP_FIN_FLAG/g' *.c sed -i 's/TCP_ACK_FLAG/PROX_RTE_TCP_ACK_FLAG/g' *.c Change-Id: I4dfe8be68e618c94dcaae28754579fbeb571bb00 Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
2019-10-23Added support for DPDK 19.05 / IPSecXavier Simonart1-27/+19
Note that since 6073b359 (April 2018) IPsec PROX support requires at least DPDK 17.11. Hence README has been updated. Change-Id: I34b7a968c16db5c3a3fc7bb6af111fdb49ad6b91 Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
2018-10-31Support for DPDK 18.05 and DPDK 18.08Xavier Simonart1-5/+9
Improve DPDK 18.05 support introduced by 3e532aca. Support for DPDK 18.08. Change-Id: Ide712ee94254b506a0ad88c95a7e01b789f99d48 Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
2018-05-25Increase default mbuf size and code simplification/cleanupXavier Simonart1-12/+10
mbuf size was setup to achieve the best performance i.e. using the smallest mbuf and not segmenting packets. However this resulted in complex code, much dependent of the way the pmd are working e.g. a change(fix) in recent dpdk i40e implementation caused a 1782 (=1518+8+256) bytes mbuf to be too small to hold a 1518 bytes packets. Hence this change simplifies the mbuf size selection at the price of a potential decreases in performance - as more memory is now used. Except if jumbo frames are used, the mbuf size will now be the same for all modes. The packets will not be segmented except if jumbo frames are enabled. If jumbo frames are enabled, packets are by default segmented, except if the mbuf size is configured big enough in the config file. Change-Id: I222fcac7a65c0d221d5d422f419deb9c0f864172 Signed-off-by: Xavier Simonart <xavier.simonart@intel.com> Signed-off-by: Deepak S <deepak.s@linux.intel.com>
2018-05-15fix code standard in VNFs/DPPD-PROX/handle_esp.cIgor Shaula1-447/+443
Change-Id: I6c1a8f6d8e3bc84f7eb8e5780cde98dd9c03c805 Signed-off-by: Igor Shaula <igor.shaula@intel.com>
2018-04-24Support for dpdk-stable-17.11.1 cryptoIgor Shaula1-310/+312
Change-Id: I1a4aee3d550d007046be9d1677dd0ad980cb9817 Signed-off-by: Igor Shaula <igor.shaula@intel.com>
2018-04-16Support async operation in handle_espXavier Simonart1-35/+102
Change-Id: Ibee77e31c0eb7a0e14e7aa0df092a278dfe75d6b Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
2018-03-30Add support for crypto on multiple coresIgor Shaula1-17/+95
* Experimental, for dpdk-stable-17.05.2 * New improved ESP decapsulation function Change-Id: If4862dacb3fcf53e21eb5932a195664f80c7c192 Signed-off-by: Igor Shaula <igor.shaula@intel.com>
2017-12-20Initialize fields of outer IP headerXavier Simonart1-5/+4
As it was non being initialized, fragment offset was sometimes non null. prox_ip_cksum_sw (as well as prox_ip_cksum_hw) require the hdr_checksum field to be initialized to 0. Change-Id: I3824682023782edb555982e558e5ae68062c3c9b Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
2017-11-22correct prox ipsec vnfIgor Shaula1-107/+90
reapply the latest changes (47355 and 47521) due to gerrit merge problem * fix crypto init for both encryptor and decryptor * improve performance: preallocate crypto op memory in init * finalize enabling routed ipsec traffic (proper IP/MAC addresses) * correct handling of dropped packets at encryptor * Fix receive packets with size > 1024 bytes Change-Id: I51cccc9bef0b9564ea1a3465ad28fb985eee06d1 Signed-off-by: Igor Shaula <igor.shaula@intel.com>
2017-11-17* fix encryption: ESP packet formatIgor Shaula1-45/+129
* fix traffic routing * enqueue packets in a bulk (improve crypto performance: TBD) * improve code clarity * fix crypto dequeuing * complete decryption path implementation * NOTE: the code works in a chain mode; crypto init to be fixed next Change-Id: I058a906f4f4f5691ebf25d2cdf5b5faded88e11d Signed-off-by: Igor Shaula <igor.shaula@intel.com>
2017-10-27Rework handle_esp.c (proto, DPDK<17.08, cleanup)Patrice Buriez1-73/+32
- Adjust handle functions to PROX-v035+ prototype, returning 0 when all packets have been handled. - Because cryptodev API was modified in DPDK 17.08, many changes would be necessary to support it. For the moment, just exclude handle_esp.c from PROX build when using DPDK 17.08+, which will be supported later. - Cleanup: - consistent use of PROX_PANIC to cleanly fail on errors - consistent use of OUT_DISCARD to drop unhandled packets - remove "__attribute__((unused))" when parameter is actually used - remove unused defines, fields and variables Change-Id: I10d84fa184a866b4a5f87272875612aace5dd5b1 Signed-off-by: Patrice Buriez <patrice.buriez@intel.com>
2017-10-18Added IPSec/ESP performance demo building block to DPPD-PROXAlexander Komarov1-0/+551
Change-Id: I25ab50297cd7d2f80a5206ddc3c55ffad36bd8d8 Signed-off-by: Alexander Komarov <alexander.komarov@intel.com> Signed-off-by: Alexander Komarov <izard.ak@gmail.com>