app/eventdev: setup crypto adapter before sessions
Setup crypto adapter and add queue pairs before assigning them in session metadata. Session metadata may use queue pair configuration parameters, so queue pair should be added before meta assignment. Signed-off-by: Volodymyr Fialko <vfialko@marvell.com> Acked-by: Anoob Joseph <anoobj@marvell.com>
This commit is contained in:
parent
b33d79af2e
commit
eff29c4537
@ -998,6 +998,10 @@ perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt,
|
||||
RTE_CACHE_LINE_SIZE, opt->socket_id);
|
||||
p->t = t;
|
||||
|
||||
ret = perf_event_crypto_adapter_setup(t, p);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
m_data.request_info.cdev_id = p->ca.cdev_id;
|
||||
m_data.request_info.queue_pair_id = p->ca.cdev_qp_id;
|
||||
m_data.response_info.sched_type = RTE_SCHED_TYPE_ATOMIC;
|
||||
@ -1013,12 +1017,14 @@ perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt,
|
||||
if (sess == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
rte_cryptodev_session_event_mdata_set(
|
||||
ret = rte_cryptodev_session_event_mdata_set(
|
||||
cdev_id,
|
||||
sess,
|
||||
RTE_CRYPTO_OP_TYPE_SYMMETRIC,
|
||||
RTE_CRYPTO_OP_WITH_SESSION,
|
||||
&m_data, sizeof(m_data));
|
||||
if (ret)
|
||||
return ret;
|
||||
p->ca.crypto_sess[flow_id] = sess;
|
||||
} else {
|
||||
void *sess;
|
||||
@ -1026,12 +1032,14 @@ perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt,
|
||||
sess = cryptodev_asym_sess_create(p, t);
|
||||
if (sess == NULL)
|
||||
return -ENOMEM;
|
||||
rte_cryptodev_session_event_mdata_set(
|
||||
ret = rte_cryptodev_session_event_mdata_set(
|
||||
cdev_id,
|
||||
sess,
|
||||
RTE_CRYPTO_OP_TYPE_ASYMMETRIC,
|
||||
RTE_CRYPTO_OP_WITH_SESSION,
|
||||
&m_data, sizeof(m_data));
|
||||
if (ret)
|
||||
return ret;
|
||||
p->ca.crypto_sess[flow_id] = sess;
|
||||
}
|
||||
}
|
||||
@ -1046,10 +1054,6 @@ perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt,
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = perf_event_crypto_adapter_setup(t, p);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
qp_id++;
|
||||
prod++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user