DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] examples/vhost: fix failure without hints
@ 2016-07-01  8:50 Jianfeng Tan
  2016-07-04  3:00 ` Yuanhan Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Jianfeng Tan @ 2016-07-01  8:50 UTC (permalink / raw)
  To: dev; +Cc: yuanhan.liu, huawei.xie, Jianfeng Tan

When the specified cores and memory lie on different numa socket with
physical NIC, vhost fails to set up rx queue, and exits without any
hints. This could leads to confusion of users.

This patch fixes it by adding some error messages when calling ether
APIs returns errors.

Fixes: 4796ad63ba1f ("examples/vhost: import userspace vhost application")

Reported-by: Yulong Pei <yulong.pei@intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
---
 examples/vhost/main.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 3aff2cc..3b98f42 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;
 	}
 
-- 
2.1.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] examples/vhost: fix failure without hints
  2016-07-01  8:50 [dpdk-dev] [PATCH] examples/vhost: fix failure without hints Jianfeng Tan
@ 2016-07-04  3:00 ` Yuanhan Liu
  2016-07-11  2:07   ` Yuanhan Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Yuanhan Liu @ 2016-07-04  3:00 UTC (permalink / raw)
  To: Jianfeng Tan; +Cc: dev, huawei.xie

On Fri, Jul 01, 2016 at 08:50:31AM +0000, Jianfeng Tan wrote:
> When the specified cores and memory lie on different numa socket with
> physical NIC, vhost fails to set up rx queue, and exits without any
> hints. This could leads to confusion of users.
> 
> This patch fixes it by adding some error messages when calling ether
> APIs returns errors.
> 
> Fixes: 4796ad63ba1f ("examples/vhost: import userspace vhost application")

I will not call it a "fix", instead, it's an "enhancement" to me.

> Reported-by: Yulong Pei <yulong.pei@intel.com>

And since it's not a bug, it might be "Suggested-by: ...".

	--yliu

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] examples/vhost: fix failure without hints
  2016-07-04  3:00 ` Yuanhan Liu
@ 2016-07-11  2:07   ` Yuanhan Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Yuanhan Liu @ 2016-07-11  2:07 UTC (permalink / raw)
  To: Jianfeng Tan; +Cc: dev, huawei.xie

On Mon, Jul 04, 2016 at 11:00:13AM +0800, Yuanhan Liu wrote:
> On Fri, Jul 01, 2016 at 08:50:31AM +0000, Jianfeng Tan wrote:
> > When the specified cores and memory lie on different numa socket with
> > physical NIC, vhost fails to set up rx queue, and exits without any
> > hints. This could leads to confusion of users.
> > 
> > This patch fixes it by adding some error messages when calling ether
> > APIs returns errors.
> > 
> > Fixes: 4796ad63ba1f ("examples/vhost: import userspace vhost application")
> 
> I will not call it a "fix", instead, it's an "enhancement" to me.
> 
> > Reported-by: Yulong Pei <yulong.pei@intel.com>
> 
> And since it's not a bug, it might be "Suggested-by: ...".

Applied to dpdk-next-virtio, with some commit log rewords.

Thanks.

	--yliu

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-11  2:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-01  8:50 [dpdk-dev] [PATCH] examples/vhost: fix failure without hints Jianfeng Tan
2016-07-04  3:00 ` Yuanhan Liu
2016-07-11  2:07   ` Yuanhan Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).