aboutsummaryrefslogtreecommitdiffstats
path: root/examples/vhost
diff options
context:
space:
mode:
authorRicardo Salveti <ricardo.salveti@linaro.org>2016-07-18 15:30:06 -0300
committerChristian Ehrhardt <christian.ehrhardt@canonical.com>2016-07-19 08:26:18 +0200
commit8be94df6e9f5f70516cb86d82dd04fefaa0fe8b3 (patch)
treeb055d508e145ddc35943c4a083aa846855c92732 /examples/vhost
parentddb3f4884bd4cdb8659fb8326c27986a5c832ade (diff)
Imported Upstream version 16.07-rc2
Change-Id: Ie9e8ec528a2a0dace085c5e44aa7fa3b489d4ba0 Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org> Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'examples/vhost')
-rw-r--r--examples/vhost/main.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 3aff2cc8..3b98f429 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -332,8 +332,11 @@ port_init(uint8_t port)
rx_rings = (uint16_t)dev_info.max_rx_queues;
/* Configure ethernet device. */
retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
- if (retval != 0)
+ if (retval != 0) {
+ RTE_LOG(ERR, VHOST_PORT, "Failed to configure port %u: %s.\n",
+ port, strerror(-retval));
return retval;
+ }
/* Setup the queues. */
for (q = 0; q < rx_rings; q ++) {
@@ -341,21 +344,30 @@ port_init(uint8_t port)
rte_eth_dev_socket_id(port),
rxconf,
mbuf_pool);
- if (retval < 0)
+ if (retval < 0) {
+ RTE_LOG(ERR, VHOST_PORT,
+ "Failed to setup rx queue %u of port %u: %s.\n",
+ q, port, strerror(-retval));
return retval;
+ }
}
for (q = 0; q < tx_rings; q ++) {
retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
rte_eth_dev_socket_id(port),
txconf);
- if (retval < 0)
+ if (retval < 0) {
+ RTE_LOG(ERR, VHOST_PORT,
+ "Failed to setup tx queue %u of port %u: %s.\n",
+ q, port, strerror(-retval));
return retval;
+ }
}
/* Start the device. */
retval = rte_eth_dev_start(port);
if (retval < 0) {
- RTE_LOG(ERR, VHOST_DATA, "Failed to start the device.\n");
+ RTE_LOG(ERR, VHOST_PORT, "Failed to start port %u: %s\n",
+ port, strerror(-retval));
return retval;
}