Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals  

IXP425 Crypto Access Codelet
[IXP425 Codelets]

(IxCryptoAccCodelet) API IXP425 Crypto Access Codelet API More...

Defines

#define INLINE
#define IX_CRYPTOACC_CODELET_CRYPTOACC_CFG
 Selects the interface's (to the NPE) to be initialized by the codelet. Use one of the values defined in IxCryptoAccCfg. IX_CRYPTO_ACC_CFG_CRYPTO_NPE_ACC_EN : Enable's access to the Crypto NPE.

#define IX_CRYPTOACC_CODELET_NPEC_IMAGE_ID
 The build ID for NPE C image, default is IX_NPEDL_NPEIMAGE_NPEC_CRYPTO_AES_CCM_ETH.

#define IX_CRYPTOACC_CODELET_NPEA_IMAGE_ID
 The build ID for NPE A image, default is IX_NPEDL_NPEIMAGE_NPEA_WEP.

#define PERFORMANCE_WINDOW_SIZE
 Number of crypto packets need to be sent in for performance benchmarking (sampling size), 1 unit represents 1000 of packets.

#define IX_CRYPTOACC_CODELET_CRYPTO_MBUF_POOL_SIZE
 Size of MBuf pool, ie number of buffers to circulate.

#define IX_CRYPTOACC_CODELET_BATCH_LEN
 Number of packets per sampling for performance benchmarking.

#define IX_CRYPTOACC_CODELET_QMR_DISPATCHER_PRIORITY
 Recommended priority of queue manager dispatch loop.

#define IX_CRYPTOACC_CODELET_XSCALE_TICK
 The XScale tick is 66 MHz.

#define IX_CRYPTOACC_CODELET_REGISTER_WAIT_TIME
 The codelet register wait time (in ms) in a for loop.

#define IX_CRYPTOACC_CODELET_PERFORM_WAIT_TIME
 The codelet perform wait time (in ms) in a for loop.

#define IX_CRYPTOACC_CODELET_MAX_TIME_WAIT
 Maximum time (in ms) to wait before exiting the program.

#define IX_CRYPTOACC_CODELET_MIN_CRYPTO_PKT_SIZE
 The minimum packet size.

#define IX_CRYPTOACC_CODELET_MAX_CRYPTO_PKT_SIZE
 The maximum packet size.

#define IX_CRYPTOACC_CODELET_QMGR_DISPATCHER_MODE
 QMgr Dispatcher Mode, whether in interrupt (TRUE) or poll (FALSE) mode.


Functions

IX_STATUS ixCryptoAccCodeletMain (INT32 srvIndex, UINT32 packetLen)
 This is the entry point function to the codelet to choose the service for the codelet and packet length to be used. This is the main function of the codelet where crypto contexts registration and crypto perform services are done. Based on the selected operation and selected packet length, packets are sent to cryptoAcc for processing.


Detailed Description

(IxCryptoAccCodelet) API IXP425 Crypto Access Codelet API

The codelet demonstrates how the Security Hardware Accelerator API can be used for performing various cryptographic operations. For demonstration purposes, various cryptographic operations (called services in this codelet) are preconfigured in an array. The user can specify the particular service to be giving the "service number" from the list available. Various services shown are:

  • Encryption and decryption, using DES ECB
  • Authentication calculation and check, using MD5
  • Combined encryption and decryption, using DES CBC and SHA1
  • CCM for 802.11i
  • ARC4 with WEP CRC computations on XScale
  • ARC4 with WEP CRC computations on NPE.

