numam-dpdk/app/test-crypto-perf/cperf_ops.h
Akhil Goyal 3f3fc3308b security: remove private mempool usage
As per current design, rte_security_session_create()
unnecessarily use 2 mempool objects for a single session.

To address this, the API will now take only 1 mempool
object instead of 2. With this change, the library layer
will get the object from mempool and session priv data is
stored contiguously in the same mempool object.

User need to ensure that the mempool created in application
is big enough for session private data as well. This can be
ensured if the pool is created after getting size of session
priv data using API rte_security_session_get_size().

Since set and get pkt metadata for security sessions are now
made inline for Inline crypto/proto mode, a new member fast_mdata
is added to the rte_security_session.
To access opaque data and fast_mdata will be accessed via inline
APIs which can do pointer manipulations inside library from
session_private_data pointer coming from application.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Tested-by: Gagandeep Singh <g.singh@nxp.com>
Tested-by: David Coyle <david.coyle@intel.com>
Tested-by: Kevin O'Sullivan <kevin.osullivan@intel.com>
2022-10-04 22:37:00 +02:00

39 lines
958 B
C

/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2016-2017 Intel Corporation
*/
#ifndef _CPERF_OPS_
#define _CPERF_OPS_
#include <rte_crypto.h>
#include "cperf.h"
#include "cperf_options.h"
#include "cperf_test_vectors.h"
typedef void *(*cperf_sessions_create_t)(
struct rte_mempool *sess_mp,
uint8_t dev_id, const struct cperf_options *options,
const struct cperf_test_vector *test_vector,
uint16_t iv_offset);
typedef void (*cperf_populate_ops_t)(struct rte_crypto_op **ops,
uint32_t src_buf_offset, uint32_t dst_buf_offset,
uint16_t nb_ops, void *sess,
const struct cperf_options *options,
const struct cperf_test_vector *test_vector,
uint16_t iv_offset, uint32_t *imix_idx,
uint64_t *tsc_start);
struct cperf_op_fns {
cperf_sessions_create_t sess_create;
cperf_populate_ops_t populate_ops;
};
int
cperf_get_op_functions(const struct cperf_options *options,
struct cperf_op_fns *op_fns);
#endif /* _CPERF_OPS_ */