mbuf: add a copy routine
[dpdk.git] / app / test / test_event_eth_rx_adapter.c
index 1d3be82..dd3bce7 100644 (file)
@@ -45,7 +45,9 @@ port_init_common(uint16_t port, const struct rte_eth_conf *port_conf,
 
        retval = rte_eth_dev_configure(port, 0, 0, port_conf);
 
-       rte_eth_dev_info_get(port, &dev_info);
+       retval = rte_eth_dev_info_get(port, &dev_info);
+       if (retval != 0)
+               return retval;
 
        default_params.rx_rings = RTE_MIN(dev_info.max_rx_queues,
                                        MAX_NUM_RX_QUEUE);
@@ -78,8 +80,10 @@ port_init_common(uint16_t port, const struct rte_eth_conf *port_conf,
                return retval;
 
        /* Display the port MAC address. */
-       struct ether_addr addr;
-       rte_eth_macaddr_get(port, &addr);
+       struct rte_ether_addr addr;
+       retval = rte_eth_macaddr_get(port, &addr);
+       if (retval < 0)
+               return retval;
        printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
                           " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
                        (unsigned int)port,
@@ -88,7 +92,9 @@ port_init_common(uint16_t port, const struct rte_eth_conf *port_conf,
                        addr.addr_bytes[4], addr.addr_bytes[5]);
 
        /* Enable RX in promiscuous mode for the Ethernet device. */
-       rte_eth_promiscuous_enable(port);
+       retval = rte_eth_promiscuous_enable(port);
+       if (retval != 0)
+               return retval;
 
        return 0;
 }
@@ -479,7 +485,8 @@ adapter_multi_eth_add_del(void)
        /* add the max port for rx_adapter */
        port_index = rte_eth_dev_count_total();
        for (; port_index < RTE_MAX_ETHPORTS; port_index += 1) {
-               sprintf(driver_name, "%s%u", "net_null", drv_id);
+               snprintf(driver_name, sizeof(driver_name), "%s%u", "net_null",
+                               drv_id);
                err = rte_vdev_init(driver_name, NULL);
                TEST_ASSERT(err == 0, "Failed driver %s got %d",
                driver_name, err);