* [dpdk-stable] [PATCH 1/3] net/vhost: fix incorrect log info
[not found] <1518405628-23976-1-git-send-email-jianfeng.tan@intel.com>
@ 2018-02-12 3:20 ` Jianfeng Tan
2018-02-12 3:20 ` [dpdk-stable] [PATCH 2/3] net/virtio-user: fix not working with vhost kernel Jianfeng Tan
2018-02-12 3:20 ` [dpdk-stable] [PATCH 3/3] net/virtio-user: fix not proper initialized Jianfeng Tan
2 siblings, 0 replies; 3+ 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] 3+ messages in thread
* [dpdk-stable] [PATCH 2/3] net/virtio-user: fix not working with vhost kernel
[not found] <1518405628-23976-1-git-send-email-jianfeng.tan@intel.com>
2018-02-12 3:20 ` [dpdk-stable] [PATCH 1/3] net/vhost: fix incorrect log info Jianfeng Tan
@ 2018-02-12 3:20 ` Jianfeng Tan
2018-02-12 3:20 ` [dpdk-stable] [PATCH 3/3] net/virtio-user: fix not proper initialized Jianfeng Tan
2 siblings, 0 replies; 3+ 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] 3+ messages in thread
* [dpdk-stable] [PATCH 3/3] net/virtio-user: fix not proper initialized
[not found] <1518405628-23976-1-git-send-email-jianfeng.tan@intel.com>
2018-02-12 3:20 ` [dpdk-stable] [PATCH 1/3] net/vhost: fix incorrect log info Jianfeng Tan
2018-02-12 3:20 ` [dpdk-stable] [PATCH 2/3] net/virtio-user: fix not working with vhost kernel Jianfeng Tan
@ 2018-02-12 3:20 ` Jianfeng Tan
2 siblings, 0 replies; 3+ 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] 3+ messages in thread
end of thread, other threads:[~2018-02-12 3:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <1518405628-23976-1-git-send-email-jianfeng.tan@intel.com>
2018-02-12 3:20 ` [dpdk-stable] [PATCH 1/3] net/vhost: fix incorrect log info Jianfeng Tan
2018-02-12 3:20 ` [dpdk-stable] [PATCH 2/3] net/virtio-user: fix not working with vhost kernel Jianfeng Tan
2018-02-12 3:20 ` [dpdk-stable] [PATCH 3/3] net/virtio-user: fix not proper initialized Jianfeng Tan
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).