X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fcrypto%2Farmv8%2Frte_armv8_pmd_ops.c;h=00297bebb1545beef7e5c27e6ffd351ae1335d62;hb=815c7deaed2d9e325968e82cb599984088a5c55a;hp=e14b68c955509f73da7213a2d999474ff3b875ce;hpb=b3bbd9e5f265937164ed8c9c61d12f7543a745ea;p=dpdk.git diff --git a/drivers/crypto/armv8/rte_armv8_pmd_ops.c b/drivers/crypto/armv8/rte_armv8_pmd_ops.c index e14b68c955..00297bebb1 100644 --- a/drivers/crypto/armv8/rte_armv8_pmd_ops.c +++ b/drivers/crypto/armv8/rte_armv8_pmd_ops.c @@ -1,7 +1,7 @@ /* * BSD LICENSE * - * Copyright (C) Cavium networks Ltd. 2017. + * Copyright (C) Cavium, Inc. 2017. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -13,7 +13,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * * Neither the name of Cavium networks nor the names of its + * * Neither the name of Cavium, Inc nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -50,16 +50,15 @@ static const struct rte_cryptodev_capabilities .algo = RTE_CRYPTO_AUTH_SHA1_HMAC, .block_size = 64, .key_size = { - .min = 16, - .max = 128, - .increment = 0 + .min = 1, + .max = 64, + .increment = 1 }, .digest_size = { .min = 20, .max = 20, .increment = 0 }, - .aad_size = { 0 }, .iv_size = { 0 } }, } }, } @@ -72,16 +71,15 @@ static const struct rte_cryptodev_capabilities .algo = RTE_CRYPTO_AUTH_SHA256_HMAC, .block_size = 64, .key_size = { - .min = 16, - .max = 128, - .increment = 0 + .min = 1, + .max = 64, + .increment = 1 }, .digest_size = { .min = 32, .max = 32, .increment = 0 }, - .aad_size = { 0 }, .iv_size = { 0 } }, } }, } @@ -249,7 +247,7 @@ armv8_crypto_pmd_qp_create_processed_ops_ring(struct armv8_crypto_qp *qp, static int armv8_crypto_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id, const struct rte_cryptodev_qp_conf *qp_conf, - int socket_id) + int socket_id, struct rte_mempool *session_pool) { struct armv8_crypto_qp *qp = NULL; @@ -274,7 +272,7 @@ armv8_crypto_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id, if (qp->processed_ops == NULL) goto qp_setup_cleanup; - qp->sess_mp = dev->data->session_pool; + qp->sess_mp = session_pool; memset(&qp->stats, 0, sizeof(qp->stats)); @@ -325,24 +323,26 @@ armv8_crypto_pmd_session_configure(struct rte_cryptodev *dev, struct rte_mempool *mempool) { void *sess_private_data; + int ret; if (unlikely(sess == NULL)) { ARMV8_CRYPTO_LOG_ERR("invalid session struct"); - return -1; + return -EINVAL; } if (rte_mempool_get(mempool, &sess_private_data)) { CDEV_LOG_ERR( "Couldn't get object from session mempool"); - return -1; + return -ENOMEM; } - if (armv8_crypto_set_session_parameters(sess_private_data, xform) != 0) { + ret = armv8_crypto_set_session_parameters(sess_private_data, xform); + if (ret != 0) { ARMV8_CRYPTO_LOG_ERR("failed configure session parameters"); /* Return session to mempool */ rte_mempool_put(mempool, sess_private_data); - return -1; + return ret; } set_session_private_data(sess, dev->driver_id,