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
ip_frag: free mbufs on reassembly table destroy
[dpdk.git]
/
app
/
test-crypto-perf
/
cperf_test_vector_parsing.c
diff --git
a/app/test-crypto-perf/cperf_test_vector_parsing.c
b/app/test-crypto-perf/cperf_test_vector_parsing.c
index
c53ba67
..
f384e3d
100644
(file)
--- a/
app/test-crypto-perf/cperf_test_vector_parsing.c
+++ b/
app/test-crypto-perf/cperf_test_vector_parsing.c
@@
-237,15
+237,19
@@
parse_entry(char *entry, struct cperf_test_vector *vector,
uint8_t *data = NULL;
char *token, *key_token;
uint8_t *data = NULL;
char *token, *key_token;
+ if (entry == NULL) {
+ printf("Expected entry value\n");
+ return -1;
+ }
+
/* get key */
token = strtok(entry, CPERF_ENTRY_DELIMITER);
key_token = token;
/* get key */
token = strtok(entry, CPERF_ENTRY_DELIMITER);
key_token = token;
-
/* get values for key */
token = strtok(NULL, CPERF_ENTRY_DELIMITER);
/* get values for key */
token = strtok(NULL, CPERF_ENTRY_DELIMITER);
- if (token == NULL) {
- printf("Expected 'key = values' but was '%.40s'..\n",
-
key_token
);
+
+ if (key_token == NULL || token == NULL) {
+
printf("Expected 'key = values' but was '%.40s'..\n", entry
);
return -1;
}
return -1;
}
@@
-260,12
+264,12
@@
parse_entry(char *entry, struct cperf_test_vector *vector,
if (tc_found)
vector->plaintext.length = data_length;
else {
if (tc_found)
vector->plaintext.length = data_length;
else {
- if (opts->
buffer_sz
> data_length) {
+ if (opts->
max_buffer_size
> data_length) {
printf("Global plaintext shorter than "
"buffer_sz\n");
return -1;
}
printf("Global plaintext shorter than "
"buffer_sz\n");
return -1;
}
- vector->plaintext.length = opts->
buffer_sz
;
+ vector->plaintext.length = opts->
max_buffer_size
;
}
} else if (strstr(key_token, "cipher_key")) {
}
} else if (strstr(key_token, "cipher_key")) {
@@
-317,12
+321,12
@@
parse_entry(char *entry, struct cperf_test_vector *vector,
if (tc_found)
vector->ciphertext.length = data_length;
else {
if (tc_found)
vector->ciphertext.length = data_length;
else {
- if (opts->
buffer_sz
> data_length) {
+ if (opts->
max_buffer_size
> data_length) {
printf("Global ciphertext shorter than "
"buffer_sz\n");
return -1;
}
printf("Global ciphertext shorter than "
"buffer_sz\n");
return -1;
}
- vector->ciphertext.length = opts->
buffer_sz
;
+ vector->ciphertext.length = opts->
max_buffer_size
;
}
} else if (strstr(key_token, "aad")) {
}
} else if (strstr(key_token, "aad")) {
@@
-494,10
+498,10
@@
cperf_test_vector_get_from_file(struct cperf_options *opts)
/* other values not included in the file */
test_vector->data.cipher_offset = 0;
/* other values not included in the file */
test_vector->data.cipher_offset = 0;
- test_vector->data.cipher_length = opts->
buffer_sz
;
+ test_vector->data.cipher_length = opts->
max_buffer_size
;
test_vector->data.auth_offset = 0;
test_vector->data.auth_offset = 0;
- test_vector->data.auth_length = opts->
buffer_sz
;
+ test_vector->data.auth_length = opts->
max_buffer_size
;
return test_vector;
}
return test_vector;
}