Licensing Information
Open Source Used In Cisco Nexus 9000 Series 7.0(3)I5(1)
3222
return ENOBUFS;
}
memset(ixpd, 0, ixp_sesnum * sizeof(struct ixp_data *));
/* Copy existing sessions */
if (ixp_sessions) {
memcpy(ixpd, ixp_sessions,
(ixp_sesnum / 2) * sizeof(struct ixp_data *));
kfree(ixp_sessions);
}
ixp_sessions = ixpd;
}
ixp_sessions[i] = (struct ixp_data *) kmalloc(sizeof(struct ixp_data),
SLAB_ATOMIC);
if (ixp_sessions[i] == NULL) {
ixp_freesession(NULL, i);
dprintk("%s,%d: EINVAL\n", __FILE__, __LINE__);
return ENOBUFS;
}
*sid = i;
ixp = ixp_sessions[i];
memset(ixp, 0, sizeof(*ixp));
ixp->ixp_cipher_alg = -1;
ixp->ixp_auth_alg = -1;
ixp->ixp_ctx_id = -1;
INIT_LIST_HEAD(&ixp->ixp_q);
ixp->ixp_ctx.useDifferentSrcAndDestMbufs = 0;
while (cri) {
switch (cri->cri_alg) {
case CRYPTO_DES_CBC:
ixp->ixp_cipher_alg = cri->cri_alg;
ixp->ixp_ctx.cipherCtx.cipherAlgo = IX_CRYPTO_ACC_CIPHER_DES;
ixp->ixp_ctx.cipherCtx.cipherMode = IX_CRYPTO_ACC_MODE_CBC;
ixp->ixp_ctx.cipherCtx.cipherKeyLen = (cri->cri_klen + 7) / 8;
ixp->ixp_ctx.cipherCtx.cipherBlockLen = IX_CRYPTO_ACC_DES_BLOCK_64;
ixp->ixp_ctx.cipherCtx.cipherInitialVectorLen =
IX_CRYPTO_ACC_DES_IV_64;
memcpy(ixp->ixp_ctx.cipherCtx.key.cipherKey,
cri->cri_key, (cri->cri_klen + 7) / 8);
break;










