Intel® Quickassist Technology & Openssl-1.1.0: Performance

Intel® Quickassist Technology & Openssl-1.1.0: Performance

WHITE PAPER Network Security Content Delivery Networks, Web Servers, Load Balancing Intel® QuickAssist Technology & OpenSSL-1.1.0: Performance Authors: Introduction Brian Will – Software Architect Transport Layer Security (TLS) is the backbone protocol for Internet security today; it provides the foundation for expanding security everywhere within Andrea Grandi – Software Engineer the network. Security is an element of networking infrastructure that must not Nicolas Salhuana – Performance be underemphasized, or taken for granted. While critical to the foundation of Analysis Engineer Networking, security’s addition into existing infrastructures generally comes with a trade-off between cost and performance. With the addition of a new class of features added into OpenSSL-1.1.0 we have been able to significantly increase performance for asynchronous processing with Intel® QuickAssist Technology (QAT). This paper explores the design and usage of Contents these features: Introduction ..............................1 • ASYNC_JOB infrastructure Motivation: Design for Performance. .1 • ASYNC event notifications • Pipelining Why Async? ...............................2 • PRF engine support Design. .3 This paper will demonstrate how the combination of these features with Intel® ASYNC_JOB Infrastructure ................3 QuickAssist Technology results in tangible performance gains, as well as how an application can utilize these features at the TLS and EVP level. ASYNC Event Notification ..................3 Additional Performance Optimizations .....4 Motivation: Design for Performance Pipelining .................................4 The asynchronous infrastructure added into OpenSSL-1.1.0 enables cryptographic operations to execute asynchronously with respect to the stack and application. Pseudorandom Function ..................4 Generically, the infrastructure could be applied to any asynchronous operations Intel® QuickAssist Technology Engine ......4 that might occur, but currently only encompasses cryptographic operations executed within the engine framework. Big/Small Request Offload .................5 For the context of this paper, asynchronous operations are defined as those which Performance: Intel® QuickAssist Adapter 8950 occur independently of the main program’s execution. Asynchronous operations Benchmark and Results ....................5 are initiated and consumed (via events/polling) by the main program, but will occur Algorithmic Performance (openssl speed). .5 in parallel to those operations. The following diagrams are an illustration of the shift in execution: Symmetric Algorithm Performance. 6 Application-Level Benchmark (NGINX-1.10 + OpenSSL-1.1.0) ...........................6 Benchmark Topology ......................6 Conclusion ...............................10 Appendix: Platform Details ...............11 References ...............................12 1 White Paper | Intel® QuickAssist Technology & OpenSSL-1.1.0: Performance Synchronous Mode Application 1 1 2 2 3 3 Blocking call Blocking call Blocking call OpenSSL Consume response Consume response Consume response Consume Post request Post request Post request Post QAT_engine 1 Represents the start of the rst operation 1 Represents the end of the rst operation Time Figure 1. Synchronous Execution Synchronous mode of operation forces a single API call to be Intel® QAT provides acceleration of cryptographic and blocking until the completion of the request. When a parallel compression calculations on a separate processing entity, processing entity is part of the flow of execution, there will be processing the requests asynchronously with respect to the times when the CPU is not processing data. In Figures 1 and main program. Having an asynchronous processing model 2, CPU idle times are represented by the dashed lines above, in OpenSSL-1.1.0 allows for more efficient use of those and effectively result in missed opportunities for increased capabilities, as well as increased overall performance. performance. From the application perspective, this results in blocking at the API. When utilizing a separate accelerator Why Async? underneath this API, the application can perform a busy-loop In order to efficiently utilize acceleration capabilities, a while waiting for a response from the accelerator, or context mechanism to allow the application to continue execution switch using execution models similar to pthreads to allow while waiting for the Intel® QAT accelerator to complete other useful work to be accomplished while waiting. However, outstanding operations is required. This programming model both of these solutions are costly. Polling consumes CPU is very similar to nonblocking Berkely Software Distribution cycles and prevents multiple operations to run in parallel, (BSD) sockets; operations are executed outside the context and while threading allows parallelism and more effectively of the main application, allowing the application to make utilizes CPU cycles, most high level context management the best use of available CPU cycles while the accelerator is libraries like pthreads come with a heavy cycle cost to processing operations in parallel. This capability is controlled execute and manage. by the application, which must be updated to support the The asynchronous programming model increases asynchronous behavior, as it has the best knowledge of when performance by making use of these gaps; it also enables to schedule each TLS connection. Figure 2 demonstrates parallel submission, more efficiently using a parallel increased performance as a result of centralizing the processing entity (for example, Intel® QuickAssist scheduling entity in the application. Technology). Asynchronous Mode Application 1 2 3 1 2 3 Nonblocking calls OpenSSL Consume responses Consume Post requests Post QAT_engine 1 Represents the start of the rst operation 1 Represents the end of the rst operation Time Figure 2. Aynchronous execution 2 White Paper | Intel® QuickAssist Technology & OpenSSL-1.1.0: Performance Design nginx libSSL async libcrypto QAT driver The Intel® QuickAssist Technology accelerator is accessed SSL_accept (1st) through a device driver in kernel space and a library in user space. Cryptographic services are provided to OpenSSL ASYNC_start_job through the standard engine framework; this engine [1] swapcontext builds on top of the user space library, interfacing with the Intel® QAT API, which allows it to be used across Intel® RSA_sign QAT generations without modification. This layering and cpaRsaDecrypt integration into the OpenSSL framework allows for seamless (nonblocking) utilization by applications. The addition of asynchronous ASYNC_pause support into OpenSSL-1.1.0 means that the application can also drive higher levels of performance using a standardized API. SSL_ERROR_WANT_ASYNC SSL_get_async_fd Crypto op nginx OpenSSL API event loop event on fd OpenSSL libssl SSL_accept (2nd) ASYNC_start_job swapcontext EVP API OpenSSL libcrypto process results OpenSSL Engine API Figure 4. OpenSSL-1.1.0 ASYNC_JOB processing flow QAT Engine The function call flow in Figure 4 shows one usage scenario from the top level SSL_accept (1st) call. When an application Intel® QuickAssist Technology API identifies a TLS connection as being asynchronous capable, Intel® QuickAssist Technology standard OpenSSL calls will grab an ASYNC_JOB context, User Space Library thereby allowing the underlying layers of the stack to PAUSE execution, in this example in the QAT_engine. This results User Space in the function returning to the application with the error Kernel Space status SSL_ERROR_WANT_ASYNC. The application can then register for a file descriptor (FD) associated with this TLS Intel® QuickAssist connection, and use the standard epoll/select/poll calls to Techhnology Driver wait for availability of a response. Once the application is notified, it can call the associated OpenSSL API, SSL_accept QAT FW Host Interface (2nd) again with that TLS connection, thereby completing the response processing. Alternatively, the application can forego Intel® QuickAssist Technology Device using the FD and event notifications, instead continuously invoking the top level OpenSSL API until a successful Figure 3. Intel® QuickAssist Technology stack diagram response is returned. ASYNC_JOB Infrastructure ASYNC Event Notification The ASYNC_JOB infrastructure is built on a number OpenSSL-1.1.0 includes a notification infrastructure to signal of primitives to allow the creation and management of when to resume the execution of asynchronous crypto lightweight execution contexts. The infrastructure added operations. The notifications from the crypto engine to the to OpenSSL-1.1.0 [2] provides all the necessary functions application are delivered using events on file descriptors that to create and manage ASYNC_JOBs (similar in concept to can be managed using the APIs provided by OpenSSL. This fibers or co-routines) but does not actively manage these provides an abstraction layer that is independent of both the resources; management is left to the user code leveraging application and the particular hardware accelerator being this capability. Logically, the ASYNC_JOB infrastructure is used. The file descriptor is owned by the component which implemented as part of the crypto complex in OpenSSL-1.1.0, originates the event (in this case, the engine implementation). namely libcrypto, and is utilized by the TLS stack. This allows This allows the originator to define how they want to create applications to continue to use the well-known

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    12 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us