Lines Matching refs:td
376 struct ipsec_test_data *td; in test_ipsec_td_prepare() local
379 memset(td_array, 0, nb_td * sizeof(*td)); in test_ipsec_td_prepare()
382 td = &td_array[i]; in test_ipsec_td_prepare()
389 memcpy(td, &pkt_aes_256_gcm_v6, sizeof(*td)); in test_ipsec_td_prepare()
391 memcpy(td, &pkt_aes_256_gcm, sizeof(*td)); in test_ipsec_td_prepare()
393 td->aead = true; in test_ipsec_td_prepare()
394 td->xform.aead.aead.algo = param1->alg.aead; in test_ipsec_td_prepare()
395 td->xform.aead.aead.key.length = param1->key_length; in test_ipsec_td_prepare()
399 memcpy(td, &pkt_aes_128_cbc_hmac_sha256_v6, in test_ipsec_td_prepare()
400 sizeof(*td)); in test_ipsec_td_prepare()
402 memcpy(td, &pkt_aes_128_cbc_hmac_sha256, in test_ipsec_td_prepare()
403 sizeof(*td)); in test_ipsec_td_prepare()
405 td->aead = false; in test_ipsec_td_prepare()
408 td->xform.chain.auth.auth.algo = in test_ipsec_td_prepare()
410 td->xform.chain.auth.auth.key.length = in test_ipsec_td_prepare()
412 td->xform.chain.auth.auth.digest_length = in test_ipsec_td_prepare()
414 td->auth_only = true; in test_ipsec_td_prepare()
416 if (td->xform.chain.auth.auth.algo == RTE_CRYPTO_AUTH_AES_GMAC) { in test_ipsec_td_prepare()
417 td->xform.chain.auth.auth.iv.length = in test_ipsec_td_prepare()
419 td->aes_gmac = true; in test_ipsec_td_prepare()
422 td->xform.chain.cipher.cipher.algo = in test_ipsec_td_prepare()
424 td->xform.chain.cipher.cipher.key.length = in test_ipsec_td_prepare()
426 td->xform.chain.cipher.cipher.iv.length = in test_ipsec_td_prepare()
428 td->xform.chain.auth.auth.algo = in test_ipsec_td_prepare()
430 td->xform.chain.auth.auth.key.length = in test_ipsec_td_prepare()
432 td->xform.chain.auth.auth.digest_length = in test_ipsec_td_prepare()
435 if (td->xform.chain.auth.auth.algo == RTE_CRYPTO_AUTH_AES_GMAC) { in test_ipsec_td_prepare()
436 td->xform.chain.auth.auth.iv.length = in test_ipsec_td_prepare()
438 td->aes_gmac = true; in test_ipsec_td_prepare()
444 td->ipsec_xform.proto = in test_ipsec_td_prepare()
449 td->ipsec_xform.options.iv_gen_disable = 0; in test_ipsec_td_prepare()
452 td->ipsec_xform.life.packets_soft_limit = in test_ipsec_td_prepare()
456 td->ipsec_xform.options.ip_csum_enable = 1; in test_ipsec_td_prepare()
457 test_ipsec_csum_init(&td->input_text.data, true, false); in test_ipsec_td_prepare()
461 td->ipsec_xform.options.l4_csum_enable = 1; in test_ipsec_td_prepare()
462 test_ipsec_csum_init(&td->input_text.data, false, true); in test_ipsec_td_prepare()
466 td->ipsec_xform.mode = in test_ipsec_td_prepare()
469 td->ipsec_xform.mode = in test_ipsec_td_prepare()
473 td->ipsec_xform.tunnel.type = in test_ipsec_td_prepare()
476 td->ipsec_xform.tunnel.type = in test_ipsec_td_prepare()
481 td->ipsec_xform.options.stats = 1; in test_ipsec_td_prepare()
485 ip = (struct rte_ipv4_hdr *)&td->input_text.data; in test_ipsec_td_prepare()
492 td->ipsec_xform.options.copy_df = 1; in test_ipsec_td_prepare()
496 td->ipsec_xform.options.copy_dscp = 1; in test_ipsec_td_prepare()
499 td->ipsec_xform.options.dec_ttl = 1; in test_ipsec_td_prepare()
572 test_ipsec_tunnel_hdr_len_get(const struct ipsec_test_data *td) in test_ipsec_tunnel_hdr_len_get() argument
576 if (td->ipsec_xform.direction == RTE_SECURITY_IPSEC_SA_DIR_EGRESS) { in test_ipsec_tunnel_hdr_len_get()
577 if (td->ipsec_xform.mode == RTE_SECURITY_IPSEC_SA_MODE_TUNNEL) { in test_ipsec_tunnel_hdr_len_get()
578 if (td->ipsec_xform.tunnel.type == in test_ipsec_tunnel_hdr_len_get()
590 test_ipsec_iv_verify_push(struct rte_mbuf *m, const struct ipsec_test_data *td) in test_ipsec_iv_verify_push() argument
597 if (td->aead) in test_ipsec_iv_verify_push()
598 iv_len = td->xform.aead.aead.iv.length - td->salt.len; in test_ipsec_iv_verify_push()
600 iv_len = td->xform.chain.cipher.cipher.iv.length; in test_ipsec_iv_verify_push()
602 iv_pos = test_ipsec_tunnel_hdr_len_get(td) + sizeof(struct rte_esp_hdr); in test_ipsec_iv_verify_push()
739 test_ipsec_td_verify(struct rte_mbuf *m, const struct ipsec_test_data *td, in test_ipsec_td_verify() argument
748 if (td->ipsec_xform.direction == RTE_SECURITY_IPSEC_SA_DIR_INGRESS && in test_ipsec_td_verify()
752 td->ar_packet)) in test_ipsec_td_verify()
755 if (td->ipsec_xform.direction == RTE_SECURITY_IPSEC_SA_DIR_EGRESS && in test_ipsec_td_verify()
760 if (td->ipsec_xform.tunnel.type == in test_ipsec_td_verify()
779 if (len != td->output_text.len) { in test_ipsec_td_verify()
781 len, td->output_text.len); in test_ipsec_td_verify()
785 if ((td->ipsec_xform.direction == RTE_SECURITY_IPSEC_SA_DIR_EGRESS) && in test_ipsec_td_verify()
795 skip = test_ipsec_tunnel_hdr_len_get(td); in test_ipsec_td_verify()
800 if ((td->ipsec_xform.direction == RTE_SECURITY_IPSEC_SA_DIR_INGRESS) && in test_ipsec_td_verify()
813 if ((td->ipsec_xform.direction == RTE_SECURITY_IPSEC_SA_DIR_INGRESS) && in test_ipsec_td_verify()
826 memcpy(td_output_text, td->output_text.data + skip, len); in test_ipsec_td_verify()
828 if ((td->ipsec_xform.direction == RTE_SECURITY_IPSEC_SA_DIR_INGRESS) && in test_ipsec_td_verify()
857 test_ipsec_res_d_prepare(struct rte_mbuf *m, const struct ipsec_test_data *td, in test_ipsec_res_d_prepare() argument
863 memcpy(res_d, td, sizeof(*res_d)); in test_ipsec_res_d_prepare()
966 test_ipsec_post_process(struct rte_mbuf *m, const struct ipsec_test_data *td, in test_ipsec_post_process() argument
973 if (td->ipsec_xform.direction == RTE_SECURITY_IPSEC_SA_DIR_EGRESS) { in test_ipsec_post_process()
978 ret = test_ipsec_iv_verify_push(m, td); in test_ipsec_post_process()
985 if (td->ipsec_xform.mode == in test_ipsec_post_process()
1005 if (td->ipsec_xform.tunnel.type == in test_ipsec_post_process()
1031 return test_ipsec_td_verify(m, td, silent, flags); in test_ipsec_post_process()
1033 return test_ipsec_res_d_prepare(m, td, res_d); in test_ipsec_post_process()
1037 test_ipsec_status_check(const struct ipsec_test_data *td, in test_ipsec_status_check() argument
1046 td->ar_packet) { in test_ipsec_status_check()