examples: check status of getting ethdev info
[dpdk.git] / examples / tep_termination / vxlan_setup.c
index ce7c2e5..8d6514d 100644 (file)
@@ -119,7 +119,11 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 
        pconf->dst_port = udp_port;
 
-       rte_eth_dev_info_get(port, &dev_info);
+       retval = rte_eth_dev_info_get(port, &dev_info);
+       if (retval != 0)
+               rte_exit(EXIT_FAILURE,
+                       "Error during getting device (port %u) info: %s\n",
+                       port, strerror(-retval));
 
        if (dev_info.max_rx_queues > MAX_QUEUES) {
                rte_exit(EXIT_FAILURE,
@@ -313,7 +317,7 @@ vxlan_link(struct vhost_dev *vdev, struct rte_mbuf *m)
                        &app_l2_hdr[portid].d_addr);
        rte_ether_addr_copy(&ports_eth_addr[0],
                        &app_l2_hdr[portid].s_addr);
-       app_l2_hdr[portid].ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv4);
+       app_l2_hdr[portid].ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);
 
        ip = &app_ip_hdr[portid];
        ip->version_ihl = IP_VHL_DEF;