examples/ip_frag: fix use of ethdev internal device array
[dpdk.git] / examples / ip_fragmentation / main.c
index 85c0100..1b51bf2 100644 (file)
@@ -357,12 +357,14 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf,
                /* src addr */
                rte_ether_addr_copy(&ports_eth_addr[port_out],
                                &eth_hdr->s_addr);
-               if (ipv6)
+               if (ipv6) {
                        eth_hdr->ether_type =
                                rte_be_to_cpu_16(RTE_ETHER_TYPE_IPV6);
-               else
+               } else {
                        eth_hdr->ether_type =
                                rte_be_to_cpu_16(RTE_ETHER_TYPE_IPV4);
+                       m->ol_flags |= (PKT_TX_IPV4 | PKT_TX_IP_CKSUM);
+               }
        }
 
        len += len2;
@@ -989,7 +991,7 @@ main(int argc, char **argv)
                        if (rte_lcore_is_enabled(lcore_id) == 0)
                                continue;
 
-                       if (queueid >= rte_eth_devices[portid].data->nb_tx_queues)
+                       if (queueid >= dev_info.nb_tx_queues)
                                break;
 
                        socket = (int) rte_lcore_to_socket_id(lcore_id);