186e2487cSAkhil Goyal /* SPDX-License-Identifier: BSD-3-Clause 286e2487cSAkhil Goyal * Copyright(C) 2022 Marvell. 386e2487cSAkhil Goyal */ 486e2487cSAkhil Goyal #ifndef _TEST_INLINE_IPSEC_REASSEMBLY_VECTORS_H_ 586e2487cSAkhil Goyal #define _TEST_INLINE_IPSEC_REASSEMBLY_VECTORS_H_ 686e2487cSAkhil Goyal 786e2487cSAkhil Goyal #include "test_cryptodev_security_ipsec.h" 886e2487cSAkhil Goyal 986e2487cSAkhil Goyal uint8_t dummy_ipv4_eth_hdr[] = { 1086e2487cSAkhil Goyal /* ETH */ 1186e2487cSAkhil Goyal 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 1286e2487cSAkhil Goyal 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0x08, 0x00, 1386e2487cSAkhil Goyal }; 1486e2487cSAkhil Goyal uint8_t dummy_ipv6_eth_hdr[] = { 1586e2487cSAkhil Goyal /* ETH */ 1686e2487cSAkhil Goyal 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 1786e2487cSAkhil Goyal 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0x86, 0xdd, 1886e2487cSAkhil Goyal }; 1986e2487cSAkhil Goyal 2015ccc647SNithin Dabilpuram #define MAX_FRAG_LEN IPSEC_TEXT_MAX_LEN 21a3105777SAkhil Goyal #define MAX_FRAGS 6 22a3105777SAkhil Goyal #define MAX_PKT_LEN (MAX_FRAG_LEN * MAX_FRAGS) 23a3105777SAkhil Goyal 24a3105777SAkhil Goyal struct ip_reassembly_test_packet { 25a3105777SAkhil Goyal uint32_t len; 26a3105777SAkhil Goyal uint32_t l4_offset; 27a3105777SAkhil Goyal uint8_t data[MAX_PKT_LEN]; 28a3105777SAkhil Goyal }; 29a3105777SAkhil Goyal 30a3105777SAkhil Goyal struct reassembly_vector { 31a3105777SAkhil Goyal /* input/output text in struct ipsec_test_data are not used */ 32a3105777SAkhil Goyal struct ipsec_test_data *sa_data; 33a3105777SAkhil Goyal struct ip_reassembly_test_packet *full_pkt; 34a3105777SAkhil Goyal struct ip_reassembly_test_packet *frags[MAX_FRAGS]; 35a3105777SAkhil Goyal uint16_t nb_frags; 36a3105777SAkhil Goyal bool burst; 37a3105777SAkhil Goyal }; 38a3105777SAkhil Goyal 3919d7fcc5SRahul Bhansali struct ip_pkt_vector { 4019d7fcc5SRahul Bhansali /* input/output text in struct ipsec_test_data are not used */ 4119d7fcc5SRahul Bhansali struct ipsec_test_data *sa_data; 4219d7fcc5SRahul Bhansali struct ip_reassembly_test_packet *full_pkt; 4319d7fcc5SRahul Bhansali bool burst; 4419d7fcc5SRahul Bhansali }; 4519d7fcc5SRahul Bhansali 4634e8a9d9SVamsi Attunuru struct sa_expiry_vector { 4734e8a9d9SVamsi Attunuru struct ipsec_session_data *sa_data; 4834e8a9d9SVamsi Attunuru enum rte_eth_event_ipsec_subtype event; 4934e8a9d9SVamsi Attunuru bool notify_event; 5034e8a9d9SVamsi Attunuru }; 5134e8a9d9SVamsi Attunuru 52a3105777SAkhil Goyal /* The source file includes below test vectors */ 53a3105777SAkhil Goyal /* IPv6: 54a3105777SAkhil Goyal * 55a3105777SAkhil Goyal * 1) pkt_ipv6_udp_p1 56a3105777SAkhil Goyal * pkt_ipv6_udp_p1_f1 57a3105777SAkhil Goyal * pkt_ipv6_udp_p1_f2 58a3105777SAkhil Goyal * 59a3105777SAkhil Goyal * 2) pkt_ipv6_udp_p2 60a3105777SAkhil Goyal * pkt_ipv6_udp_p2_f1 61a3105777SAkhil Goyal * pkt_ipv6_udp_p2_f2 62a3105777SAkhil Goyal * pkt_ipv6_udp_p2_f3 63a3105777SAkhil Goyal * pkt_ipv6_udp_p2_f4 64a3105777SAkhil Goyal * 65a3105777SAkhil Goyal * 3) pkt_ipv6_udp_p3 66a3105777SAkhil Goyal * pkt_ipv6_udp_p3_f1 67a3105777SAkhil Goyal * pkt_ipv6_udp_p3_f2 68a3105777SAkhil Goyal * pkt_ipv6_udp_p3_f3 69a3105777SAkhil Goyal * pkt_ipv6_udp_p3_f4 70a3105777SAkhil Goyal * pkt_ipv6_udp_p3_f5 71a3105777SAkhil Goyal */ 72a3105777SAkhil Goyal 73a3105777SAkhil Goyal /* IPv4: 74a3105777SAkhil Goyal * 75a3105777SAkhil Goyal * 1) pkt_ipv4_udp_p1 76a3105777SAkhil Goyal * pkt_ipv4_udp_p1_f1 77a3105777SAkhil Goyal * pkt_ipv4_udp_p1_f2 78a3105777SAkhil Goyal * 79a3105777SAkhil Goyal * 2) pkt_ipv4_udp_p2 80a3105777SAkhil Goyal * pkt_ipv4_udp_p2_f1 81a3105777SAkhil Goyal * pkt_ipv4_udp_p2_f2 82a3105777SAkhil Goyal * pkt_ipv4_udp_p2_f3 83a3105777SAkhil Goyal * pkt_ipv4_udp_p2_f4 84a3105777SAkhil Goyal * 85a3105777SAkhil Goyal * 3) pkt_ipv4_udp_p3 86a3105777SAkhil Goyal * pkt_ipv4_udp_p3_f1 87a3105777SAkhil Goyal * pkt_ipv4_udp_p3_f2 88a3105777SAkhil Goyal * pkt_ipv4_udp_p3_f3 89a3105777SAkhil Goyal * pkt_ipv4_udp_p3_f4 90a3105777SAkhil Goyal * pkt_ipv4_udp_p3_f5 91a3105777SAkhil Goyal */ 92a3105777SAkhil Goyal 93a3105777SAkhil Goyal struct ip_reassembly_test_packet pkt_ipv6_udp_p1 = { 94a3105777SAkhil Goyal .len = 1500, 95a3105777SAkhil Goyal .l4_offset = 40, 96a3105777SAkhil Goyal .data = { 97a3105777SAkhil Goyal /* IP */ 98c61b7313SRahul Bhansali 0x60, 0x00, 0x00, 0x00, 0x05, 0xb4, 0x11, 0x40, 99a3105777SAkhil Goyal 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 100a3105777SAkhil Goyal 0x00, 0x00, 0xff, 0xff, 0x0d, 0x00, 0x00, 0x02, 101a3105777SAkhil Goyal 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 102a3105777SAkhil Goyal 0x00, 0x00, 0xff, 0xff, 0x02, 0x00, 0x00, 0x02, 103a3105777SAkhil Goyal 104a3105777SAkhil Goyal /* UDP */ 105a3105777SAkhil Goyal 0x08, 0x00, 0x27, 0x10, 0x05, 0xb4, 0x2b, 0xe8, 106a3105777SAkhil Goyal }, 107a3105777SAkhil Goyal }; 108a3105777SAkhil Goyal 109a3105777SAkhil Goyal struct ip_reassembly_test_packet pkt_ipv6_udp_p1_f1 = { 110a3105777SAkhil Goyal .len = 1384, 111a3105777SAkhil Goyal .l4_offset = 48, 112a3105777SAkhil Goyal .data = { 113a3105777SAkhil Goyal /* IP */ 114a3105777SAkhil Goyal 0x60, 0x00, 0x00, 0x00, 0x05, 0x40, 0x2c, 0x40, 115a3105777SAkhil Goyal 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 116a3105777SAkhil Goyal 0x00, 0x00, 0xff, 0xff, 0x0d, 0x00, 0x00, 0x02, 117a3105777SAkhil Goyal 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 118a3105777SAkhil Goyal 0x00, 0x00, 0xff, 0xff, 0x02, 0x00, 0x00, 0x02, 119a3105777SAkhil Goyal 0x11, 0x00, 0x00, 0x01, 0x5c, 0x92, 0xac, 0xf1, 120a3105777SAkhil Goyal 121a3105777SAkhil Goyal /* UDP */ 122a3105777SAkhil Goyal 0x08, 0x00, 0x27, 0x10, 0x05, 0xb4, 0x2b, 0xe8, 123a3105777SAkhil Goyal }, 124a3105777SAkhil Goyal }; 125a3105777SAkhil Goyal 126a3105777SAkhil Goyal struct ip_reassembly_test_packet pkt_ipv6_udp_p1_f2 = { 127a3105777SAkhil Goyal .len = 172, 128a3105777SAkhil Goyal .l4_offset = 48, 129a3105777SAkhil Goyal .data = { 130a3105777SAkhil Goyal /* IP */ 131a3105777SAkhil Goyal 0x60, 0x00, 0x00, 0x00, 0x00, 0x84, 0x2c, 0x40, 132a3105777SAkhil Goyal 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 133a3105777SAkhil Goyal 0x00, 0x00, 0xff, 0xff, 0x0d, 0x00, 0x00, 0x02, 134a3105777SAkhil Goyal 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 135a3105777SAkhil Goyal 0x00, 0x00, 0xff, 0xff, 0x02, 0x00, 0x00, 0x02, 136a3105777SAkhil Goyal 0x11, 0x00, 0x05, 0x38, 0x5c, 0x92, 0xac, 0xf1, 137a3105777SAkhil Goyal }, 138a3105777SAkhil Goyal }; 139a3105777SAkhil Goyal 140a3105777SAkhil Goyal struct ip_reassembly_test_packet pkt_ipv6_udp_p2 = { 141a3105777SAkhil Goyal .len = 4482, 142a3105777SAkhil Goyal .l4_offset = 40, 143a3105777SAkhil Goyal .data = { 144a3105777SAkhil Goyal /* IP */ 145c61b7313SRahul Bhansali 0x60, 0x00, 0x00, 0x00, 0x11, 0x5a, 0x11, 0x40, 146a3105777SAkhil Goyal 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 147a3105777SAkhil Goyal 0x00, 0x00, 0xff, 0xff, 0x0d, 0x00, 0x00, 0x02, 148a3105777SAkhil Goyal 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 149a3105777SAkhil Goyal 0x00, 0x00, 0xff, 0xff, 0x02, 0x00, 0x00, 0x02, 150a3105777SAkhil Goyal 151a3105777SAkhil Goyal /* UDP */ 152a3105777SAkhil Goyal 0x08, 0x00, 0x27, 0x10, 0x11, 0x5a, 0x8a, 0x11, 153a3105777SAkhil Goyal }, 154a3105777SAkhil Goyal }; 155a3105777SAkhil Goyal 156a3105777SAkhil Goyal struct ip_reassembly_test_packet pkt_ipv6_udp_p2_f1 = { 157a3105777SAkhil Goyal .len = 1384, 158a3105777SAkhil Goyal .l4_offset = 48, 159a3105777SAkhil Goyal .data = { 160a3105777SAkhil Goyal /* IP */ 161a3105777SAkhil Goyal 0x60, 0x00, 0x00, 0x00, 0x05, 0x40, 0x2c, 0x40, 162a3105777SAkhil Goyal 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 163a3105777SAkhil Goyal 0x00, 0x00, 0xff, 0xff, 0x0d, 0x00, 0x00, 0x02, 164a3105777SAkhil Goyal 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 165a3105777SAkhil Goyal 0x00, 0x00, 0xff, 0xff, 0x02, 0x00, 0x00, 0x02, 166a3105777SAkhil Goyal 0x11, 0x00, 0x00, 0x01, 0x64, 0x6c, 0x68, 0x9f, 167a3105777SAkhil Goyal 168a3105777SAkhil Goyal /* UDP */ 169a3105777SAkhil Goyal 0x08, 0x00, 0x27, 0x10, 0x11, 0x5a, 0x8a, 0x11, 170a3105777SAkhil Goyal }, 171a3105777SAkhil Goyal }; 172a3105777SAkhil Goyal 173a3105777SAkhil Goyal struct ip_reassembly_test_packet pkt_ipv6_udp_p2_f2 = { 174a3105777SAkhil Goyal .len = 1384, 175a3105777SAkhil Goyal .l4_offset = 48, 176a3105777SAkhil Goyal .data = { 177a3105777SAkhil Goyal /* IP */ 178a3105777SAkhil Goyal 0x60, 0x00, 0x00, 0x00, 0x05, 0x40, 0x2c, 0x40, 179a3105777SAkhil Goyal 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 180a3105777SAkhil Goyal 0x00, 0x00, 0xff, 0xff, 0x0d, 0x00, 0x00, 0x02, 181a3105777SAkhil Goyal 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 182a3105777SAkhil Goyal 0x00, 0x00, 0xff, 0xff, 0x02, 0x00, 0x00, 0x02, 183a3105777SAkhil Goyal 0x11, 0x00, 0x05, 0x39, 0x64, 0x6c, 0x68, 0x9f, 184a3105777SAkhil Goyal }, 185a3105777SAkhil Goyal }; 186a3105777SAkhil Goyal 187a3105777SAkhil Goyal struct ip_reassembly_test_packet pkt_ipv6_udp_p2_f3 = { 188a3105777SAkhil Goyal .len = 1384, 189a3105777SAkhil Goyal .l4_offset = 48, 190a3105777SAkhil Goyal .data = { 191a3105777SAkhil Goyal /* IP */ 192a3105777SAkhil Goyal 0x60, 0x00, 0x00, 0x00, 0x05, 0x40, 0x2c, 0x40, 193a3105777SAkhil Goyal 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 194a3105777SAkhil Goyal 0x00, 0x00, 0xff, 0xff, 0x0d, 0x00, 0x00, 0x02, 195a3105777SAkhil Goyal 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 196a3105777SAkhil Goyal 0x00, 0x00, 0xff, 0xff, 0x02, 0x00, 0x00, 0x02, 197a3105777SAkhil Goyal 0x11, 0x00, 0x0a, 0x71, 0x64, 0x6c, 0x68, 0x9f, 198a3105777SAkhil Goyal }, 199a3105777SAkhil Goyal }; 200a3105777SAkhil Goyal 201a3105777SAkhil Goyal struct ip_reassembly_test_packet pkt_ipv6_udp_p2_f4 = { 202a3105777SAkhil Goyal .len = 482, 203a3105777SAkhil Goyal .l4_offset = 48, 204a3105777SAkhil Goyal .data = { 205a3105777SAkhil Goyal /* IP */ 206a3105777SAkhil Goyal 0x60, 0x00, 0x00, 0x00, 0x01, 0xba, 0x2c, 0x40, 207a3105777SAkhil Goyal 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 208a3105777SAkhil Goyal 0x00, 0x00, 0xff, 0xff, 0x0d, 0x00, 0x00, 0x02, 209a3105777SAkhil Goyal 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 210a3105777SAkhil Goyal 0x00, 0x00, 0xff, 0xff, 0x02, 0x00, 0x00, 0x02, 211a3105777SAkhil Goyal 0x11, 0x00, 0x0f, 0xa8, 0x64, 0x6c, 0x68, 0x9f, 212a3105777SAkhil Goyal }, 213a3105777SAkhil Goyal }; 214a3105777SAkhil Goyal 215a3105777SAkhil Goyal struct ip_reassembly_test_packet pkt_ipv6_udp_p3 = { 216a3105777SAkhil Goyal .len = 5782, 217a3105777SAkhil Goyal .l4_offset = 40, 218a3105777SAkhil Goyal .data = { 219a3105777SAkhil Goyal /* IP */ 220a3105777SAkhil Goyal 0x60, 0x00, 0x00, 0x00, 0x16, 0x6e, 0x2c, 0x40, 221a3105777SAkhil Goyal 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 222a3105777SAkhil Goyal 0x00, 0x00, 0xff, 0xff, 0x0d, 0x00, 0x00, 0x02, 223a3105777SAkhil Goyal 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 224a3105777SAkhil Goyal 0x00, 0x00, 0xff, 0xff, 0x02, 0x00, 0x00, 0x02, 225a3105777SAkhil Goyal 226a3105777SAkhil Goyal /* UDP */ 227a3105777SAkhil Goyal 0x08, 0x00, 0x27, 0x10, 0x16, 0x6e, 0x2f, 0x99, 228a3105777SAkhil Goyal }, 229a3105777SAkhil Goyal }; 230a3105777SAkhil Goyal 231a3105777SAkhil Goyal struct ip_reassembly_test_packet pkt_ipv6_udp_p3_f1 = { 232a3105777SAkhil Goyal .len = 1384, 233a3105777SAkhil Goyal .l4_offset = 48, 234a3105777SAkhil Goyal .data = { 235a3105777SAkhil Goyal /* IP */ 236a3105777SAkhil Goyal 0x60, 0x00, 0x00, 0x00, 0x05, 0x40, 0x2c, 0x40, 237a3105777SAkhil Goyal 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 238a3105777SAkhil Goyal 0x00, 0x00, 0xff, 0xff, 0x0d, 0x00, 0x00, 0x02, 239a3105777SAkhil Goyal 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 240a3105777SAkhil Goyal 0x00, 0x00, 0xff, 0xff, 0x02, 0x00, 0x00, 0x02, 241a3105777SAkhil Goyal 0x11, 0x00, 0x00, 0x01, 0x65, 0xcf, 0x5a, 0xae, 242a3105777SAkhil Goyal 243a3105777SAkhil Goyal /* UDP */ 244a3105777SAkhil Goyal 0x80, 0x00, 0x27, 0x10, 0x16, 0x6e, 0x2f, 0x99, 245a3105777SAkhil Goyal }, 246a3105777SAkhil Goyal }; 247a3105777SAkhil Goyal 248a3105777SAkhil Goyal struct ip_reassembly_test_packet pkt_ipv6_udp_p3_f2 = { 249a3105777SAkhil Goyal .len = 1384, 250a3105777SAkhil Goyal .l4_offset = 48, 251a3105777SAkhil Goyal .data = { 252a3105777SAkhil Goyal /* IP */ 253a3105777SAkhil Goyal 0x60, 0x00, 0x00, 0x00, 0x05, 0x40, 0x2c, 0x40, 254a3105777SAkhil Goyal 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 255a3105777SAkhil Goyal 0x00, 0x00, 0xff, 0xff, 0x0d, 0x00, 0x00, 0x02, 256a3105777SAkhil Goyal 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 257a3105777SAkhil Goyal 0x00, 0x00, 0xff, 0xff, 0x02, 0x00, 0x00, 0x02, 258a3105777SAkhil Goyal 0x11, 0x00, 0x05, 0x39, 0x65, 0xcf, 0x5a, 0xae, 259a3105777SAkhil Goyal }, 260a3105777SAkhil Goyal }; 261a3105777SAkhil Goyal 262a3105777SAkhil Goyal struct ip_reassembly_test_packet pkt_ipv6_udp_p3_f3 = { 263a3105777SAkhil Goyal .len = 1384, 264a3105777SAkhil Goyal .l4_offset = 48, 265a3105777SAkhil Goyal .data = { 266a3105777SAkhil Goyal /* IP */ 267a3105777SAkhil Goyal 0x60, 0x00, 0x00, 0x00, 0x05, 0x40, 0x2c, 0x40, 268a3105777SAkhil Goyal 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 269a3105777SAkhil Goyal 0x00, 0x00, 0xff, 0xff, 0x0d, 0x00, 0x00, 0x02, 270a3105777SAkhil Goyal 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 271a3105777SAkhil Goyal 0x00, 0x00, 0xff, 0xff, 0x02, 0x00, 0x00, 0x02, 272a3105777SAkhil Goyal 0x11, 0x00, 0x0a, 0x71, 0x65, 0xcf, 0x5a, 0xae, 273a3105777SAkhil Goyal }, 274a3105777SAkhil Goyal }; 275a3105777SAkhil Goyal 276a3105777SAkhil Goyal struct ip_reassembly_test_packet pkt_ipv6_udp_p3_f4 = { 277a3105777SAkhil Goyal .len = 1384, 278a3105777SAkhil Goyal .l4_offset = 48, 279a3105777SAkhil Goyal .data = { 280a3105777SAkhil Goyal /* IP */ 281a3105777SAkhil Goyal 0x60, 0x00, 0x00, 0x00, 0x05, 0x40, 0x2c, 0x40, 282a3105777SAkhil Goyal 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 283a3105777SAkhil Goyal 0x00, 0x00, 0xff, 0xff, 0x0d, 0x00, 0x00, 0x02, 284a3105777SAkhil Goyal 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 285a3105777SAkhil Goyal 0x00, 0x00, 0xff, 0xff, 0x02, 0x00, 0x00, 0x02, 286a3105777SAkhil Goyal 0x11, 0x00, 0x0f, 0xa9, 0x65, 0xcf, 0x5a, 0xae, 287a3105777SAkhil Goyal }, 288a3105777SAkhil Goyal }; 289a3105777SAkhil Goyal 290a3105777SAkhil Goyal struct ip_reassembly_test_packet pkt_ipv6_udp_p3_f5 = { 291a3105777SAkhil Goyal .len = 446, 292a3105777SAkhil Goyal .l4_offset = 48, 293a3105777SAkhil Goyal .data = { 294a3105777SAkhil Goyal /* IP */ 295a3105777SAkhil Goyal 0x60, 0x00, 0x00, 0x00, 0x01, 0x96, 0x2c, 0x40, 296a3105777SAkhil Goyal 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 297a3105777SAkhil Goyal 0x00, 0x00, 0xff, 0xff, 0x0d, 0x00, 0x00, 0x02, 298a3105777SAkhil Goyal 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 299a3105777SAkhil Goyal 0x00, 0x00, 0xff, 0xff, 0x02, 0x00, 0x00, 0x02, 300a3105777SAkhil Goyal 0x11, 0x00, 0x14, 0xe0, 0x65, 0xcf, 0x5a, 0xae, 301a3105777SAkhil Goyal }, 302a3105777SAkhil Goyal }; 303a3105777SAkhil Goyal 30419d7fcc5SRahul Bhansali struct ip_reassembly_test_packet pkt_ipv4_udp = { 30519d7fcc5SRahul Bhansali .len = 1200, 30619d7fcc5SRahul Bhansali .l4_offset = 20, 30719d7fcc5SRahul Bhansali .data = { 30819d7fcc5SRahul Bhansali /* IP */ 30919d7fcc5SRahul Bhansali 0x45, 0x00, 0x04, 0xb0, 0x00, 0x01, 0x00, 0x00, 31019d7fcc5SRahul Bhansali 0x40, 0x11, 0x66, 0x0d, 0x0d, 0x00, 0x00, 0x02, 31119d7fcc5SRahul Bhansali 0x02, 0x00, 0x00, 0x02, 31219d7fcc5SRahul Bhansali 31319d7fcc5SRahul Bhansali /* UDP */ 31419d7fcc5SRahul Bhansali 0x08, 0x00, 0x27, 0x10, 0x05, 0xc8, 0xb8, 0x4c, 31519d7fcc5SRahul Bhansali }, 31619d7fcc5SRahul Bhansali }; 31719d7fcc5SRahul Bhansali 318a3105777SAkhil Goyal struct ip_reassembly_test_packet pkt_ipv4_udp_p1 = { 319a3105777SAkhil Goyal .len = 1500, 320a3105777SAkhil Goyal .l4_offset = 20, 321a3105777SAkhil Goyal .data = { 322a3105777SAkhil Goyal /* IP */ 323a3105777SAkhil Goyal 0x45, 0x00, 0x05, 0xdc, 0x00, 0x01, 0x00, 0x00, 324a3105777SAkhil Goyal 0x40, 0x11, 0x66, 0x0d, 0x0d, 0x00, 0x00, 0x02, 325a3105777SAkhil Goyal 0x02, 0x00, 0x00, 0x02, 326a3105777SAkhil Goyal 327a3105777SAkhil Goyal /* UDP */ 328a3105777SAkhil Goyal 0x08, 0x00, 0x27, 0x10, 0x05, 0xc8, 0xb8, 0x4c, 329a3105777SAkhil Goyal }, 330a3105777SAkhil Goyal }; 331a3105777SAkhil Goyal 332a3105777SAkhil Goyal struct ip_reassembly_test_packet pkt_ipv4_udp_p1_f1 = { 333a3105777SAkhil Goyal .len = 1420, 334a3105777SAkhil Goyal .l4_offset = 20, 335a3105777SAkhil Goyal .data = { 336a3105777SAkhil Goyal /* IP */ 337a3105777SAkhil Goyal 0x45, 0x00, 0x05, 0x8c, 0x00, 0x01, 0x20, 0x00, 338a3105777SAkhil Goyal 0x40, 0x11, 0x46, 0x5d, 0x0d, 0x00, 0x00, 0x02, 339a3105777SAkhil Goyal 0x02, 0x00, 0x00, 0x02, 340a3105777SAkhil Goyal 341a3105777SAkhil Goyal /* UDP */ 342a3105777SAkhil Goyal 0x08, 0x00, 0x27, 0x10, 0x05, 0xc8, 0xb8, 0x4c, 343a3105777SAkhil Goyal }, 344a3105777SAkhil Goyal }; 345a3105777SAkhil Goyal 346a3105777SAkhil Goyal struct ip_reassembly_test_packet pkt_ipv4_udp_p1_f2 = { 347a3105777SAkhil Goyal .len = 100, 348a3105777SAkhil Goyal .l4_offset = 20, 349a3105777SAkhil Goyal .data = { 350a3105777SAkhil Goyal /* IP */ 351a3105777SAkhil Goyal 0x45, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0xaf, 352a3105777SAkhil Goyal 0x40, 0x11, 0x6a, 0xd6, 0x0d, 0x00, 0x00, 0x02, 353a3105777SAkhil Goyal 0x02, 0x00, 0x00, 0x02, 354a3105777SAkhil Goyal }, 355a3105777SAkhil Goyal }; 356a3105777SAkhil Goyal 357a3105777SAkhil Goyal struct ip_reassembly_test_packet pkt_ipv4_udp_p2 = { 358a3105777SAkhil Goyal .len = 4482, 359a3105777SAkhil Goyal .l4_offset = 20, 360a3105777SAkhil Goyal .data = { 361a3105777SAkhil Goyal /* IP */ 362a3105777SAkhil Goyal 0x45, 0x00, 0x11, 0x82, 0x00, 0x02, 0x00, 0x00, 363a3105777SAkhil Goyal 0x40, 0x11, 0x5a, 0x66, 0x0d, 0x00, 0x00, 0x02, 364a3105777SAkhil Goyal 0x02, 0x00, 0x00, 0x02, 365a3105777SAkhil Goyal 366a3105777SAkhil Goyal /* UDP */ 367a3105777SAkhil Goyal 0x08, 0x00, 0x27, 0x10, 0x11, 0x6e, 0x16, 0x76, 368a3105777SAkhil Goyal }, 369a3105777SAkhil Goyal }; 370a3105777SAkhil Goyal 371a3105777SAkhil Goyal struct ip_reassembly_test_packet pkt_ipv4_udp_p2_f1 = { 372a3105777SAkhil Goyal .len = 1420, 373a3105777SAkhil Goyal .l4_offset = 20, 374a3105777SAkhil Goyal .data = { 375a3105777SAkhil Goyal /* IP */ 376a3105777SAkhil Goyal 0x45, 0x00, 0x05, 0x8c, 0x00, 0x02, 0x20, 0x00, 377a3105777SAkhil Goyal 0x40, 0x11, 0x46, 0x5c, 0x0d, 0x00, 0x00, 0x02, 378a3105777SAkhil Goyal 0x02, 0x00, 0x00, 0x02, 379a3105777SAkhil Goyal 380a3105777SAkhil Goyal /* UDP */ 381a3105777SAkhil Goyal 0x08, 0x00, 0x27, 0x10, 0x11, 0x6e, 0x16, 0x76, 382a3105777SAkhil Goyal }, 383a3105777SAkhil Goyal }; 384a3105777SAkhil Goyal 385a3105777SAkhil Goyal struct ip_reassembly_test_packet pkt_ipv4_udp_p2_f2 = { 386a3105777SAkhil Goyal .len = 1420, 387a3105777SAkhil Goyal .l4_offset = 20, 388a3105777SAkhil Goyal .data = { 389a3105777SAkhil Goyal /* IP */ 390a3105777SAkhil Goyal 0x45, 0x00, 0x05, 0x8c, 0x00, 0x02, 0x20, 0xaf, 391a3105777SAkhil Goyal 0x40, 0x11, 0x45, 0xad, 0x0d, 0x00, 0x00, 0x02, 392a3105777SAkhil Goyal 0x02, 0x00, 0x00, 0x02, 393a3105777SAkhil Goyal }, 394a3105777SAkhil Goyal }; 395a3105777SAkhil Goyal 396a3105777SAkhil Goyal struct ip_reassembly_test_packet pkt_ipv4_udp_p2_f3 = { 397a3105777SAkhil Goyal .len = 1420, 398a3105777SAkhil Goyal .l4_offset = 20, 399a3105777SAkhil Goyal .data = { 400a3105777SAkhil Goyal /* IP */ 401a3105777SAkhil Goyal 0x45, 0x00, 0x05, 0x8c, 0x00, 0x02, 0x21, 0x5e, 402a3105777SAkhil Goyal 0x40, 0x11, 0x44, 0xfe, 0x0d, 0x00, 0x00, 0x02, 403a3105777SAkhil Goyal 0x02, 0x00, 0x00, 0x02, 404a3105777SAkhil Goyal }, 405a3105777SAkhil Goyal }; 406a3105777SAkhil Goyal 407a3105777SAkhil Goyal struct ip_reassembly_test_packet pkt_ipv4_udp_p2_f4 = { 408a3105777SAkhil Goyal .len = 282, 409a3105777SAkhil Goyal .l4_offset = 20, 410a3105777SAkhil Goyal .data = { 411a3105777SAkhil Goyal /* IP */ 412a3105777SAkhil Goyal 0x45, 0x00, 0x01, 0x1a, 0x00, 0x02, 0x02, 0x0d, 413a3105777SAkhil Goyal 0x40, 0x11, 0x68, 0xc1, 0x0d, 0x00, 0x00, 0x02, 414a3105777SAkhil Goyal 0x02, 0x00, 0x00, 0x02, 415a3105777SAkhil Goyal }, 416a3105777SAkhil Goyal }; 417a3105777SAkhil Goyal 418a3105777SAkhil Goyal struct ip_reassembly_test_packet pkt_ipv4_udp_p3 = { 419a3105777SAkhil Goyal .len = 5782, 420a3105777SAkhil Goyal .l4_offset = 20, 421a3105777SAkhil Goyal .data = { 422a3105777SAkhil Goyal /* IP */ 423a3105777SAkhil Goyal 0x45, 0x00, 0x16, 0x96, 0x00, 0x03, 0x00, 0x00, 424a3105777SAkhil Goyal 0x40, 0x11, 0x55, 0x51, 0x0d, 0x00, 0x00, 0x02, 425a3105777SAkhil Goyal 0x02, 0x00, 0x00, 0x02, 426a3105777SAkhil Goyal 427a3105777SAkhil Goyal /* UDP */ 428a3105777SAkhil Goyal 0x08, 0x00, 0x27, 0x10, 0x16, 0x82, 0xbb, 0xfd, 429a3105777SAkhil Goyal }, 430a3105777SAkhil Goyal }; 431a3105777SAkhil Goyal 432a3105777SAkhil Goyal struct ip_reassembly_test_packet pkt_ipv4_udp_p3_f1 = { 433a3105777SAkhil Goyal .len = 1420, 434a3105777SAkhil Goyal .l4_offset = 20, 435a3105777SAkhil Goyal .data = { 436a3105777SAkhil Goyal /* IP */ 437a3105777SAkhil Goyal 0x45, 0x00, 0x05, 0x8c, 0x00, 0x03, 0x20, 0x00, 438a3105777SAkhil Goyal 0x40, 0x11, 0x46, 0x5b, 0x0d, 0x00, 0x00, 0x02, 439a3105777SAkhil Goyal 0x02, 0x00, 0x00, 0x02, 440a3105777SAkhil Goyal 441a3105777SAkhil Goyal /* UDP */ 442a3105777SAkhil Goyal 0x80, 0x00, 0x27, 0x10, 0x16, 0x82, 0xbb, 0xfd, 443a3105777SAkhil Goyal }, 444a3105777SAkhil Goyal }; 445a3105777SAkhil Goyal 446a3105777SAkhil Goyal struct ip_reassembly_test_packet pkt_ipv4_udp_p3_f2 = { 447a3105777SAkhil Goyal .len = 1420, 448a3105777SAkhil Goyal .l4_offset = 20, 449a3105777SAkhil Goyal .data = { 450a3105777SAkhil Goyal /* IP */ 451a3105777SAkhil Goyal 0x45, 0x00, 0x05, 0x8c, 0x00, 0x03, 0x20, 0xaf, 452a3105777SAkhil Goyal 0x40, 0x11, 0x45, 0xac, 0x0d, 0x00, 0x00, 0x02, 453a3105777SAkhil Goyal 0x02, 0x00, 0x00, 0x02, 454a3105777SAkhil Goyal }, 455a3105777SAkhil Goyal }; 456a3105777SAkhil Goyal 457a3105777SAkhil Goyal struct ip_reassembly_test_packet pkt_ipv4_udp_p3_f3 = { 458a3105777SAkhil Goyal .len = 1420, 459a3105777SAkhil Goyal .l4_offset = 20, 460a3105777SAkhil Goyal .data = { 461a3105777SAkhil Goyal /* IP */ 462a3105777SAkhil Goyal 0x45, 0x00, 0x05, 0x8c, 0x00, 0x03, 0x21, 0x5e, 463a3105777SAkhil Goyal 0x40, 0x11, 0x44, 0xfd, 0x0d, 0x00, 0x00, 0x02, 464a3105777SAkhil Goyal 0x02, 0x00, 0x00, 0x02, 465a3105777SAkhil Goyal }, 466a3105777SAkhil Goyal }; 467a3105777SAkhil Goyal 468a3105777SAkhil Goyal struct ip_reassembly_test_packet pkt_ipv4_udp_p3_f4 = { 469a3105777SAkhil Goyal .len = 1420, 470a3105777SAkhil Goyal .l4_offset = 20, 471a3105777SAkhil Goyal .data = { 472a3105777SAkhil Goyal /* IP */ 473a3105777SAkhil Goyal 0x45, 0x00, 0x05, 0x8c, 0x00, 0x03, 0x22, 0x0d, 474a3105777SAkhil Goyal 0x40, 0x11, 0x44, 0x4e, 0x0d, 0x00, 0x00, 0x02, 475a3105777SAkhil Goyal 0x02, 0x00, 0x00, 0x02, 476a3105777SAkhil Goyal }, 477a3105777SAkhil Goyal }; 478a3105777SAkhil Goyal 479a3105777SAkhil Goyal struct ip_reassembly_test_packet pkt_ipv4_udp_p3_f5 = { 480a3105777SAkhil Goyal .len = 182, 481a3105777SAkhil Goyal .l4_offset = 20, 482a3105777SAkhil Goyal .data = { 483a3105777SAkhil Goyal /* IP */ 484a3105777SAkhil Goyal 0x45, 0x00, 0x00, 0xb6, 0x00, 0x03, 0x02, 0xbc, 485a3105777SAkhil Goyal 0x40, 0x11, 0x68, 0x75, 0x0d, 0x00, 0x00, 0x02, 486a3105777SAkhil Goyal 0x02, 0x00, 0x00, 0x02, 487a3105777SAkhil Goyal }, 488a3105777SAkhil Goyal }; 489a3105777SAkhil Goyal 490a3105777SAkhil Goyal static inline void 491a3105777SAkhil Goyal test_vector_payload_populate(struct ip_reassembly_test_packet *pkt, 49215ccc647SNithin Dabilpuram bool first_frag, uint16_t extra_data, uint16_t extra_data_sum) 493a3105777SAkhil Goyal { 49415ccc647SNithin Dabilpuram bool is_ipv6 = ((pkt->data[0] >> 4) == 0x6); 495a3105777SAkhil Goyal uint32_t i = pkt->l4_offset; 49615ccc647SNithin Dabilpuram uint16_t len, off; 49715ccc647SNithin Dabilpuram size_t ext_len = 0; 49815ccc647SNithin Dabilpuram int proto; 499a3105777SAkhil Goyal 500a3105777SAkhil Goyal /** 501a3105777SAkhil Goyal * For non-fragmented packets and first frag, skip 8 bytes from 502a3105777SAkhil Goyal * l4_offset for UDP header. 503a3105777SAkhil Goyal */ 504a3105777SAkhil Goyal if (first_frag) 505a3105777SAkhil Goyal i += 8; 506a3105777SAkhil Goyal 50715ccc647SNithin Dabilpuram /* Fixup header and checksum */ 50815ccc647SNithin Dabilpuram if (extra_data || extra_data_sum) { 50915ccc647SNithin Dabilpuram if (is_ipv6) { 51015ccc647SNithin Dabilpuram struct rte_ipv6_hdr *hdr = (struct rte_ipv6_hdr *)pkt->data; 51115ccc647SNithin Dabilpuram struct rte_ipv6_fragment_ext *frag_ext; 51215ccc647SNithin Dabilpuram uint8_t *p = pkt->data; 51315ccc647SNithin Dabilpuram uint16_t old_off; 51415ccc647SNithin Dabilpuram 51515ccc647SNithin Dabilpuram len = rte_be_to_cpu_16(hdr->payload_len) + extra_data; 51615ccc647SNithin Dabilpuram hdr->payload_len = rte_cpu_to_be_16(len); 51715ccc647SNithin Dabilpuram 51815ccc647SNithin Dabilpuram /* Find frag extension header to add to frag offset */ 51915ccc647SNithin Dabilpuram if (extra_data_sum) { 52015ccc647SNithin Dabilpuram proto = hdr->proto; 52115ccc647SNithin Dabilpuram p += sizeof(struct rte_ipv6_hdr); 522*0151b807SStephen Hemminger while (proto != IPPROTO_FRAGMENT) { 523*0151b807SStephen Hemminger proto = rte_ipv6_get_next_ext(p, proto, &ext_len); 524*0151b807SStephen Hemminger if (proto < 0) 525*0151b807SStephen Hemminger break; 52615ccc647SNithin Dabilpuram p += ext_len; 527*0151b807SStephen Hemminger } 52815ccc647SNithin Dabilpuram /* Found fragment header, update the frag offset */ 52915ccc647SNithin Dabilpuram if (proto == IPPROTO_FRAGMENT) { 53015ccc647SNithin Dabilpuram frag_ext = (struct rte_ipv6_fragment_ext *)p; 53115ccc647SNithin Dabilpuram old_off = rte_be_to_cpu_16(frag_ext->frag_data); 53215ccc647SNithin Dabilpuram off = old_off & 0xFFF8; 53315ccc647SNithin Dabilpuram off += extra_data_sum; 53415ccc647SNithin Dabilpuram frag_ext->frag_data = rte_cpu_to_be_16(off | 53515ccc647SNithin Dabilpuram (old_off & 0x7)); 53615ccc647SNithin Dabilpuram } 53715ccc647SNithin Dabilpuram } 53815ccc647SNithin Dabilpuram } else { 53915ccc647SNithin Dabilpuram struct rte_ipv4_hdr *hdr = (struct rte_ipv4_hdr *)pkt->data; 54015ccc647SNithin Dabilpuram uint16_t old_off = rte_be_to_cpu_16(hdr->fragment_offset); 54115ccc647SNithin Dabilpuram 54215ccc647SNithin Dabilpuram len = rte_be_to_cpu_16(hdr->total_length) + extra_data; 54315ccc647SNithin Dabilpuram off = old_off & 0x1FFF; 54415ccc647SNithin Dabilpuram off += (extra_data_sum >> 3); 54515ccc647SNithin Dabilpuram 54615ccc647SNithin Dabilpuram hdr->total_length = rte_cpu_to_be_16(len); 54715ccc647SNithin Dabilpuram hdr->fragment_offset = rte_cpu_to_be_16(off | (old_off & 0xe000)); 54815ccc647SNithin Dabilpuram hdr->hdr_checksum = 0; 54915ccc647SNithin Dabilpuram hdr->hdr_checksum = rte_ipv4_cksum(hdr); 55015ccc647SNithin Dabilpuram } 55115ccc647SNithin Dabilpuram pkt->len += extra_data; 55215ccc647SNithin Dabilpuram } 55315ccc647SNithin Dabilpuram 554a3105777SAkhil Goyal for (; i < pkt->len; i++) 555a3105777SAkhil Goyal pkt->data[i] = 0x58; 556a3105777SAkhil Goyal } 557a3105777SAkhil Goyal 558a3105777SAkhil Goyal struct ipsec_test_data conf_aes_128_gcm = { 559a3105777SAkhil Goyal .key = { 560a3105777SAkhil Goyal .data = { 561a3105777SAkhil Goyal 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, 562a3105777SAkhil Goyal 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08 563a3105777SAkhil Goyal }, 564a3105777SAkhil Goyal }, 565a3105777SAkhil Goyal 566a3105777SAkhil Goyal .salt = { 567a3105777SAkhil Goyal .data = { 568a3105777SAkhil Goyal 0xca, 0xfe, 0xba, 0xbe 569a3105777SAkhil Goyal }, 570a3105777SAkhil Goyal .len = 4, 571a3105777SAkhil Goyal }, 572a3105777SAkhil Goyal 573a3105777SAkhil Goyal .iv = { 574a3105777SAkhil Goyal .data = { 575a3105777SAkhil Goyal 0xfa, 0xce, 0xdb, 0xad, 0xde, 0xca, 0xf8, 0x88 576a3105777SAkhil Goyal }, 577a3105777SAkhil Goyal }, 578a3105777SAkhil Goyal 579a3105777SAkhil Goyal .ipsec_xform = { 580a3105777SAkhil Goyal .spi = 0xa5f8, 581a3105777SAkhil Goyal .salt = 0xbebafeca, 582a3105777SAkhil Goyal .options.esn = 0, 583a3105777SAkhil Goyal .options.udp_encap = 0, 584a3105777SAkhil Goyal .options.copy_dscp = 0, 585a3105777SAkhil Goyal .options.copy_flabel = 0, 586a3105777SAkhil Goyal .options.copy_df = 0, 587a3105777SAkhil Goyal .options.dec_ttl = 0, 588a3105777SAkhil Goyal .options.ecn = 0, 589a3105777SAkhil Goyal .options.stats = 0, 590a3105777SAkhil Goyal .options.tunnel_hdr_verify = 0, 591a3105777SAkhil Goyal .options.ip_csum_enable = 0, 592a3105777SAkhil Goyal .options.l4_csum_enable = 0, 593a3105777SAkhil Goyal .options.ip_reassembly_en = 1, 594a3105777SAkhil Goyal .direction = RTE_SECURITY_IPSEC_SA_DIR_EGRESS, 595a3105777SAkhil Goyal .proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP, 596a3105777SAkhil Goyal .mode = RTE_SECURITY_IPSEC_SA_MODE_TUNNEL, 597a3105777SAkhil Goyal .tunnel.type = RTE_SECURITY_IPSEC_TUNNEL_IPV4, 598a3105777SAkhil Goyal .replay_win_sz = 0, 599a3105777SAkhil Goyal }, 600a3105777SAkhil Goyal 601a3105777SAkhil Goyal .aead = true, 602a3105777SAkhil Goyal 603a3105777SAkhil Goyal .xform = { 604a3105777SAkhil Goyal .aead = { 605a3105777SAkhil Goyal .next = NULL, 606a3105777SAkhil Goyal .type = RTE_CRYPTO_SYM_XFORM_AEAD, 607a3105777SAkhil Goyal .aead = { 608a3105777SAkhil Goyal .op = RTE_CRYPTO_AEAD_OP_ENCRYPT, 609a3105777SAkhil Goyal .algo = RTE_CRYPTO_AEAD_AES_GCM, 610a3105777SAkhil Goyal .key.length = 16, 611a3105777SAkhil Goyal .iv.length = 12, 612a3105777SAkhil Goyal .iv.offset = 0, 613a3105777SAkhil Goyal .digest_length = 16, 614a3105777SAkhil Goyal .aad_length = 12, 615a3105777SAkhil Goyal }, 616a3105777SAkhil Goyal }, 617a3105777SAkhil Goyal }, 618a3105777SAkhil Goyal }; 619a3105777SAkhil Goyal 620a3105777SAkhil Goyal struct ipsec_test_data conf_aes_128_gcm_v6_tunnel = { 621a3105777SAkhil Goyal .key = { 622a3105777SAkhil Goyal .data = { 623a3105777SAkhil Goyal 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, 624a3105777SAkhil Goyal 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08 625a3105777SAkhil Goyal }, 626a3105777SAkhil Goyal }, 627a3105777SAkhil Goyal 628a3105777SAkhil Goyal .salt = { 629a3105777SAkhil Goyal .data = { 630a3105777SAkhil Goyal 0xca, 0xfe, 0xba, 0xbe 631a3105777SAkhil Goyal }, 632a3105777SAkhil Goyal .len = 4, 633a3105777SAkhil Goyal }, 634a3105777SAkhil Goyal 635a3105777SAkhil Goyal .iv = { 636a3105777SAkhil Goyal .data = { 637a3105777SAkhil Goyal 0xfa, 0xce, 0xdb, 0xad, 0xde, 0xca, 0xf8, 0x88 638a3105777SAkhil Goyal }, 639a3105777SAkhil Goyal }, 640a3105777SAkhil Goyal 641a3105777SAkhil Goyal .ipsec_xform = { 642a3105777SAkhil Goyal .spi = 0xa5f8, 643a3105777SAkhil Goyal .salt = 0xbebafeca, 644a3105777SAkhil Goyal .options.esn = 0, 645a3105777SAkhil Goyal .options.udp_encap = 0, 646a3105777SAkhil Goyal .options.copy_dscp = 0, 647a3105777SAkhil Goyal .options.copy_flabel = 0, 648a3105777SAkhil Goyal .options.copy_df = 0, 649a3105777SAkhil Goyal .options.dec_ttl = 0, 650a3105777SAkhil Goyal .options.ecn = 0, 651a3105777SAkhil Goyal .options.stats = 0, 652a3105777SAkhil Goyal .options.tunnel_hdr_verify = 0, 653a3105777SAkhil Goyal .options.ip_csum_enable = 0, 654a3105777SAkhil Goyal .options.l4_csum_enable = 0, 655a3105777SAkhil Goyal .options.ip_reassembly_en = 1, 656a3105777SAkhil Goyal .direction = RTE_SECURITY_IPSEC_SA_DIR_EGRESS, 657a3105777SAkhil Goyal .proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP, 658a3105777SAkhil Goyal .mode = RTE_SECURITY_IPSEC_SA_MODE_TUNNEL, 659a3105777SAkhil Goyal .tunnel.type = RTE_SECURITY_IPSEC_TUNNEL_IPV4, 660a3105777SAkhil Goyal .replay_win_sz = 0, 661a3105777SAkhil Goyal }, 662a3105777SAkhil Goyal 663a3105777SAkhil Goyal .aead = true, 664a3105777SAkhil Goyal 665a3105777SAkhil Goyal .xform = { 666a3105777SAkhil Goyal .aead = { 667a3105777SAkhil Goyal .next = NULL, 668a3105777SAkhil Goyal .type = RTE_CRYPTO_SYM_XFORM_AEAD, 669a3105777SAkhil Goyal .aead = { 670a3105777SAkhil Goyal .op = RTE_CRYPTO_AEAD_OP_ENCRYPT, 671a3105777SAkhil Goyal .algo = RTE_CRYPTO_AEAD_AES_GCM, 672a3105777SAkhil Goyal .key.length = 16, 673a3105777SAkhil Goyal .iv.length = 12, 674a3105777SAkhil Goyal .iv.offset = 0, 675a3105777SAkhil Goyal .digest_length = 16, 676a3105777SAkhil Goyal .aad_length = 12, 677a3105777SAkhil Goyal }, 678a3105777SAkhil Goyal }, 679a3105777SAkhil Goyal }, 680a3105777SAkhil Goyal }; 681a3105777SAkhil Goyal 68219d7fcc5SRahul Bhansali const struct ip_pkt_vector ipv4_vector = { 68319d7fcc5SRahul Bhansali .sa_data = &conf_aes_128_gcm, 68419d7fcc5SRahul Bhansali .full_pkt = &pkt_ipv4_udp, 68519d7fcc5SRahul Bhansali .burst = false, 68619d7fcc5SRahul Bhansali }; 68719d7fcc5SRahul Bhansali 688a3105777SAkhil Goyal const struct reassembly_vector ipv4_2frag_vector = { 689a3105777SAkhil Goyal .sa_data = &conf_aes_128_gcm, 690a3105777SAkhil Goyal .full_pkt = &pkt_ipv4_udp_p1, 691a3105777SAkhil Goyal .frags[0] = &pkt_ipv4_udp_p1_f1, 692a3105777SAkhil Goyal .frags[1] = &pkt_ipv4_udp_p1_f2, 693a3105777SAkhil Goyal .nb_frags = 2, 694a3105777SAkhil Goyal .burst = false, 695a3105777SAkhil Goyal }; 696a3105777SAkhil Goyal 697a3105777SAkhil Goyal const struct reassembly_vector ipv6_2frag_vector = { 698a3105777SAkhil Goyal .sa_data = &conf_aes_128_gcm_v6_tunnel, 699a3105777SAkhil Goyal .full_pkt = &pkt_ipv6_udp_p1, 700a3105777SAkhil Goyal .frags[0] = &pkt_ipv6_udp_p1_f1, 701a3105777SAkhil Goyal .frags[1] = &pkt_ipv6_udp_p1_f2, 702a3105777SAkhil Goyal .nb_frags = 2, 703a3105777SAkhil Goyal .burst = false, 704a3105777SAkhil Goyal }; 705a3105777SAkhil Goyal 706a3105777SAkhil Goyal const struct reassembly_vector ipv4_4frag_vector = { 707a3105777SAkhil Goyal .sa_data = &conf_aes_128_gcm, 708a3105777SAkhil Goyal .full_pkt = &pkt_ipv4_udp_p2, 709a3105777SAkhil Goyal .frags[0] = &pkt_ipv4_udp_p2_f1, 710a3105777SAkhil Goyal .frags[1] = &pkt_ipv4_udp_p2_f2, 711a3105777SAkhil Goyal .frags[2] = &pkt_ipv4_udp_p2_f3, 712a3105777SAkhil Goyal .frags[3] = &pkt_ipv4_udp_p2_f4, 713a3105777SAkhil Goyal .nb_frags = 4, 714a3105777SAkhil Goyal .burst = false, 715a3105777SAkhil Goyal }; 716a3105777SAkhil Goyal 717a3105777SAkhil Goyal const struct reassembly_vector ipv6_4frag_vector = { 718a3105777SAkhil Goyal .sa_data = &conf_aes_128_gcm_v6_tunnel, 719a3105777SAkhil Goyal .full_pkt = &pkt_ipv6_udp_p2, 720a3105777SAkhil Goyal .frags[0] = &pkt_ipv6_udp_p2_f1, 721a3105777SAkhil Goyal .frags[1] = &pkt_ipv6_udp_p2_f2, 722a3105777SAkhil Goyal .frags[2] = &pkt_ipv6_udp_p2_f3, 723a3105777SAkhil Goyal .frags[3] = &pkt_ipv6_udp_p2_f4, 724a3105777SAkhil Goyal .nb_frags = 4, 725a3105777SAkhil Goyal .burst = false, 726a3105777SAkhil Goyal }; 727a3105777SAkhil Goyal const struct reassembly_vector ipv4_5frag_vector = { 728a3105777SAkhil Goyal .sa_data = &conf_aes_128_gcm, 729a3105777SAkhil Goyal .full_pkt = &pkt_ipv4_udp_p3, 730a3105777SAkhil Goyal .frags[0] = &pkt_ipv4_udp_p3_f1, 731a3105777SAkhil Goyal .frags[1] = &pkt_ipv4_udp_p3_f2, 732a3105777SAkhil Goyal .frags[2] = &pkt_ipv4_udp_p3_f3, 733a3105777SAkhil Goyal .frags[3] = &pkt_ipv4_udp_p3_f4, 734a3105777SAkhil Goyal .frags[4] = &pkt_ipv4_udp_p3_f5, 735a3105777SAkhil Goyal .nb_frags = 5, 736a3105777SAkhil Goyal .burst = false, 737a3105777SAkhil Goyal }; 738a3105777SAkhil Goyal const struct reassembly_vector ipv6_5frag_vector = { 739a3105777SAkhil Goyal .sa_data = &conf_aes_128_gcm_v6_tunnel, 740a3105777SAkhil Goyal .full_pkt = &pkt_ipv6_udp_p3, 741a3105777SAkhil Goyal .frags[0] = &pkt_ipv6_udp_p3_f1, 742a3105777SAkhil Goyal .frags[1] = &pkt_ipv6_udp_p3_f2, 743a3105777SAkhil Goyal .frags[2] = &pkt_ipv6_udp_p3_f3, 744a3105777SAkhil Goyal .frags[3] = &pkt_ipv6_udp_p3_f4, 745a3105777SAkhil Goyal .frags[4] = &pkt_ipv6_udp_p3_f5, 746a3105777SAkhil Goyal .nb_frags = 5, 747a3105777SAkhil Goyal .burst = false, 748a3105777SAkhil Goyal }; 749a3105777SAkhil Goyal /* Negative test cases. */ 750a3105777SAkhil Goyal const struct reassembly_vector ipv4_incomplete_vector = { 751a3105777SAkhil Goyal .sa_data = &conf_aes_128_gcm, 752a3105777SAkhil Goyal .full_pkt = &pkt_ipv4_udp_p2, 753a3105777SAkhil Goyal .frags[0] = &pkt_ipv4_udp_p2_f1, 754a3105777SAkhil Goyal .frags[1] = &pkt_ipv4_udp_p2_f2, 755a3105777SAkhil Goyal .nb_frags = 2, 756a3105777SAkhil Goyal .burst = false, 757a3105777SAkhil Goyal }; 758a3105777SAkhil Goyal const struct reassembly_vector ipv4_overlap_vector = { 759a3105777SAkhil Goyal .sa_data = &conf_aes_128_gcm, 760a3105777SAkhil Goyal .full_pkt = &pkt_ipv4_udp_p1, 761a3105777SAkhil Goyal .frags[0] = &pkt_ipv4_udp_p1_f1, 762a3105777SAkhil Goyal .frags[1] = &pkt_ipv4_udp_p1_f1, /* Overlap */ 763a3105777SAkhil Goyal .frags[2] = &pkt_ipv4_udp_p1_f2, 764a3105777SAkhil Goyal .nb_frags = 3, 765a3105777SAkhil Goyal .burst = false, 766a3105777SAkhil Goyal }; 767a3105777SAkhil Goyal const struct reassembly_vector ipv4_out_of_order_vector = { 768a3105777SAkhil Goyal .sa_data = &conf_aes_128_gcm, 769a3105777SAkhil Goyal .full_pkt = &pkt_ipv4_udp_p2, 770a3105777SAkhil Goyal .frags[0] = &pkt_ipv4_udp_p2_f1, 771a3105777SAkhil Goyal .frags[1] = &pkt_ipv4_udp_p2_f3, 772a3105777SAkhil Goyal .frags[2] = &pkt_ipv4_udp_p2_f4, 773a3105777SAkhil Goyal .frags[3] = &pkt_ipv4_udp_p2_f2, /* out of order */ 774a3105777SAkhil Goyal .nb_frags = 4, 775a3105777SAkhil Goyal .burst = false, 776a3105777SAkhil Goyal }; 777a3105777SAkhil Goyal const struct reassembly_vector ipv4_4frag_burst_vector = { 778a3105777SAkhil Goyal .sa_data = &conf_aes_128_gcm, 779a3105777SAkhil Goyal .full_pkt = &pkt_ipv4_udp_p2, 780a3105777SAkhil Goyal .frags[0] = &pkt_ipv4_udp_p2_f1, 781a3105777SAkhil Goyal .frags[1] = &pkt_ipv4_udp_p2_f2, 782a3105777SAkhil Goyal .frags[2] = &pkt_ipv4_udp_p2_f3, 783a3105777SAkhil Goyal .frags[3] = &pkt_ipv4_udp_p2_f4, 784a3105777SAkhil Goyal .nb_frags = 4, 785a3105777SAkhil Goyal .burst = true, 786a3105777SAkhil Goyal }; 787a3105777SAkhil Goyal 78886e2487cSAkhil Goyal #endif 789