* [dpdk-dev] [PATCH 1/3] net/vhost: fix incorrect log info
2018-02-12 3:20 [dpdk-dev] [PATCH 0/3] Some fixes on virtio-user/vhost Jianfeng Tan
@ 2018-02-12 3:20 ` Jianfeng Tan
2018-02-12 3:20 ` [dpdk-dev] [PATCH 2/3] net/virtio-user: fix not working with vhost kernel Jianfeng Tan
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Jianfeng Tan @ 2018-02-12 3:20 UTC (permalink / raw)
To: dev; +Cc: yliu, maxime.coquelin, tiwei.bie, Jianfeng Tan, stable, mtetsuyah
The original words are not accurate. For example, as destroy_device
callback gets called, it does not necessarily mean that the connection
is closed.
Fixes: ee584e9710b9 ("vhost: add driver on top of the library")
Cc: stable@dpdk.org
Cc: mtetsuyah@gmail.com
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
---
drivers/net/vhost/rte_eth_vhost.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index 4e541e3..3aae01c 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -607,7 +607,7 @@ new_device(int vid)
rte_atomic32_set(&internal->dev_attached, 1);
update_queuing_status(eth_dev);
- RTE_LOG(INFO, PMD, "New connection established\n");
+ RTE_LOG(INFO, PMD, "Vhost device %d created\n", vid);
_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL);
@@ -661,7 +661,7 @@ destroy_device(int vid)
state->max_vring = 0;
rte_spinlock_unlock(&state->lock);
- RTE_LOG(INFO, PMD, "Connection closed\n");
+ RTE_LOG(INFO, PMD, "Vhost device %d destroyed\n", vid);
_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL);
}
--
2.7.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* [dpdk-dev] [PATCH 2/3] net/virtio-user: fix not working with vhost kernel
2018-02-12 3:20 [dpdk-dev] [PATCH 0/3] Some fixes on virtio-user/vhost Jianfeng Tan
2018-02-12 3:20 ` [dpdk-dev] [PATCH 1/3] net/vhost: fix incorrect log info Jianfeng Tan
@ 2018-02-12 3:20 ` Jianfeng Tan
2018-02-12 3:20 ` [dpdk-dev] [PATCH 3/3] net/virtio-user: fix not proper initialized Jianfeng Tan
2018-02-13 13:32 ` [dpdk-dev] [PATCH 0/3] Some fixes on virtio-user/vhost Maxime Coquelin
3 siblings, 0 replies; 6+ messages in thread
From: Jianfeng Tan @ 2018-02-12 3:20 UTC (permalink / raw)
To: dev; +Cc: yliu, maxime.coquelin, tiwei.bie, Jianfeng Tan, stable
After reset owner in below patch, we failed to set owner before
sending further vhost messages. It is OK with vhost user implemented
DPDK/VPP/Contrail, but it sees "Operation not permitted" error when
used with vhost kernel.
We fix this by setting owner every time the device is started.
Fixes: 0d6a8752ac9d ("net/virtio-user: fix crash as features change")
Cc: stable@dpdk.org
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
---
drivers/net/virtio/virtio_user/virtio_user_dev.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index 3b5f737..b5809ee 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -99,6 +99,9 @@ virtio_user_start_device(struct virtio_user_dev *dev)
uint64_t features;
int ret;
+ /* Do not check return as already done in init, or reset in stop */
+ dev->ops->send_request(dev, VHOST_USER_SET_OWNER, NULL);
+
/* Step 0: tell vhost to create queues */
if (virtio_user_queue_setup(dev, virtio_user_create_queue) < 0)
goto error;
@@ -332,6 +335,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
PMD_INIT_LOG(ERR, "backend set up fails");
return -1;
}
+
if (dev->ops->send_request(dev, VHOST_USER_SET_OWNER, NULL) < 0) {
PMD_INIT_LOG(ERR, "set_owner fails: %s", strerror(errno));
return -1;
--
2.7.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* [dpdk-dev] [PATCH 3/3] net/virtio-user: fix not proper initialized
2018-02-12 3:20 [dpdk-dev] [PATCH 0/3] Some fixes on virtio-user/vhost Jianfeng Tan
2018-02-12 3:20 ` [dpdk-dev] [PATCH 1/3] net/vhost: fix incorrect log info Jianfeng Tan
2018-02-12 3:20 ` [dpdk-dev] [PATCH 2/3] net/virtio-user: fix not working with vhost kernel Jianfeng Tan
@ 2018-02-12 3:20 ` Jianfeng Tan
2018-02-13 13:32 ` [dpdk-dev] [PATCH 0/3] Some fixes on virtio-user/vhost Maxime Coquelin
3 siblings, 0 replies; 6+ messages in thread
From: Jianfeng Tan @ 2018-02-12 3:20 UTC (permalink / raw)
To: dev; +Cc: yliu, maxime.coquelin, tiwei.bie, Jianfeng Tan, stable
intr_handle->fd was wrongly initialized as 0 (usually as the stdio fd)
when virtio-user is used with vhost-kernel. So the interrupt thread
might wrongly treat stdin events as LSC interrupts.
Fixes: 3d4fb6fd2505 ("net/virtio-user: support Rx interrupt")
Cc: stable@dpdk.org
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
---
drivers/net/virtio/virtio_user/virtio_user_dev.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index b5809ee..f90fee9 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -251,6 +251,7 @@ virtio_user_fill_intr_handle(struct virtio_user_dev *dev)
eth_dev->intr_handle->type = RTE_INTR_HANDLE_VDEV;
/* For virtio vdev, no need to read counter for clean */
eth_dev->intr_handle->efd_counter_size = 0;
+ eth_dev->intr_handle->fd = -1;
if (dev->vhostfd >= 0)
eth_dev->intr_handle->fd = dev->vhostfd;
--
2.7.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH 0/3] Some fixes on virtio-user/vhost
2018-02-12 3:20 [dpdk-dev] [PATCH 0/3] Some fixes on virtio-user/vhost Jianfeng Tan
` (2 preceding siblings ...)
2018-02-12 3:20 ` [dpdk-dev] [PATCH 3/3] net/virtio-user: fix not proper initialized Jianfeng Tan
@ 2018-02-13 13:32 ` Maxime Coquelin
2018-02-13 17:55 ` Thomas Monjalon
3 siblings, 1 reply; 6+ messages in thread
From: Maxime Coquelin @ 2018-02-13 13:32 UTC (permalink / raw)
To: Jianfeng Tan, dev, Thomas Monjalon; +Cc: yliu, tiwei.bie
On 02/12/2018 04:20 AM, Jianfeng Tan wrote:
> Patch 1: a trivial fix on reword a log message.
> Patch 2: fix the rxq interrupt mode when virtio-user is used
> with vhost kernel.
> Patch 3: a trivial fix on LSC fd init when virtio-user is used
> with vhost kernel.
>
> Jianfeng Tan (3):
> net/vhost: fix incorrect log info
> net/virtio-user: fix not working with vhost kernel
> net/virtio-user: fix not proper initialized
>
> drivers/net/vhost/rte_eth_vhost.c | 4 ++--
> drivers/net/virtio/virtio_user/virtio_user_dev.c | 5 +++++
> 2 files changed, 7 insertions(+), 2 deletions(-)
>
For the series:
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thomas, I would suggest to pick this series for v18.02, as patch 2 fixes
a bug introduced in this release cycle.
Thanks,
Maxime
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH 0/3] Some fixes on virtio-user/vhost
2018-02-13 13:32 ` [dpdk-dev] [PATCH 0/3] Some fixes on virtio-user/vhost Maxime Coquelin
@ 2018-02-13 17:55 ` Thomas Monjalon
0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2018-02-13 17:55 UTC (permalink / raw)
To: Jianfeng Tan; +Cc: dev, Maxime Coquelin, yliu, tiwei.bie
13/02/2018 14:32, Maxime Coquelin:
>
> On 02/12/2018 04:20 AM, Jianfeng Tan wrote:
> > Patch 1: a trivial fix on reword a log message.
> > Patch 2: fix the rxq interrupt mode when virtio-user is used
> > with vhost kernel.
> > Patch 3: a trivial fix on LSC fd init when virtio-user is used
> > with vhost kernel.
> >
> > Jianfeng Tan (3):
> > net/vhost: fix incorrect log info
> > net/virtio-user: fix not working with vhost kernel
> > net/virtio-user: fix not proper initialized
>
> For the series:
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>
> Thomas, I would suggest to pick this series for v18.02, as patch 2 fixes
> a bug introduced in this release cycle.
Applied with these reworded titles:
net/vhost: fix log messages on create/destroy
net/virtio-user: fix start with kernel vhost
net/virtio-user: fix interrupts with kernel vhost
^ permalink raw reply [flat|nested] 6+ messages in thread