* Receive a burst of packets, and for each packet: * - parse packet, and try to recognize a supported packet type (1) * - if it's not a supported packet type, don't touch the packet, else: * - reprocess the checksum of all supported layers. This is done in SW * or HW, depending on testpmd command line configuration * - if TSO is enabled in testpmd command line, also flag the mbuf for T
| 835 | * OUTER_IP is only useful for tunnel packets. |
| 836 | */ |
| 837 | static bool |
| 838 | pkt_burst_checksum_forward(struct fwd_stream *fs) |
| 839 | { |
| 840 | struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; |
| 841 | #ifdef RTE_LIB_GSO |
| 842 | struct rte_mbuf *gso_segments[GSO_MAX_PKT_BURST]; |
| 843 | struct rte_gso_ctx *gso_ctx; |
| 844 | #endif |
| 845 | struct rte_mbuf **tx_pkts_burst; |
| 846 | struct rte_port *txp; |
| 847 | struct rte_mbuf *m, *p; |
| 848 | struct rte_ether_hdr *eth_hdr; |
| 849 | void *l3_hdr = NULL, *outer_l3_hdr = NULL; /* can be IPv4 or IPv6 */ |
| 850 | #ifdef RTE_LIB_GRO |
| 851 | void **gro_ctx; |
| 852 | uint16_t gro_pkts_num; |
| 853 | uint8_t gro_enable; |
| 854 | #endif |
| 855 | uint16_t nb_rx; |
| 856 | uint16_t nb_prep; |
| 857 | uint16_t i; |
| 858 | uint64_t rx_ol_flags, tx_ol_flags; |
| 859 | uint64_t tx_offloads; |
| 860 | uint32_t rx_bad_ip_csum; |
| 861 | uint32_t rx_bad_l4_csum; |
| 862 | uint32_t rx_bad_outer_l4_csum; |
| 863 | uint32_t rx_bad_outer_ip_csum; |
| 864 | struct testpmd_offload_info info; |
| 865 | |
| 866 | /* receive a burst of packet */ |
| 867 | nb_rx = common_fwd_stream_receive(fs, pkts_burst, nb_pkt_per_burst); |
| 868 | if (unlikely(nb_rx == 0)) { |
| 869 | #ifndef RTE_LIB_GRO |
| 870 | return false; |
| 871 | #else |
| 872 | gro_enable = gro_ports[fs->rx_port].enable; |
| 873 | /* |
| 874 | * Check if packets need to be flushed in the GRO context |
| 875 | * due to a timeout. |
| 876 | * |
| 877 | * Continue only in GRO heavyweight mode and if there are |
| 878 | * packets in the GRO context. |
| 879 | */ |
| 880 | if (!gro_enable || (gro_flush_cycles == GRO_DEFAULT_FLUSH_CYCLES) || |
| 881 | (rte_gro_get_pkt_count(current_fwd_lcore()->gro_ctx) == 0)) |
| 882 | return false; |
| 883 | #endif |
| 884 | } |
| 885 | |
| 886 | rx_bad_ip_csum = 0; |
| 887 | rx_bad_l4_csum = 0; |
| 888 | rx_bad_outer_l4_csum = 0; |
| 889 | rx_bad_outer_ip_csum = 0; |
| 890 | |
| 891 | txp = &ports[fs->tx_port]; |
| 892 | tx_offloads = txp->dev_conf.txmode.offloads; |
| 893 | memset(&info, 0, sizeof(info)); |
| 894 | info.tso_segsz = txp->tso_segsz; |
nothing calls this directly
no test coverage detected