FreeBSD kernel CXGBE device code
|
#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/bus.h>
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/module.h>
#include <sys/sglist.h>
#include <opencrypto/cryptodev.h>
#include <opencrypto/xform.h>
#include "cryptodev_if.h"
#include "common/common.h"
#include "crypto/t4_crypto.h"
Go to the source code of this file.
Data Structures | |
struct | ccr_session_hmac |
struct | ccr_session_gmac |
struct | ccr_session_ccm_mac |
struct | ccr_session_cipher |
struct | ccr_port |
struct | ccr_session |
struct | ccr_softc |
Macros | |
#define | MAX_AAD_LEN 511 |
#define | MAX_RX_PHYS_DSGL_SGE 32 |
#define | DSGL_SGE_MAXLEN 2048 |
#define | MAX_REQUEST_SIZE 65535 |
Functions | |
__FBSDID ("$FreeBSD$") | |
static | MALLOC_DEFINE (M_CCR, "ccr", "Chelsio T6 crypto") |
static int | ccr_populate_sglist (struct sglist *sg, struct crypto_buffer *cb) |
static int | ccr_count_sgl (struct sglist *sg, int maxsegsize) |
static int | ccr_phys_dsgl_len (int nsegs) |
static void | ccr_write_phys_dsgl (struct ccr_session *s, void *dst, int nsegs) |
static int | ccr_ulptx_sgl_len (int nsegs) |
static void | ccr_write_ulptx_sgl (struct ccr_session *s, void *dst, int nsegs) |
static bool | ccr_use_imm_data (u_int transhdr_len, u_int input_len) |
static void | ccr_populate_wreq (struct ccr_softc *sc, struct ccr_session *s, struct chcr_wr *crwr, u_int kctx_len, u_int wr_len, u_int imm_len, u_int sgl_len, u_int hash_size, struct cryptop *crp) |
static int | ccr_hash (struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) |
static int | ccr_hash_done (struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp, const struct cpl_fw6_pld *cpl, int error) |
static int | ccr_cipher (struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) |
static int | ccr_cipher_done (struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp, const struct cpl_fw6_pld *cpl, int error) |
static int | ccr_hmac_ctrl (unsigned int hashsize, unsigned int authsize) |
static int | ccr_eta (struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) |
static int | ccr_eta_done (struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp, const struct cpl_fw6_pld *cpl, int error) |
static int | ccr_gcm (struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) |
static int | ccr_gcm_done (struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp, const struct cpl_fw6_pld *cpl, int error) |
static int | ccr_ccm_hmac_ctrl (unsigned int authsize) |
static void | generate_ccm_b0 (struct cryptop *crp, u_int hash_size_in_response, const char *iv, char *b0) |
static int | ccr_ccm (struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) |
static int | ccr_ccm_done (struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp, const struct cpl_fw6_pld *cpl, int error) |
static int | ccr_soft_done (struct cryptop *crp) |
static void | ccr_soft (struct ccr_session *s, struct cryptop *crp) |
static void | ccr_identify (driver_t *driver, device_t parent) |
static int | ccr_probe (device_t dev) |
static void | ccr_sysctls (struct ccr_softc *sc) |
static void | ccr_init_port (struct ccr_softc *sc, int port) |
static int | ccr_attach (device_t dev) |
static void | ccr_free_port (struct ccr_softc *sc, int port) |
static int | ccr_detach (device_t dev) |
static void | ccr_init_hash_digest (struct ccr_session *s) |
static bool | ccr_aes_check_keylen (int alg, int klen) |
static void | ccr_aes_setkey (struct ccr_session *s, const void *key, int klen) |
static bool | ccr_auth_supported (const struct crypto_session_params *csp) |
static bool | ccr_cipher_supported (const struct crypto_session_params *csp) |
static int | ccr_cipher_mode (const struct crypto_session_params *csp) |
static int | ccr_probesession (device_t dev, const struct crypto_session_params *csp) |
static struct ccr_port * | ccr_choose_port (struct ccr_softc *sc) |
static void | ccr_delete_session (struct ccr_session *s) |
static int | ccr_newsession (device_t dev, crypto_session_t cses, const struct crypto_session_params *csp) |
static void | ccr_freesession (device_t dev, crypto_session_t cses) |
static int | ccr_process (device_t dev, struct cryptop *crp, int hint) |
static int | do_cpl6_fw_pld (struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) |
static int | ccr_modevent (module_t mod, int cmd, void *arg) |
DRIVER_MODULE (ccr, t6nex, ccr_driver, ccr_devclass, ccr_modevent, NULL) | |
MODULE_VERSION (ccr, 1) | |
MODULE_DEPEND (ccr, crypto, 1, 1, 1) | |
MODULE_DEPEND (ccr, t6nex, 1, 1, 1) | |
Variables | |
static device_method_t | ccr_methods [] |
static driver_t | ccr_driver |
static devclass_t | ccr_devclass |
#define DSGL_SGE_MAXLEN 2048 |
Definition at line 131 of file t4_crypto.c.
#define MAX_AAD_LEN 511 |
Definition at line 122 of file t4_crypto.c.
#define MAX_REQUEST_SIZE 65535 |
Definition at line 138 of file t4_crypto.c.
#define MAX_RX_PHYS_DSGL_SGE 32 |
Definition at line 130 of file t4_crypto.c.
__FBSDID | ( | "$FreeBSD$" | ) |
|
static |
Definition at line 2062 of file t4_crypto.c.
Referenced by ccr_cipher_supported().
|
static |
Definition at line 2084 of file t4_crypto.c.
References CHCR_KEYCTX_CIPHER_KEY_SIZE_128, CHCR_KEYCTX_CIPHER_KEY_SIZE_192, CHCR_KEYCTX_CIPHER_KEY_SIZE_256, CHCR_KEYCTX_MAC_KEY_SIZE_128, CHCR_KEYCTX_MAC_KEY_SIZE_192, CHCR_KEYCTX_MAC_KEY_SIZE_256, CHCR_KEYCTX_NO_KEY, ccr_session::cipher, ccr_session_cipher::cipher_mode, ccr_session_cipher::deckey, ccr_session_cipher::enckey, ccr_session::hmac, ccr_session_cipher::key_ctx_hdr, ccr_session_cipher::key_len, ccr_session_hmac::mk_size, ccr_session::mode, ccr_session_hmac::partial_digest_len, SCMD_CIPH_MODE_AES_CBC, SCMD_CIPH_MODE_AES_XTS, t4_aes_getdeckey(), V_KEY_CONTEXT_CK_SIZE, V_KEY_CONTEXT_CTX_LEN, V_KEY_CONTEXT_DUAL_CK, V_KEY_CONTEXT_MK_SIZE, V_KEY_CONTEXT_OPAD_PRESENT, V_KEY_CONTEXT_SALT_PRESENT, and V_KEY_CONTEXT_VALID.
Referenced by ccr_newsession(), and ccr_process().
|
static |
Definition at line 1947 of file t4_crypto.c.
References sge_iq::abs_id, ccr_softc::adapter, ccr_init_port(), adapter::ccr_softc, ccr_sysctls(), ccr_softc::cid, ccr_softc::ctx, ccr_softc::dev, ccr_softc::first_rxq_id, for_each_port, sge_rxq::iq, ccr_softc::iv_aad_buf, ccr_softc::lock, MAX_AAD_LEN, sge::rxq, ccr_softc::sg_iv_aad, adapter::sge, ccr_softc::stats_ccm_decrypt, ccr_softc::stats_ccm_encrypt, ccr_softc::stats_cipher_decrypt, ccr_softc::stats_cipher_encrypt, ccr_softc::stats_eta_decrypt, ccr_softc::stats_eta_encrypt, ccr_softc::stats_gcm_decrypt, ccr_softc::stats_gcm_encrypt, ccr_softc::stats_hash, ccr_softc::stats_hmac, ccr_softc::stats_inflight, ccr_softc::stats_mac_error, ccr_softc::stats_pad_error, ccr_softc::stats_process_error, ccr_softc::stats_sglist_error, ccr_softc::stats_sw_fallback, and ccr_softc::stats_wr_nomem.
|
static |
Definition at line 2161 of file t4_crypto.c.
Referenced by ccr_probesession().
|
static |
Definition at line 1447 of file t4_crypto.c.
References cpl_tx_sec_pdu::aadstart_cipherstop_hi, ccr_softc::adapter, alloc_wrqe(), CCM_AAD_FIELD_SIZE, CCM_B0_SIZE, ccr_session::ccm_mac, ccr_ccm_hmac_ctrl(), ccr_count_sgl(), ccr_phys_dsgl_len(), ccr_populate_wreq(), ccr_ulptx_sgl_len(), ccr_use_imm_data(), ccr_write_phys_dsgl(), ccr_write_ulptx_sgl(), CHCR_DECRYPT_OP, CHCR_ENCRYPT_OP, CHCR_MAX_CRYPTO_IV_LEN, ccr_session::cipher, CIPHER_TRANSHDR_SIZE, cpl_tx_sec_pdu::cipherstop_lo_authinsert, ulptx_idata::cmd_more, CPL_TX_SEC_PDU, _key_ctx::ctx_hdr, DSGL_SGE_MAXLEN, ccr_session_cipher::enckey, generate_ccm_b0(), ccr_session_ccm_mac::hash_len, cpl_tx_sec_pdu::ivgen_hdrlen, _key_ctx::key, chcr_wr::key_ctx, ccr_session_cipher::key_ctx_hdr, ccr_session_cipher::key_len, ulptx_idata::len, MAX_AAD_LEN, MAX_REQUEST_SIZE, MAX_RX_PHYS_DSGL_SGE, cpl_tx_sec_pdu::op_ivinsrtofst, cpl_tx_sec_pdu::pldlen, ccr_session::port, ccr_port::rx_channel_id, SCMD_AUTH_MODE_CBCMAC, SCMD_CIPH_MODE_AES_CCM, SCMD_PROTO_VERSION_GENERIC, chcr_wr::sec_cpl, cpl_tx_sec_pdu::seqno_numivs, ccr_session::sg_dsgl, ccr_session::sg_input, ccr_softc::sg_iv_aad, ccr_session::sg_output, ccr_session::sg_ulptx, SGE_MAX_WR_LEN, ccr_softc::stats_wr_nomem, t4_wrq_tx(), ccr_port::txq, ULP_TX_SC_NOOP, V_CPL_TX_SEC_PDU_AADSTART, V_CPL_TX_SEC_PDU_AADSTOP, V_CPL_TX_SEC_PDU_ACKFOLLOWS, V_CPL_TX_SEC_PDU_AUTHINSERT, V_CPL_TX_SEC_PDU_AUTHSTART, V_CPL_TX_SEC_PDU_AUTHSTOP, V_CPL_TX_SEC_PDU_CIPHERSTART, V_CPL_TX_SEC_PDU_CIPHERSTOP_HI, V_CPL_TX_SEC_PDU_CIPHERSTOP_LO, V_CPL_TX_SEC_PDU_CPLLEN, V_CPL_TX_SEC_PDU_IVINSRTOFST, V_CPL_TX_SEC_PDU_OPCODE, V_CPL_TX_SEC_PDU_PLACEHOLDER, V_CPL_TX_SEC_PDU_RXCHID, V_CPL_TX_SEC_PDU_ULPTXLPBK, V_SCMD_AADIVDROP, V_SCMD_AUTH_MODE, V_SCMD_CIPH_AUTH_SEQ_CTRL, V_SCMD_CIPH_MODE, V_SCMD_ENC_DEC_CTRL, V_SCMD_HDR_LEN, V_SCMD_HMAC_CTRL, V_SCMD_IV_GEN_CTRL, V_SCMD_IV_SIZE, V_SCMD_LAST_FRAG, V_SCMD_MAC_ONLY, V_SCMD_MORE_FRAGS, V_SCMD_NUM_IVS, V_SCMD_PROTO_VERSION, V_SCMD_SEQ_NO_CTRL, V_ULPTX_CMD, wrqe::wr_len, and wrtod().
Referenced by ccr_process().
|
static |
Definition at line 1744 of file t4_crypto.c.
Referenced by do_cpl6_fw_pld().
|
static |
Definition at line 1392 of file t4_crypto.c.
References SCMD_HMAC_CTRL_DIV2, SCMD_HMAC_CTRL_IPSEC_96BIT, SCMD_HMAC_CTRL_NO_TRUNC, SCMD_HMAC_CTRL_PL1, SCMD_HMAC_CTRL_PL2, SCMD_HMAC_CTRL_PL3, and SCMD_HMAC_CTRL_TRUNC_RFC4366.
Referenced by ccr_ccm().
Definition at line 2273 of file t4_crypto.c.
References ccr_port::active_sessions, sge_iq::adapter, sge_wrq::adapter, sge_rxq::iq, ccr_softc::lock, ccr_softc::port_mask, ccr_softc::ports, ccr_port::rxq, and ccr_port::txq.
Referenced by ccr_newsession().
|
static |
Definition at line 622 of file t4_crypto.c.
References cpl_tx_sec_pdu::aadstart_cipherstop_hi, ccr_softc::adapter, alloc_wrqe(), ccr_count_sgl(), ccr_phys_dsgl_len(), ccr_populate_wreq(), ccr_ulptx_sgl_len(), ccr_use_imm_data(), ccr_write_phys_dsgl(), ccr_write_ulptx_sgl(), CHCR_DECRYPT_OP, CHCR_ENCRYPT_OP, CHCR_MAX_CRYPTO_IV_LEN, ccr_session::cipher, ccr_session_cipher::cipher_mode, CIPHER_TRANSHDR_SIZE, cpl_tx_sec_pdu::cipherstop_lo_authinsert, CPL_TX_SEC_PDU, _key_ctx::ctx_hdr, ccr_session_cipher::deckey, DSGL_SGE_MAXLEN, ccr_session_cipher::enckey, ccr_session_cipher::iv_len, cpl_tx_sec_pdu::ivgen_hdrlen, _key_ctx::key, chcr_wr::key_ctx, ccr_session_cipher::key_ctx_hdr, ccr_session_cipher::key_len, MAX_REQUEST_SIZE, MAX_RX_PHYS_DSGL_SGE, cpl_tx_sec_pdu::op_ivinsrtofst, cpl_tx_sec_pdu::pldlen, ccr_session::port, ccr_port::rx_channel_id, SCMD_AUTH_MODE_NOP, SCMD_CIPH_MODE_AES_CBC, SCMD_CIPH_MODE_AES_CTR, SCMD_CIPH_MODE_AES_XTS, SCMD_HMAC_CTRL_NOP, SCMD_PROTO_VERSION_GENERIC, chcr_wr::sec_cpl, cpl_tx_sec_pdu::seqno_numivs, ccr_session::sg_dsgl, ccr_session::sg_input, ccr_session::sg_output, ccr_session::sg_ulptx, SGE_MAX_WR_LEN, ccr_softc::stats_wr_nomem, t4_wrq_tx(), ccr_port::txq, V_CPL_TX_SEC_PDU_ACKFOLLOWS, V_CPL_TX_SEC_PDU_CIPHERSTART, V_CPL_TX_SEC_PDU_CIPHERSTOP_HI, V_CPL_TX_SEC_PDU_CIPHERSTOP_LO, V_CPL_TX_SEC_PDU_CPLLEN, V_CPL_TX_SEC_PDU_IVINSRTOFST, V_CPL_TX_SEC_PDU_OPCODE, V_CPL_TX_SEC_PDU_PLACEHOLDER, V_CPL_TX_SEC_PDU_RXCHID, V_CPL_TX_SEC_PDU_ULPTXLPBK, V_SCMD_AADIVDROP, V_SCMD_AUTH_MODE, V_SCMD_CIPH_MODE, V_SCMD_ENC_DEC_CTRL, V_SCMD_HDR_LEN, V_SCMD_HMAC_CTRL, V_SCMD_IV_GEN_CTRL, V_SCMD_IV_SIZE, V_SCMD_LAST_FRAG, V_SCMD_MAC_ONLY, V_SCMD_MORE_FRAGS, V_SCMD_NUM_IVS, V_SCMD_PROTO_VERSION, V_SCMD_SEQ_NO_CTRL, wrqe::wr_len, and wrtod().
Referenced by ccr_process().
|
static |
Definition at line 784 of file t4_crypto.c.
Referenced by do_cpl6_fw_pld().
|
static |
Definition at line 2207 of file t4_crypto.c.
References SCMD_CIPH_MODE_AES_CBC, SCMD_CIPH_MODE_AES_CCM, SCMD_CIPH_MODE_AES_CTR, SCMD_CIPH_MODE_AES_GCM, SCMD_CIPH_MODE_AES_XTS, and SCMD_CIPH_MODE_NOP.
Referenced by ccr_newsession(), and ccr_probesession().
|
static |
Definition at line 2183 of file t4_crypto.c.
References ccr_aes_check_keylen().
Referenced by ccr_probesession().
|
static |
Definition at line 311 of file t4_crypto.c.
Referenced by ccr_ccm(), ccr_cipher(), ccr_eta(), and ccr_gcm().
|
static |
Definition at line 2307 of file t4_crypto.c.
References ccr_session::lock, ccr_session::sg_dsgl, ccr_session::sg_input, ccr_session::sg_output, ccr_session::sg_ulptx, and ccr_session::sw_session.
Referenced by ccr_freesession(), and ccr_newsession().
|
static |
Definition at line 2009 of file t4_crypto.c.
References ccr_softc::adapter, ccr_free_port(), adapter::ccr_softc, ccr_softc::cid, ccr_softc::ctx, ccr_softc::detaching, ccr_softc::dev, for_each_port, ccr_softc::iv_aad_buf, ccr_softc::lock, ccr_softc::sg_iv_aad, ccr_softc::stats_ccm_decrypt, ccr_softc::stats_ccm_encrypt, ccr_softc::stats_cipher_decrypt, ccr_softc::stats_cipher_encrypt, ccr_softc::stats_eta_decrypt, ccr_softc::stats_eta_encrypt, ccr_softc::stats_gcm_decrypt, ccr_softc::stats_gcm_encrypt, ccr_softc::stats_hash, ccr_softc::stats_hmac, ccr_softc::stats_inflight, ccr_softc::stats_mac_error, ccr_softc::stats_pad_error, ccr_softc::stats_process_error, ccr_softc::stats_sglist_error, ccr_softc::stats_sw_fallback, and ccr_softc::stats_wr_nomem.
|
static |
Definition at line 814 of file t4_crypto.c.
References cpl_tx_sec_pdu::aadstart_cipherstop_hi, ccr_softc::adapter, alloc_wrqe(), ccr_session_hmac::auth_hash, ccr_session_hmac::auth_mode, ccr_count_sgl(), ccr_hmac_ctrl(), ccr_phys_dsgl_len(), ccr_populate_wreq(), ccr_ulptx_sgl_len(), ccr_use_imm_data(), ccr_write_phys_dsgl(), ccr_write_ulptx_sgl(), CHCR_DECRYPT_OP, CHCR_ENCRYPT_OP, CHCR_MAX_CRYPTO_IV_LEN, ccr_session::cipher, ccr_session_cipher::cipher_mode, CIPHER_TRANSHDR_SIZE, cpl_tx_sec_pdu::cipherstop_lo_authinsert, CPL_TX_SEC_PDU, _key_ctx::ctx_hdr, ccr_session_cipher::deckey, DSGL_SGE_MAXLEN, ccr_session_cipher::enckey, ccr_session_hmac::hash_len, ccr_session::hmac, ccr_session_cipher::iv_len, cpl_tx_sec_pdu::ivgen_hdrlen, _key_ctx::key, chcr_wr::key_ctx, ccr_session_cipher::key_ctx_hdr, ccr_session_cipher::key_len, MAX_AAD_LEN, MAX_REQUEST_SIZE, MAX_RX_PHYS_DSGL_SGE, cpl_tx_sec_pdu::op_ivinsrtofst, ccr_session_hmac::pads, ccr_session_hmac::partial_digest_len, cpl_tx_sec_pdu::pldlen, ccr_session::port, ccr_port::rx_channel_id, SCMD_CIPH_MODE_AES_CBC, SCMD_CIPH_MODE_AES_CTR, SCMD_CIPH_MODE_AES_XTS, SCMD_PROTO_VERSION_GENERIC, chcr_wr::sec_cpl, cpl_tx_sec_pdu::seqno_numivs, ccr_session::sg_dsgl, ccr_session::sg_input, ccr_softc::sg_iv_aad, ccr_session::sg_output, ccr_session::sg_ulptx, SGE_MAX_WR_LEN, ccr_softc::stats_wr_nomem, t4_wrq_tx(), ccr_port::txq, V_CPL_TX_SEC_PDU_AADSTART, V_CPL_TX_SEC_PDU_AADSTOP, V_CPL_TX_SEC_PDU_ACKFOLLOWS, V_CPL_TX_SEC_PDU_AUTHINSERT, V_CPL_TX_SEC_PDU_AUTHSTART, V_CPL_TX_SEC_PDU_AUTHSTOP, V_CPL_TX_SEC_PDU_CIPHERSTART, V_CPL_TX_SEC_PDU_CIPHERSTOP_HI, V_CPL_TX_SEC_PDU_CIPHERSTOP_LO, V_CPL_TX_SEC_PDU_CPLLEN, V_CPL_TX_SEC_PDU_IVINSRTOFST, V_CPL_TX_SEC_PDU_OPCODE, V_CPL_TX_SEC_PDU_PLACEHOLDER, V_CPL_TX_SEC_PDU_RXCHID, V_CPL_TX_SEC_PDU_ULPTXLPBK, V_SCMD_AADIVDROP, V_SCMD_AUTH_MODE, V_SCMD_CIPH_AUTH_SEQ_CTRL, V_SCMD_CIPH_MODE, V_SCMD_ENC_DEC_CTRL, V_SCMD_HDR_LEN, V_SCMD_HMAC_CTRL, V_SCMD_IV_GEN_CTRL, V_SCMD_IV_SIZE, V_SCMD_LAST_FRAG, V_SCMD_MAC_ONLY, V_SCMD_MORE_FRAGS, V_SCMD_NUM_IVS, V_SCMD_PROTO_VERSION, V_SCMD_SEQ_NO_CTRL, and wrtod().
Referenced by ccr_process().
|
static |
Definition at line 1107 of file t4_crypto.c.
Referenced by do_cpl6_fw_pld().
|
static |
Definition at line 2001 of file t4_crypto.c.
References port, ccr_softc::ports, ccr_port::stats_completed, and ccr_port::stats_queued.
Referenced by ccr_detach().
|
static |
Definition at line 2506 of file t4_crypto.c.
References ccr_port::active_sessions, ccr_delete_session(), ccr_softc::lock, and ccr_session::port.
|
static |
Definition at line 1119 of file t4_crypto.c.
References cpl_tx_sec_pdu::aadstart_cipherstop_hi, ccr_softc::adapter, alloc_wrqe(), ccr_count_sgl(), ccr_hmac_ctrl(), ccr_phys_dsgl_len(), ccr_populate_wreq(), ccr_ulptx_sgl_len(), ccr_use_imm_data(), ccr_write_phys_dsgl(), ccr_write_ulptx_sgl(), CHCR_DECRYPT_OP, CHCR_ENCRYPT_OP, CHCR_MAX_CRYPTO_IV_LEN, ccr_session::cipher, CIPHER_TRANSHDR_SIZE, cpl_tx_sec_pdu::cipherstop_lo_authinsert, CPL_TX_SEC_PDU, _key_ctx::ctx_hdr, DSGL_SGE_MAXLEN, ccr_session_cipher::enckey, ccr_session_gmac::ghash_h, ccr_session::gmac, ccr_session_gmac::hash_len, cpl_tx_sec_pdu::ivgen_hdrlen, _key_ctx::key, chcr_wr::key_ctx, ccr_session_cipher::key_ctx_hdr, ccr_session_cipher::key_len, MAX_AAD_LEN, MAX_REQUEST_SIZE, MAX_RX_PHYS_DSGL_SGE, cpl_tx_sec_pdu::op_ivinsrtofst, cpl_tx_sec_pdu::pldlen, ccr_session::port, ccr_port::rx_channel_id, SCMD_AUTH_MODE_GHASH, SCMD_CIPH_MODE_AES_GCM, SCMD_PROTO_VERSION_GENERIC, chcr_wr::sec_cpl, cpl_tx_sec_pdu::seqno_numivs, ccr_session::sg_dsgl, ccr_session::sg_input, ccr_softc::sg_iv_aad, ccr_session::sg_output, ccr_session::sg_ulptx, SGE_MAX_WR_LEN, ccr_softc::stats_wr_nomem, t4_wrq_tx(), ccr_port::txq, V_CPL_TX_SEC_PDU_AADSTART, V_CPL_TX_SEC_PDU_AADSTOP, V_CPL_TX_SEC_PDU_ACKFOLLOWS, V_CPL_TX_SEC_PDU_AUTHINSERT, V_CPL_TX_SEC_PDU_AUTHSTART, V_CPL_TX_SEC_PDU_AUTHSTOP, V_CPL_TX_SEC_PDU_CIPHERSTART, V_CPL_TX_SEC_PDU_CIPHERSTOP_HI, V_CPL_TX_SEC_PDU_CIPHERSTOP_LO, V_CPL_TX_SEC_PDU_CPLLEN, V_CPL_TX_SEC_PDU_IVINSRTOFST, V_CPL_TX_SEC_PDU_OPCODE, V_CPL_TX_SEC_PDU_PLACEHOLDER, V_CPL_TX_SEC_PDU_RXCHID, V_CPL_TX_SEC_PDU_ULPTXLPBK, V_SCMD_AADIVDROP, V_SCMD_AUTH_MODE, V_SCMD_CIPH_AUTH_SEQ_CTRL, V_SCMD_CIPH_MODE, V_SCMD_ENC_DEC_CTRL, V_SCMD_HDR_LEN, V_SCMD_HMAC_CTRL, V_SCMD_IV_GEN_CTRL, V_SCMD_IV_SIZE, V_SCMD_LAST_FRAG, V_SCMD_MAC_ONLY, V_SCMD_MORE_FRAGS, V_SCMD_NUM_IVS, V_SCMD_PROTO_VERSION, V_SCMD_SEQ_NO_CTRL, wrqe::wr_len, and wrtod().
Referenced by ccr_process().
|
static |
Definition at line 1378 of file t4_crypto.c.
Referenced by do_cpl6_fw_pld().
|
static |
Definition at line 478 of file t4_crypto.c.
References ccr_softc::adapter, alloc_wrqe(), ccr_session_hmac::auth_hash, ccr_session_hmac::auth_mode, ccr_populate_wreq(), ccr_ulptx_sgl_len(), ccr_use_imm_data(), ccr_write_ulptx_sgl(), CHCR_KEYCTX_NO_KEY, cpl_tx_sec_pdu::cipherstop_lo_authinsert, CPL_TX_SEC_PDU, _key_ctx::ctx_hdr, DUMMY_BYTES, HASH_TRANSHDR_SIZE, ccr_session::hmac, cpl_tx_sec_pdu::ivgen_hdrlen, _key_ctx::key, chcr_wr::key_ctx, MAX_REQUEST_SIZE, ccr_session_hmac::mk_size, ccr_session::mode, cpl_tx_sec_pdu::op_ivinsrtofst, ccr_session_hmac::pads, ccr_session_hmac::partial_digest_len, cpl_tx_sec_pdu::pldlen, ccr_session::port, ccr_port::rx_channel_id, SCMD_CIPH_MODE_NOP, SCMD_HMAC_CTRL_NO_TRUNC, SCMD_HMAC_CTRL_NOP, SCMD_PROTO_VERSION_GENERIC, chcr_wr::sec_cpl, cpl_tx_sec_pdu::seqno_numivs, ccr_session::sg_input, ccr_session::sg_ulptx, SGE_MAX_WR_LEN, ccr_softc::stats_wr_nomem, t4_wrq_tx(), ccr_port::txq, V_CPL_TX_SEC_PDU_ACKFOLLOWS, V_CPL_TX_SEC_PDU_AUTHSTART, V_CPL_TX_SEC_PDU_AUTHSTOP, V_CPL_TX_SEC_PDU_CPLLEN, V_CPL_TX_SEC_PDU_IVINSRTOFST, V_CPL_TX_SEC_PDU_OPCODE, V_CPL_TX_SEC_PDU_PLACEHOLDER, V_CPL_TX_SEC_PDU_RXCHID, V_CPL_TX_SEC_PDU_ULPTXLPBK, V_KEY_CONTEXT_CK_SIZE, V_KEY_CONTEXT_CTX_LEN, V_KEY_CONTEXT_MK_SIZE, V_KEY_CONTEXT_OPAD_PRESENT, V_KEY_CONTEXT_SALT_PRESENT, V_KEY_CONTEXT_VALID, V_SCMD_AUTH_MODE, V_SCMD_CIPH_MODE, V_SCMD_HMAC_CTRL, V_SCMD_LAST_FRAG, V_SCMD_MAC_ONLY, V_SCMD_MORE_FRAGS, V_SCMD_PROTO_VERSION, V_SCMD_SEQ_NO_CTRL, and wrtod().
Referenced by ccr_process().
|
static |
Definition at line 602 of file t4_crypto.c.
References ccr_session_hmac::hash_len, and ccr_session::hmac.
Referenced by do_cpl6_fw_pld().
|
static |
Definition at line 801 of file t4_crypto.c.
References SCMD_HMAC_CTRL_DIV2, SCMD_HMAC_CTRL_IPSEC_96BIT, SCMD_HMAC_CTRL_NO_TRUNC, and SCMD_HMAC_CTRL_TRUNC_RFC4366.
Referenced by ccr_eta(), and ccr_gcm().
|
static |
Definition at line 1803 of file t4_crypto.c.
References adapter::cryptocaps, and FW_CAPS_CONFIG_CRYPTO_LOOKASIDE.
|
static |
Definition at line 2051 of file t4_crypto.c.
References ccr_session_hmac::auth_hash, ccr_session::hmac, ccr_session_hmac::pads, and t4_copy_partial_hash().
Referenced by ccr_newsession().
|
static |
Definition at line 1922 of file t4_crypto.c.
References ccr_softc::adapter, sge::ctrlq, vi_info::first_rxq, adapter_params::fw_vers, FW_VERSION32, MAX_NPORTS, adapter::params, adapter::port, port, ccr_softc::port_mask, ccr_softc::ports, port_info::rx_c_chan, ccr_port::rx_channel_id, sge::rxq, ccr_port::rxq, adapter::sge, ccr_port::stats_completed, ccr_port::stats_queued, port_info::tx_chan, ccr_port::tx_channel_id, ccr_port::txq, and port_info::vi.
Referenced by ccr_attach().
|
static |
Definition at line 2715 of file t4_crypto.c.
References CPL_FW6_PLD, do_cpl6_fw_pld(), and t4_register_cpl_handler().
|
static |
Definition at line 2318 of file t4_crypto.c.
References ccr_port::active_sessions, ccr_session_hmac::auth_hash, ccr_session_hmac::auth_mode, ccr_session::ccm_mac, ccr_aes_setkey(), ccr_choose_port(), ccr_cipher_mode(), ccr_delete_session(), ccr_init_hash_digest(), CHCR_KEYCTX_MAC_KEY_SIZE_160, CHCR_KEYCTX_MAC_KEY_SIZE_256, CHCR_KEYCTX_MAC_KEY_SIZE_512, ccr_session::cipher, ccr_session_cipher::cipher_mode, ccr_softc::detaching, ccr_session_gmac::ghash_h, ccr_session::gmac, ccr_session_hmac::hash_len, ccr_session_gmac::hash_len, ccr_session_ccm_mac::hash_len, ccr_session::hmac, ccr_session_cipher::iv_len, ccr_session::lock, ccr_softc::lock, MAX_RX_PHYS_DSGL_SGE, ccr_session_hmac::mk_size, ccr_session::mode, ccr_session_hmac::pads, ccr_session_hmac::partial_digest_len, ccr_session::port, SCMD_AUTH_MODE_NOP, SCMD_AUTH_MODE_SHA1, SCMD_AUTH_MODE_SHA224, SCMD_AUTH_MODE_SHA256, SCMD_AUTH_MODE_SHA512_384, SCMD_AUTH_MODE_SHA512_512, SCMD_CIPH_MODE_AES_CCM, SCMD_CIPH_MODE_AES_GCM, SCMD_CIPH_MODE_NOP, ccr_session::sg_dsgl, ccr_session::sg_input, ccr_session::sg_output, ccr_session::sg_ulptx, ccr_session::sw_session, t4_init_gmac_hash(), t4_init_hmac_digest(), and TX_SGL_SEGS.
|
inlinestatic |
Definition at line 323 of file t4_crypto.c.
Referenced by ccr_ccm(), ccr_cipher(), ccr_eta(), and ccr_gcm().
|
static |
Definition at line 278 of file t4_crypto.c.
Referenced by ccr_process().
|
static |
Definition at line 431 of file t4_crypto.c.
References sge_iq::abs_id, ulp_txpkt::cmd_dest, ulptx_idata::cmd_more, fw_crypto_lookaside_wr::cookie, ccr_softc::first_rxq_id, FW_CRYPTO_LOOKASIDE_WR, sge_rxq::iq, IV_NOP, fw_crypto_lookaside_wr::key_addr, ulptx_idata::len, ulp_txpkt::len, fw_crypto_lookaside_wr::len16_pkd, fw_crypto_lookaside_wr::op_to_cctx_size, fw_crypto_lookaside_wr::pld_size_hash_size, ccr_session::port, ccr_port::rx_channel_id, fw_crypto_lookaside_wr::rx_chid_to_rx_q_id, ccr_port::rxq, chcr_wr::sc_imm, fw_crypto_lookaside_wr::session_id, ccr_port::tx_channel_id, ULP_TX_PKT, ULP_TX_SC_IMM, chcr_wr::ulptx, V_FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC, V_FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE, V_FW_CRYPTO_LOOKASIDE_WR_COMPL, V_FW_CRYPTO_LOOKASIDE_WR_FQIDX, V_FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE, V_FW_CRYPTO_LOOKASIDE_WR_IMM_LEN, V_FW_CRYPTO_LOOKASIDE_WR_IV, V_FW_CRYPTO_LOOKASIDE_WR_LCB, V_FW_CRYPTO_LOOKASIDE_WR_LEN16, V_FW_CRYPTO_LOOKASIDE_WR_OPCODE, V_FW_CRYPTO_LOOKASIDE_WR_PHASH, V_FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE, V_FW_CRYPTO_LOOKASIDE_WR_RX_CHID, V_FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID, V_FW_CRYPTO_LOOKASIDE_WR_TX_CH, V_ULP_TX_SC_MORE, V_ULP_TXPKT_CHANNELID, V_ULP_TXPKT_DATAMODIFY, V_ULP_TXPKT_DEST, V_ULP_TXPKT_FID, V_ULP_TXPKT_RO, V_ULPTX_CMD, and chcr_wr::wreq.
Referenced by ccr_ccm(), ccr_cipher(), ccr_eta(), ccr_gcm(), and ccr_hash().
|
static |
Definition at line 1814 of file t4_crypto.c.
References adapter::dev.
|
static |
Definition at line 2227 of file t4_crypto.c.
References ccr_auth_supported(), ccr_cipher_mode(), ccr_cipher_supported(), and SCMD_CIPH_MODE_NOP.
|
static |
Definition at line 2526 of file t4_crypto.c.
References ccr_session_hmac::auth_hash, ccr_session::CCM, ccr_aes_setkey(), ccr_ccm(), ccr_cipher(), ccr_eta(), ccr_gcm(), ccr_hash(), ccr_populate_sglist(), ccr_soft(), ccr_session::CIPHER, ccr_session::ETA, ccr_session::GCM, ccr_session_gmac::ghash_h, ccr_session::gmac, ccr_session::HASH, ccr_session::HMAC, ccr_session::hmac, ccr_session::lock, ccr_session::mode, ccr_session_hmac::pads, ccr_session_hmac::partial_digest_len, ccr_session::port, ccr_session::sg_input, ccr_session::sg_output, ccr_softc::stats_ccm_decrypt, ccr_softc::stats_ccm_encrypt, ccr_softc::stats_cipher_decrypt, ccr_softc::stats_cipher_encrypt, ccr_softc::stats_eta_decrypt, ccr_softc::stats_eta_encrypt, ccr_softc::stats_gcm_decrypt, ccr_softc::stats_gcm_encrypt, ccr_softc::stats_hash, ccr_softc::stats_hmac, ccr_softc::stats_inflight, ccr_softc::stats_process_error, ccr_port::stats_queued, ccr_softc::stats_sglist_error, ccr_softc::stats_sw_fallback, t4_init_gmac_hash(), and t4_init_hmac_digest().
|
static |
Definition at line 1775 of file t4_crypto.c.
References ccr_soft_done(), and ccr_session::sw_session.
Referenced by ccr_process().
|
static |
Definition at line 1763 of file t4_crypto.c.
Referenced by ccr_soft().
|
static |
Definition at line 1822 of file t4_crypto.c.
References ccr_port::active_sessions, ccr_softc::ctx, ccr_softc::dev, ccr_softc::port_mask, ccr_softc::ports, ccr_port::rxq, ccr_softc::stats_ccm_decrypt, ccr_softc::stats_ccm_encrypt, ccr_softc::stats_cipher_decrypt, ccr_softc::stats_cipher_encrypt, ccr_port::stats_completed, ccr_softc::stats_eta_decrypt, ccr_softc::stats_eta_encrypt, ccr_softc::stats_gcm_decrypt, ccr_softc::stats_gcm_encrypt, ccr_softc::stats_hash, ccr_softc::stats_hmac, ccr_softc::stats_inflight, ccr_softc::stats_mac_error, ccr_softc::stats_pad_error, ccr_softc::stats_process_error, ccr_port::stats_queued, ccr_softc::stats_sglist_error, ccr_softc::stats_sw_fallback, and ccr_softc::stats_wr_nomem.
Referenced by ccr_attach().
|
inlinestatic |
Definition at line 385 of file t4_crypto.c.
Referenced by ccr_ccm(), ccr_cipher(), ccr_eta(), ccr_gcm(), and ccr_hash().
|
static |
Definition at line 419 of file t4_crypto.c.
References CRYPTO_MAX_IMM_TX_PKT_LEN, and SGE_MAX_WR_LEN.
Referenced by ccr_ccm(), ccr_cipher(), ccr_eta(), ccr_gcm(), and ccr_hash().
|
static |
Definition at line 336 of file t4_crypto.c.
References sge_iq::abs_id, phys_sge_pairs::addr, rss_header::channel, CPL_RX_PHYS_ADDR, CPL_RX_PHYS_DSGL, DSGL_SGE_MAXLEN, rss_header::hash_val, sge_rxq::iq, phys_sge_pairs::len, cpl_rx_phys_dsgl::op_to_tid, rss_header::opcode, cpl_rx_phys_dsgl::pcirlxorder_to_noofsgentr, ccr_session::port, rss_header::qid, cpl_rx_phys_dsgl::rss_hdr_int, ccr_port::rx_channel_id, ccr_port::rxq, ccr_session::sg_dsgl, V_CPL_RX_PHYS_DSGL_DCAID, V_CPL_RX_PHYS_DSGL_ISRDMA, V_CPL_RX_PHYS_DSGL_NOOFSGENTR, V_CPL_RX_PHYS_DSGL_OPCODE, V_CPL_RX_PHYS_DSGL_PCINOSNOOP, V_CPL_RX_PHYS_DSGL_PCIRLXORDER, and V_CPL_RX_PHYS_DSGL_PCITPHNTENB.
Referenced by ccr_ccm(), ccr_cipher(), ccr_eta(), and ccr_gcm().
|
static |
Definition at line 395 of file t4_crypto.c.
References ulptx_sge_pair::addr, ulptx_sgl::addr0, ulptx_sgl::cmd_nsge, ulptx_sge_pair::len, ulptx_sgl::len0, ccr_session::sg_ulptx, ulptx_sgl::sge, ss, ULP_TX_SC_DSGL, V_ULPTX_CMD, and V_ULPTX_NSGE.
Referenced by ccr_ccm(), ccr_cipher(), ccr_eta(), ccr_gcm(), and ccr_hash().
|
static |
Definition at line 2652 of file t4_crypto.c.
References sge_iq::adapter, ccr_ccm_done(), ccr_cipher_done(), ccr_eta_done(), ccr_gcm_done(), ccr_hash_done(), adapter::ccr_softc, CHK_MAC_ERR_BIT, CHK_PAD_ERR_BIT, cpl_fw6_pld::data, iq, ccr_session::lock, ccr_session::mode, ccr_session::port, ccr_port::stats_completed, ccr_softc::stats_inflight, ccr_softc::stats_mac_error, and ccr_softc::stats_pad_error.
Referenced by ccr_modevent().
DRIVER_MODULE | ( | ccr | , |
t6nex | , | ||
ccr_driver | , | ||
ccr_devclass | , | ||
ccr_modevent | , | ||
NULL | |||
) |
|
static |
Definition at line 1415 of file t4_crypto.c.
References CCM_B0_SIZE.
Referenced by ccr_ccm().
|
static |
MODULE_DEPEND | ( | ccr | , |
crypto | , | ||
1 | , | ||
1 | , | ||
1 | |||
) |
MODULE_DEPEND | ( | ccr | , |
t6nex | , | ||
1 | , | ||
1 | , | ||
1 | |||
) |
MODULE_VERSION | ( | ccr | , |
1 | |||
) |
|
static |
Definition at line 2750 of file t4_crypto.c.
|
static |
Definition at line 2744 of file t4_crypto.c.
|
static |
Definition at line 2730 of file t4_crypto.c.