- /* Handle IP header */
- if (m->ol_flags & PKT_TX_IPV4) {
- const struct ipv4_hdr *iphe4;
-
- iphe4 = (const struct ipv4_hdr *)(tsoh + nh_off);
- rte_memcpy(&packet_id, &iphe4->packet_id, sizeof(uint16_t));
- packet_id = rte_be_to_cpu_16(packet_id);
- } else if (m->ol_flags & PKT_TX_IPV6) {
- packet_id = 0;
- } else {
- return EINVAL;
- }
+ /*
+ * Handle IP header. Tx prepare has debug-only checks that offload flags
+ * are correctly filled in in TSO mbuf. Use zero IPID if there is no
+ * IPv4 flag. If the packet is still IPv4, HW will simply start from
+ * zero IPID.
+ */
+ if (m->ol_flags & PKT_TX_IPV4)
+ packet_id = sfc_tso_ip4_get_ipid(tsoh, nh_off);