git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cryptodev: fix session init return value
[dpdk.git]
/
drivers
/
crypto
/
scheduler
/
scheduler_pmd_ops.c
diff --git
a/drivers/crypto/scheduler/scheduler_pmd_ops.c
b/drivers/crypto/scheduler/scheduler_pmd_ops.c
index
c450f6a
..
d379534
100644
(file)
--- a/
drivers/crypto/scheduler/scheduler_pmd_ops.c
+++ b/
drivers/crypto/scheduler/scheduler_pmd_ops.c
@@
-101,8
+101,7
@@
scheduler_pmd_config(struct rte_cryptodev *dev,
for (i = 0; i < sched_ctx->nb_slaves; i++) {
uint8_t slave_dev_id = sched_ctx->slaves[i].dev_id;
for (i = 0; i < sched_ctx->nb_slaves; i++) {
uint8_t slave_dev_id = sched_ctx->slaves[i].dev_id;
- ret = rte_cryptodev_configure(slave_dev_id, config,
- dev->data->session_pool);
+ ret = rte_cryptodev_configure(slave_dev_id, config);
if (ret < 0)
break;
}
if (ret < 0)
break;
}
@@
-400,7
+399,8
@@
scheduler_pmd_qp_release(struct rte_cryptodev *dev, uint16_t qp_id)
/** Setup a queue pair */
static int
scheduler_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
/** Setup a queue pair */
static int
scheduler_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
- const struct rte_cryptodev_qp_conf *qp_conf, int socket_id)
+ const struct rte_cryptodev_qp_conf *qp_conf, int socket_id,
+ struct rte_mempool *session_pool)
{
struct scheduler_ctx *sched_ctx = dev->data->dev_private;
struct scheduler_qp_ctx *qp_ctx;
{
struct scheduler_ctx *sched_ctx = dev->data->dev_private;
struct scheduler_qp_ctx *qp_ctx;
@@
-422,8
+422,13
@@
scheduler_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
for (i = 0; i < sched_ctx->nb_slaves; i++) {
uint8_t slave_id = sched_ctx->slaves[i].dev_id;
for (i = 0; i < sched_ctx->nb_slaves; i++) {
uint8_t slave_id = sched_ctx->slaves[i].dev_id;
+ /*
+ * All slaves will share the same session mempool
+ * for session-less operations, so the objects
+ * must be big enough for all the drivers used.
+ */
ret = rte_cryptodev_queue_pair_setup(slave_id, qp_id,
ret = rte_cryptodev_queue_pair_setup(slave_id, qp_id,
- qp_conf, socket_id);
+ qp_conf, socket_id
, session_pool
);
if (ret < 0)
return ret;
}
if (ret < 0)
return ret;
}
@@
-510,14
+515,16
@@
scheduler_pmd_session_configure(struct rte_cryptodev *dev,
{
struct scheduler_ctx *sched_ctx = dev->data->dev_private;
uint32_t i;
{
struct scheduler_ctx *sched_ctx = dev->data->dev_private;
uint32_t i;
+ int ret;
for (i = 0; i < sched_ctx->nb_slaves; i++) {
struct scheduler_slave *slave = &sched_ctx->slaves[i];
for (i = 0; i < sched_ctx->nb_slaves; i++) {
struct scheduler_slave *slave = &sched_ctx->slaves[i];
- if (rte_cryptodev_sym_session_init(slave->dev_id, sess,
- xform, mempool) < 0) {
+ ret = rte_cryptodev_sym_session_init(slave->dev_id, sess,
+ xform, mempool);
+ if (ret < 0) {
CS_LOG_ERR("unabled to config sym session");
CS_LOG_ERR("unabled to config sym session");
- return
-1
;
+ return
ret
;
}
}
}
}