The codelet shows how to initialize the required components (like Qmgr, NPE's) and the Security Hardware Acclerator. This initialization is done only once for the very first request. The components remain enabled till "codelet stop" is requested. Every invocation of the codelet for a specific service results in the context registration followed by execution of the operation. Once the operation completes, the contexts are un-registered. If the operation completes successfully performance statistics are printed. If there is an error, statistics are not printed and an error message is displayed. The codelet shows the following :

  • The codelet demonstrates how the Network Processor Engine (NPE) is initialised, how the NPE image is downloaded to the NPE, and and how the NPE is started.

  • The codelet demonstrates how the Queue Manager is initialised to polling or interrupt mode.

  • The codelet shows how to set up the callback functions and how to register crypto contexts with cryptoAcc access component.

  • The codelet demonstrates how the registration should be done for the different operations using the register API.

  • The codelet demonstrates how the perform API can be used after successful registration.

  • The codelet demonstrates how to use XScaleWepPerform function and NpeWepPerform function

  • The codelet demonstrates the use of the unregister API in the event of re-starting the above mentioned operation.

  • The codelet measures the performance of the Security Hardware Accelerator for each of the operations listed above.

Configuration parameters for Performance benchmarking are

Default Performance Sampling Size
  • Packets per Sampling : 1,000
  • Number of Samples : 20
  • Total Packets : 20,000

Default mbuf Pool Setting
  • Number of mbufs in pool : 20
  • Min of mbufs needed in pool : 2 (for crypto context registration purpose)

User may choose to run different operation with different packet lengths. The performance rate of selected operation with selected packet length will be displayed after throughput rate has been captured for a predefined performance sampling size.If an error occurs any time in the codelet, the performance numbers will not be displayed and error message will be printed.

Notes for Performance Benchmarking:
  • Packets are generated in XScale with random payload. No explicit verification of payload will be carried out in the codelet.

  • Encrypted packets are sent to NPE again for decryption and same applies to authentication operation. Packet payload is verified implicitly through this feedback system.

  • Throughput rate is captured from the point where packet is sent to NPE for processing to the point where NPE completes the encryption and/or authentication operation and notifies XScale through callback.

  • No external packet generator or benchmarking devices involved in this codelet. Throughput rate is captured using XScale timestamp.

  • Time taken for codelet to complete the operation depends on packet length selected. Larger packet will take more time to complete.

VxWorks User Guide
ixCryptoAccCodeletMain() function is used as the entry point of execution for cryptoAcc Codelet.
It allows user to enter selection for various operations described below with different packet length.

Usage : >ixCryptoAccCodeletMain (serviceIndex, packetLen) Where serviceIndex should be one of the following:

-1 : Stops the codelet. 0 : Lists the set of services demonstrated. 1 : Encryption and Decryption using DES(ECB) cipher algorithm. 2 : HMAC ICV generation and verification during MD5 algorithm. 3 : A combined mode of operation (i.e both encryption followed by authentication) using DES(CBC) and HMAC. 4 : AES-CCM operations for 802.11i . 5 : A combined mode of operation using ARC4 and WEP CRC on XScale. 6 : A combined mode of operation using ARC4 and WEP CRC using WAN-NPE.

Where packetLen: Packet length ranges from 64 bytes to 65456 bytes, if cipher algorithm is DES/3DES, packet length must be multiple of 8-byte (cipher block length); while AES algorithm must have packet length that is multiple of 16-byte in size. For ARC4 algorithm block length there is no such restriction (because block size is 1 byte). If cipher mode is CCM, there is no restriction on the packet length being a multiple of cipher block length.

Linux User Guide
The ixCryptoAccCodeletMain() is the entry point of cryptoAcc codelet.
The selected operation will be executed when user issues 'insmod' at command prompt.

Usage : >insmod ixp400_codelets_cryptoAcc.o serviceIndex= packetLen= Where serviceIndex should be one of the following values:

-1 : Stops the codelet. 0 : Lists all set of services demonstrated. 1 : Encryption and Decryption using DES(ECB) cipher algorithm. 2 : HMAC ICV generation and verification during MD5 algorithm. 3 : A combined mode of operation (i.e both encryption followed by authentication) using DES(CBC) and HMAC. 4 : AES-CCM operations for 802.11i . 5 : A combined mode of operation using ARC4 and WEP CRC on XScale. 6 : A combined mode of operation using ARC4 and WEP CRC using WAN-NPE.

Where y: Packet length ranges from 64 bytes to 65456 bytes, if cipher algorithm is DES/3DES, packet length must be multiple of 8-byte (cipher block length); while AES algorithm must have packet length that is multiple of 16-byte in size. For ARC4 algorithm block length there is no such restriction (because block size is 1 byte). If cipher mode is CCM, there is no restriction on the packet length being a multiple of cipher block length.


Define Documentation

#define IX_CRYPTOACC_CODELET_BATCH_LEN
 

Number of packets per sampling for performance benchmarking.

Definition at line 325 of file IxCryptoAccCodelet.h.

#define IX_CRYPTOACC_CODELET_CRYPTO_MBUF_POOL_SIZE
 

Size of MBuf pool, ie number of buffers to circulate.

Definition at line 310 of file IxCryptoAccCodelet.h.

#define IX_CRYPTOACC_CODELET_CRYPTOACC_CFG
 

Selects the interface's (to the NPE) to be initialized by the codelet. Use one of the values defined in IxCryptoAccCfg. IX_CRYPTO_ACC_CFG_CRYPTO_NPE_ACC_EN : Enable's access to the Crypto NPE.

Definition at line 257 of file IxCryptoAccCodelet.h.

#define IX_CRYPTOACC_CODELET_MAX_CRYPTO_PKT_SIZE
 

The maximum packet size.

Definition at line 395 of file IxCryptoAccCodelet.h.

#define IX_CRYPTOACC_CODELET_MAX_TIME_WAIT
 

Maximum time (in ms) to wait before exiting the program.

Definition at line 375 of file IxCryptoAccCodelet.h.

#define IX_CRYPTOACC_CODELET_MIN_CRYPTO_PKT_SIZE
 

The minimum packet size.

Definition at line 385 of file IxCryptoAccCodelet.h.

#define IX_CRYPTOACC_CODELET_NPEA_IMAGE_ID
 

The build ID for NPE A image, default is IX_NPEDL_NPEIMAGE_NPEA_WEP.

Note:
Please refer to IxNpeDl.h for NPE image definition

Definition at line 284 of file IxCryptoAccCodelet.h.

#define IX_CRYPTOACC_CODELET_NPEC_IMAGE_ID
 

The build ID for NPE C image, default is IX_NPEDL_NPEIMAGE_NPEC_CRYPTO_AES_CCM_ETH.

Note:
Please refer to IxNpeDl.h for NPE image definition

Definition at line 271 of file IxCryptoAccCodelet.h.

#define IX_CRYPTOACC_CODELET_PERFORM_WAIT_TIME
 

The codelet perform wait time (in ms) in a for loop.

Definition at line 365 of file IxCryptoAccCodelet.h.

#define IX_CRYPTOACC_CODELET_QMGR_DISPATCHER_MODE
 

QMgr Dispatcher Mode, whether in interrupt (TRUE) or poll (FALSE) mode.

Note:
1. QMgr dispatcher can be run in both poll mode and interrupt mode in vxWorks platform. When QMgr dispatcher is running in interrupt mode, the display of packet rate for Ethernet software loopback on the windshell is very slow if the crypto packet length chosen is very small. This is due to the time taken by NPE to service crypto packet is very fast and QMgr callbacks with higher priority are triggered frequently and blocked the task of displaying.

2. In linux platform, QMgr Dispatcher is NOT advisible to run in poll mode. This is due to the task scheduling in poll mode is not fair enough between multiple threads that cause the performance rate to drop tremendously. Thus the performance rate displayed in Linux platform using poll mode is not accurate. Performance rate is more accurate when QMgr dispatcher is running in interrupt mode.

Definition at line 423 of file IxCryptoAccCodelet.h.

#define IX_CRYPTOACC_CODELET_QMR_DISPATCHER_PRIORITY
 

Recommended priority of queue manager dispatch loop.

Definition at line 335 of file IxCryptoAccCodelet.h.

#define IX_CRYPTOACC_CODELET_REGISTER_WAIT_TIME
 

The codelet register wait time (in ms) in a for loop.

Definition at line 355 of file IxCryptoAccCodelet.h.

#define IX_CRYPTOACC_CODELET_XSCALE_TICK
 

The XScale tick is 66 MHz.

Definition at line 345 of file IxCryptoAccCodelet.h.

#define PERFORMANCE_WINDOW_SIZE
 

Number of crypto packets need to be sent in for performance benchmarking (sampling size), 1 unit represents 1000 of packets.

Definition at line 300 of file IxCryptoAccCodelet.h.


Function Documentation

ixCryptoAccCodeletMain (  INT32  srvIndex,
UINT32  packetLen
) 
 

This is the entry point function to the codelet to choose the service for the codelet and packet length to be used. This is the main function of the codelet where crypto contexts registration and crypto perform services are done. Based on the selected operation and selected packet length, packets are sent to cryptoAcc for processing.

Parameters:
INT32 [in] serviceIndex - type of service to be invoked choose from one of the following pre-configured values. -1 : Stops the codelet. 0 : Lists all set of services demonstrated. 1 : Encryption and Decryption using DES(ECB) cipher algorithm. 2 : HMAC ICV generation and verification during MD5 algorithm. 3 : A combined mode of operation (i.e both encryption followed by authentication) using DES(CBC) and HMAC. 4 : AES-CCM operations for 802.11i . 5 : A combined mode of operation using ARC4 and WEP CRC on XScale. 6 : A combined mode of operation using ARC4 and WEP CRC using WAN-NPE.
UINT32 [in] packetLen - packet length
Returns:
IX_STATUS
  • IX_SUCCESS - codelet runs successfully
  • IX_FAIL - codelet fails

Automatically generated from sources. © Intel Corp. 2003