| 1338 | } |
| 1339 | |
| 1340 | static int |
| 1341 | nfp_flow_merge_ipv6(__rte_unused struct nfp_app_fw_flower *app_fw_flower, |
| 1342 | struct rte_flow *nfp_flow, |
| 1343 | char **mbuf_off, |
| 1344 | const struct rte_flow_item *item, |
| 1345 | const struct nfp_flow_item_proc *proc, |
| 1346 | bool is_mask, |
| 1347 | bool is_outer_layer) |
| 1348 | { |
| 1349 | uint32_t vtc_flow; |
| 1350 | struct nfp_flower_ipv6 *ipv6; |
| 1351 | const struct rte_ipv6_hdr *hdr; |
| 1352 | struct nfp_flower_meta_tci *meta_tci; |
| 1353 | const struct rte_flow_item_ipv6 *spec; |
| 1354 | const struct rte_flow_item_ipv6 *mask; |
| 1355 | struct nfp_flower_ext_meta *ext_meta = NULL; |
| 1356 | struct nfp_flower_ipv6_udp_tun *ipv6_udp_tun; |
| 1357 | struct nfp_flower_ipv6_gre_tun *ipv6_gre_tun; |
| 1358 | |
| 1359 | spec = item->spec; |
| 1360 | mask = item->mask ? item->mask : proc->mask_default; |
| 1361 | meta_tci = (struct nfp_flower_meta_tci *)nfp_flow->payload.unmasked_data; |
| 1362 | if ((meta_tci->nfp_flow_key_layer & NFP_FLOWER_LAYER_EXT_META) != 0) |
| 1363 | ext_meta = (struct nfp_flower_ext_meta *)(meta_tci + 1); |
| 1364 | |
| 1365 | if (is_outer_layer && nfp_flow_is_tunnel(nfp_flow)) { |
| 1366 | if (spec == NULL) { |
| 1367 | PMD_DRV_LOG(DEBUG, "nfp flow merge ipv6: no item->spec!"); |
| 1368 | return 0; |
| 1369 | } |
| 1370 | |
| 1371 | hdr = is_mask ? &mask->hdr : &spec->hdr; |
| 1372 | |
| 1373 | vtc_flow = rte_be_to_cpu_32(hdr->vtc_flow); |
| 1374 | if (ext_meta != NULL && (rte_be_to_cpu_32(ext_meta->nfp_flow_key_layer2) & |
| 1375 | NFP_FLOWER_LAYER2_GRE) != 0) { |
| 1376 | ipv6_gre_tun = (struct nfp_flower_ipv6_gre_tun *)*mbuf_off; |
| 1377 | |
| 1378 | ipv6_gre_tun->ip_ext.tos = vtc_flow >> RTE_IPV6_HDR_TC_SHIFT; |
| 1379 | ipv6_gre_tun->ip_ext.ttl = hdr->hop_limits; |
| 1380 | memcpy(ipv6_gre_tun->ipv6.ipv6_src, hdr->src_addr, |
| 1381 | sizeof(ipv6_gre_tun->ipv6.ipv6_src)); |
| 1382 | memcpy(ipv6_gre_tun->ipv6.ipv6_dst, hdr->dst_addr, |
| 1383 | sizeof(ipv6_gre_tun->ipv6.ipv6_dst)); |
| 1384 | } else { |
| 1385 | ipv6_udp_tun = (struct nfp_flower_ipv6_udp_tun *)*mbuf_off; |
| 1386 | |
| 1387 | ipv6_udp_tun->ip_ext.tos = vtc_flow >> RTE_IPV6_HDR_TC_SHIFT; |
| 1388 | ipv6_udp_tun->ip_ext.ttl = hdr->hop_limits; |
| 1389 | memcpy(ipv6_udp_tun->ipv6.ipv6_src, hdr->src_addr, |
| 1390 | sizeof(ipv6_udp_tun->ipv6.ipv6_src)); |
| 1391 | memcpy(ipv6_udp_tun->ipv6.ipv6_dst, hdr->dst_addr, |
| 1392 | sizeof(ipv6_udp_tun->ipv6.ipv6_dst)); |
| 1393 | } |
| 1394 | } else { |
| 1395 | if (spec == NULL) { |
| 1396 | PMD_DRV_LOG(DEBUG, "nfp flow merge ipv6: no item->spec!"); |
| 1397 | goto ipv6_end; |
nothing calls this directly
no test coverage detected