+static inline void enetc_slow_parsing(struct rte_mbuf *m,
+ uint64_t parse_results)
+{
+ m->ol_flags &= ~(PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_GOOD);
+
+ switch (parse_results) {
+ case ENETC_PARSE_ERROR | ENETC_PKT_TYPE_IPV4:
+ m->packet_type = RTE_PTYPE_L2_ETHER |
+ RTE_PTYPE_L3_IPV4;
+ m->ol_flags |= PKT_RX_IP_CKSUM_BAD;
+ return;
+ case ENETC_PARSE_ERROR | ENETC_PKT_TYPE_IPV6:
+ m->packet_type = RTE_PTYPE_L2_ETHER |
+ RTE_PTYPE_L3_IPV6;
+ m->ol_flags |= PKT_RX_IP_CKSUM_BAD;
+ return;
+ case ENETC_PARSE_ERROR | ENETC_PKT_TYPE_IPV4_TCP:
+ m->packet_type = RTE_PTYPE_L2_ETHER |
+ RTE_PTYPE_L3_IPV4 |
+ RTE_PTYPE_L4_TCP;
+ m->ol_flags |= PKT_RX_IP_CKSUM_GOOD |
+ PKT_RX_L4_CKSUM_BAD;
+ return;
+ case ENETC_PARSE_ERROR | ENETC_PKT_TYPE_IPV6_TCP:
+ m->packet_type = RTE_PTYPE_L2_ETHER |
+ RTE_PTYPE_L3_IPV6 |
+ RTE_PTYPE_L4_TCP;
+ m->ol_flags |= PKT_RX_IP_CKSUM_GOOD |
+ PKT_RX_L4_CKSUM_BAD;
+ return;
+ case ENETC_PARSE_ERROR | ENETC_PKT_TYPE_IPV4_UDP:
+ m->packet_type = RTE_PTYPE_L2_ETHER |
+ RTE_PTYPE_L3_IPV4 |
+ RTE_PTYPE_L4_UDP;
+ m->ol_flags |= PKT_RX_IP_CKSUM_GOOD |
+ PKT_RX_L4_CKSUM_BAD;
+ return;
+ case ENETC_PARSE_ERROR | ENETC_PKT_TYPE_IPV6_UDP:
+ m->packet_type = RTE_PTYPE_L2_ETHER |
+ RTE_PTYPE_L3_IPV6 |
+ RTE_PTYPE_L4_UDP;
+ m->ol_flags |= PKT_RX_IP_CKSUM_GOOD |
+ PKT_RX_L4_CKSUM_BAD;
+ return;
+ case ENETC_PARSE_ERROR | ENETC_PKT_TYPE_IPV4_SCTP:
+ m->packet_type = RTE_PTYPE_L2_ETHER |
+ RTE_PTYPE_L3_IPV4 |
+ RTE_PTYPE_L4_SCTP;
+ m->ol_flags |= PKT_RX_IP_CKSUM_GOOD |
+ PKT_RX_L4_CKSUM_BAD;
+ return;
+ case ENETC_PARSE_ERROR | ENETC_PKT_TYPE_IPV6_SCTP:
+ m->packet_type = RTE_PTYPE_L2_ETHER |
+ RTE_PTYPE_L3_IPV6 |
+ RTE_PTYPE_L4_SCTP;
+ m->ol_flags |= PKT_RX_IP_CKSUM_GOOD |
+ PKT_RX_L4_CKSUM_BAD;
+ return;
+ case ENETC_PARSE_ERROR | ENETC_PKT_TYPE_IPV4_ICMP:
+ m->packet_type = RTE_PTYPE_L2_ETHER |
+ RTE_PTYPE_L3_IPV4 |
+ RTE_PTYPE_L4_ICMP;
+ m->ol_flags |= PKT_RX_IP_CKSUM_GOOD |
+ PKT_RX_L4_CKSUM_BAD;
+ return;
+ case ENETC_PARSE_ERROR | ENETC_PKT_TYPE_IPV6_ICMP:
+ m->packet_type = RTE_PTYPE_L2_ETHER |
+ RTE_PTYPE_L3_IPV6 |
+ RTE_PTYPE_L4_ICMP;
+ m->ol_flags |= PKT_RX_IP_CKSUM_GOOD |
+ PKT_RX_L4_CKSUM_BAD;
+ return;
+ /* More switch cases can be added */
+ default:
+ m->packet_type = RTE_PTYPE_UNKNOWN;
+ m->ol_flags |= PKT_RX_IP_CKSUM_UNKNOWN |
+ PKT_RX_L4_CKSUM_UNKNOWN;
+ }
+}
+