For throughput and latency tests, it is not required
to populate the mbufs with any test vector.
For verify test, there is already a function that rewrites
the mbufs every time they are going to be used with
crypto operations.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
cperf_mbuf_create(struct rte_mempool *mempool,
uint32_t segment_sz,
uint32_t segments_nb,
cperf_mbuf_create(struct rte_mempool *mempool,
uint32_t segment_sz,
uint32_t segments_nb,
- const struct cperf_options *options,
- const struct cperf_test_vector *test_vector)
+ const struct cperf_options *options)
{
struct rte_mbuf *mbuf;
uint8_t *mbuf_data;
{
struct rte_mbuf *mbuf;
uint8_t *mbuf_data;
- uint8_t *test_data =
- (options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT) ?
- test_vector->plaintext.data :
- test_vector->ciphertext.data;
uint32_t remaining_bytes = options->max_buffer_size;
mbuf = rte_pktmbuf_alloc(mempool);
uint32_t remaining_bytes = options->max_buffer_size;
mbuf = rte_pktmbuf_alloc(mempool);
if (mbuf_data == NULL)
goto error;
if (mbuf_data == NULL)
goto error;
- if (options->max_buffer_size <= segment_sz) {
- memcpy(mbuf_data, test_data, options->max_buffer_size);
- test_data += options->max_buffer_size;
+ if (options->max_buffer_size <= segment_sz)
- } else {
- memcpy(mbuf_data, test_data, segment_sz);
- test_data += segment_sz;
remaining_bytes -= segment_sz;
remaining_bytes -= segment_sz;
segments_nb--;
while (remaining_bytes) {
segments_nb--;
while (remaining_bytes) {
if (mbuf_data == NULL)
goto error;
if (mbuf_data == NULL)
goto error;
- if (remaining_bytes <= segment_sz) {
- memcpy(mbuf_data, test_data, remaining_bytes);
+ if (remaining_bytes <= segment_sz)
- test_data += remaining_bytes;
- } else {
- memcpy(mbuf_data, test_data, segment_sz);
remaining_bytes -= segment_sz;
remaining_bytes -= segment_sz;
- test_data += segment_sz;
- }
*pkt_mbuf_pool_in,
options->segment_sz,
segments_nb,
*pkt_mbuf_pool_in,
options->segment_sz,
segments_nb,
if ((*mbufs_in)[mbuf_idx] == NULL)
return -1;
}
if ((*mbufs_in)[mbuf_idx] == NULL)
return -1;
}
for (mbuf_idx = 0; mbuf_idx < options->pool_sz; mbuf_idx++) {
(*mbufs_out)[mbuf_idx] = cperf_mbuf_create(
*pkt_mbuf_pool_out, max_size,
for (mbuf_idx = 0; mbuf_idx < options->pool_sz; mbuf_idx++) {
(*mbufs_out)[mbuf_idx] = cperf_mbuf_create(
*pkt_mbuf_pool_out, max_size,
- 1, options, test_vector);
if ((*mbufs_out)[mbuf_idx] == NULL)
return -1;
}
if ((*mbufs_out)[mbuf_idx] == NULL)
return -1;
}