@@ -12139,12 +12139,13 @@ test_tls_record_proto_process(const struct tls_record_test_data td[],
}
/* Setup source mbuf payload */
- ut_params->ibuf = create_segmented_mbuf(ts_params->mbuf_pool, td[i].input_text.len,
- nb_segs, 0);
+ ut_params->ibuf = create_segmented_mbuf_multi_pool(ts_params->mbuf_pool,
+ ts_params->large_mbuf_pool, td[i].input_text.len, nb_segs, 0);
pktmbuf_write(ut_params->ibuf, 0, td[i].input_text.len, td[i].input_text.data);
if (flags->out_of_place)
- ut_params->obuf = create_segmented_mbuf(ts_params->mbuf_pool,
- td[i].output_text.len, nb_segs, 0);
+ ut_params->obuf = create_segmented_mbuf_multi_pool(ts_params->mbuf_pool,
+ ts_params->large_mbuf_pool, td[i].output_text.len, nb_segs,
+ 0);
else
ut_params->obuf = NULL;
@@ -12375,6 +12376,10 @@ test_tls_record_proto_all(const struct tls_record_test_flags *flags)
pass_cnt++;
}
+ if (flags->data_walkthrough)
+ printf("\t Min payload size: %d, Max payload size: %d\n",
+ TLS_RECORD_PLAINTEXT_MIN_LEN, max_payload_len);
+
if (pass_cnt > 0)
return TEST_SUCCESS;
else
@@ -233,6 +233,44 @@ create_segmented_mbuf(struct rte_mempool *mbuf_pool, int pkt_len,
return NULL;
}
+static inline struct rte_mbuf *
+create_segmented_mbuf_multi_pool(struct rte_mempool *mbuf_pool_small,
+ struct rte_mempool *mbuf_pool_large, int pkt_len, int nb_segs, uint8_t pattern)
+{
+ struct rte_mempool *mbuf_pool;
+ int max_seg_len, seg_len;
+
+ if (nb_segs < 1) {
+ printf("Number of segments must be 1 or more (is %d)\n", nb_segs);
+ return NULL;
+ }
+
+ if (pkt_len >= nb_segs)
+ seg_len = pkt_len / nb_segs;
+ else
+ seg_len = 1;
+
+ /* Determine max segment length */
+ max_seg_len = seg_len + pkt_len % nb_segs;
+
+ if (max_seg_len > LARGE_MBUF_DATAPAYLOAD_SIZE) {
+ printf("Segment size %d is too big\n", max_seg_len);
+ return NULL;
+ }
+
+ if (max_seg_len > MBUF_DATAPAYLOAD_SIZE)
+ mbuf_pool = mbuf_pool_large;
+ else
+ mbuf_pool = mbuf_pool_small;
+
+ if (mbuf_pool == NULL) {
+ printf("Invalid mbuf pool\n");
+ return NULL;
+ }
+
+ return create_segmented_mbuf(mbuf_pool, pkt_len, nb_segs, pattern);
+}
+
int
process_sym_raw_dp_op(uint8_t dev_id, uint16_t qp_id,
struct rte_crypto_op *op, uint8_t is_cipher, uint8_t is_auth,
@@ -11,32 +11,32 @@
#include "test_security_proto.h"
/* TLS 1.2 Ciphertext length can be up to (2^14 + 2048 + 5 (TLS Header)) Bytes */
-#define TLS_1_2_RECORD_CIPHERTEXT_MAX_LEN (4096u)
+#define TLS_1_2_RECORD_CIPHERTEXT_MAX_LEN (18437u)
static_assert(TLS_1_2_RECORD_CIPHERTEXT_MAX_LEN <= TEST_SEC_CIPHERTEXT_MAX_LEN,
"TEST_SEC_CIPHERTEXT_MAX_LEN should be at least RECORD MAX LEN!");
/* TLS 1.2 Plaintext length can be up to (2^14 + 1024) Bytes */
-#define TLS_1_2_RECORD_PLAINTEXT_MAX_LEN (3072u)
+#define TLS_1_2_RECORD_PLAINTEXT_MAX_LEN (17408u)
static_assert(TLS_1_2_RECORD_PLAINTEXT_MAX_LEN <= TEST_SEC_CLEARTEXT_MAX_LEN,
"TEST_SEC_CLEARTEXT_MAX_LEN should be at least RECORD MAX LEN!");
/* DTLS 1.2 Ciphertext length is similar to TLS 1.2 */
-#define DTLS_1_2_RECORD_CIPHERTEXT_MAX_LEN (4096u)
+#define DTLS_1_2_RECORD_CIPHERTEXT_MAX_LEN (18437u)
static_assert(DTLS_1_2_RECORD_CIPHERTEXT_MAX_LEN <= TEST_SEC_CIPHERTEXT_MAX_LEN,
"TEST_SEC_CIPHERTEXT_MAX_LEN should be at least RECORD MAX LEN!");
/* DTLS 1.2 Plaintext length is similar to TLS 1.2 */
-#define DTLS_1_2_RECORD_PLAINTEXT_MAX_LEN (3072u)
+#define DTLS_1_2_RECORD_PLAINTEXT_MAX_LEN (17408u)
static_assert(DTLS_1_2_RECORD_PLAINTEXT_MAX_LEN <= TEST_SEC_CLEARTEXT_MAX_LEN,
"TEST_SEC_CLEARTEXT_MAX_LEN should be at least RECORD MAX LEN!");
/* TLS 1.3 Ciphertext length can be up to (2^14 + 256 + 5 (TLS Header)) Bytes */
-#define TLS_1_3_RECORD_CIPHERTEXT_MAX_LEN (4096u)
+#define TLS_1_3_RECORD_CIPHERTEXT_MAX_LEN (16645u)
static_assert(TLS_1_3_RECORD_CIPHERTEXT_MAX_LEN <= TEST_SEC_CIPHERTEXT_MAX_LEN,
"TEST_SEC_CIPHERTEXT_MAX_LEN should be at least RECORD MAX LEN!");
/* TLS 1.3 Plaintext length can be up to 2^14 Bytes */
-#define TLS_1_3_RECORD_PLAINTEXT_MAX_LEN (3072u)
+#define TLS_1_3_RECORD_PLAINTEXT_MAX_LEN (16384u)
static_assert(TLS_1_3_RECORD_PLAINTEXT_MAX_LEN <= TEST_SEC_CLEARTEXT_MAX_LEN,
"TEST_SEC_CLEARTEXT_MAX_LEN should be at least RECORD MAX LEN!");
@@ -10,10 +10,13 @@
#include "test_cryptodev.h"
-#define TEST_SEC_CLEARTEXT_MAX_LEN (MBUF_DATAPAYLOAD_SIZE - 1024)
-#define TEST_SEC_CIPHERTEXT_MAX_LEN (MBUF_DATAPAYLOAD_SIZE)
+#define TEST_SEC_CLEARTEXT_MAX_LEN 17408u
+#define TEST_SEC_CIPHERTEXT_MAX_LEN 18437u
#define TEST_SEC_PKTS_MAX 32
+static_assert(TEST_SEC_CIPHERTEXT_MAX_LEN <= LARGE_MBUF_DATAPAYLOAD_SIZE,
+ "TEST_SEC_CIPHERTEXT_MAX_LEN should not be greater than LARGE_MBUF_DATAPAYLOAD_SIZE");
+
struct crypto_param {
enum rte_crypto_sym_xform_type type;
union {