numam-dpdk/app/test-crypto-perf
Olivier Matz addaac42a0 app/test-crypto-perf: fix compilation with -Og
The compilation with gcc-6.3.0 and EXTRA_CFLAGS=-Og gives the following
error:

  CC cperf_test_verify.o
cperf_test_verify.c: In function ‘cperf_verify_op’:
cperf_test_verify.c:382:5: error: ‘auth’ may be used uninitialized
                           in this function
                           [-Werror=maybe-uninitialized]
  if (auth == 1) {
     ^
cperf_test_verify.c:371:5: error: ‘cipher’ may be used uninitialized
                           in this function
			   [-Werror=maybe-uninitialized]
  if (cipher == 1) {
     ^
cperf_test_verify.c:384:11: error: ‘auth_offset’ may be used
			    uninitialized in this function
			    [-Werror=maybe-uninitialized]
    res += memcmp(data + auth_offset,
           ^~~~~~~~~~~~~~~~~~~~~~~~~~
      vector->digest.data,
      ~~~~~~~~~~~~~~~~~~~~
      options->digest_sz);
      ~~~~~~~~~~~~~~~~~~~
cperf_test_verify.c:377:11: error: ‘cipher_offset’ may be used
                            uninitialized in this function
                            [-Werror=maybe-uninitialized]
    res += memcmp(data + cipher_offset,
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      vector->plaintext.data,
      ~~~~~~~~~~~~~~~~~~~~~~~
      options->test_buffer_size);
      ~~~~~~~~~~~~~~~~~~~~~~~~~~

There is no default case in the switch statement, so if options->op_type
is an unknown value, the function will use uninitialized values. Fix it
by adding a default.

Fixes: f8be1786b1 ("app/crypto-perf: introduce performance test application")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2017-10-06 02:49:50 +02:00
..
data cryptodev: add auth IV 2017-07-06 22:26:48 +02:00
cperf_ops.c cryptodev: rename ADD field 2017-07-19 14:10:41 +03:00
cperf_ops.h cryptodev: support device independent sessions 2017-07-06 22:34:55 +02:00
cperf_options_parsing.c app/test-crypto-perf: add AEAD parameters 2017-07-06 22:26:49 +02:00
cperf_options.h app/test-crypto-perf: add AEAD parameters 2017-07-06 22:26:49 +02:00
cperf_test_latency.c app/crypto-perf: fix operation free 2017-08-07 14:31:37 +02:00
cperf_test_latency.h cryptodev: support device independent sessions 2017-07-06 22:34:55 +02:00
cperf_test_throughput.c app/crypto-perf: fix IV allocation for AEAD 2017-08-03 23:46:41 +02:00
cperf_test_throughput.h cryptodev: support device independent sessions 2017-07-06 22:34:55 +02:00
cperf_test_vector_parsing.c app/test-crypto-perf: add AEAD parameters 2017-07-06 22:26:49 +02:00
cperf_test_vector_parsing.h
cperf_test_vectors.c app/test-crypto-perf: add AEAD parameters 2017-07-06 22:26:49 +02:00
cperf_test_vectors.h app/test-crypto-perf: add AEAD parameters 2017-07-06 22:26:49 +02:00
cperf_test_verify.c app/test-crypto-perf: fix compilation with -Og 2017-10-06 02:49:50 +02:00
cperf_test_verify.h cryptodev: support device independent sessions 2017-07-06 22:34:55 +02:00
cperf.h cryptodev: support device independent sessions 2017-07-06 22:34:55 +02:00
main.c cryptodev: remove AAD size in auth capabilities 2017-07-19 14:10:41 +03:00
Makefile app/crypto-perf: move verify as single test type 2017-04-06 00:17:44 +02:00