event/dlb2: add v2.5 create LDB queue
[dpdk.git] / examples / l3fwd / l3fwd_em.c
index c529dcd..01f8dff 100644 (file)
@@ -579,8 +579,7 @@ em_parse_ptype(struct rte_mbuf *m)
        l3 = (uint8_t *)eth_hdr + sizeof(struct rte_ether_hdr);
        if (ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4)) {
                ipv4_hdr = (struct rte_ipv4_hdr *)l3;
-               hdr_len = (ipv4_hdr->version_ihl & RTE_IPV4_HDR_IHL_MASK) *
-                         RTE_IPV4_IHL_MULTIPLIER;
+               hdr_len = rte_ipv4_hdr_len(ipv4_hdr);
                if (hdr_len == sizeof(struct rte_ipv4_hdr)) {
                        packet_type |= RTE_PTYPE_L3_IPV4;
                        if (ipv4_hdr->next_proto_id == IPPROTO_TCP)
@@ -630,8 +629,6 @@ em_main_loop(__rte_unused void *dummy)
        const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) /
                US_PER_S * BURST_TX_DRAIN_US;
 
-       prev_tsc = 0;
-
        lcore_id = rte_lcore_id();
        qconf = &lcore_conf[lcore_id];
 
@@ -651,9 +648,10 @@ em_main_loop(__rte_unused void *dummy)
                        lcore_id, portid, queueid);
        }
 
-       while (!force_quit) {
+       cur_tsc = rte_rdtsc();
+       prev_tsc = cur_tsc;
 
-               cur_tsc = rte_rdtsc();
+       while (!force_quit) {
 
                /*
                 * TX burst queue drain
@@ -693,6 +691,8 @@ em_main_loop(__rte_unused void *dummy)
                                                        portid, qconf);
 #endif
                }
+
+               cur_tsc = rte_rdtsc();
        }
 
        return 0;