* Re: [dpdk-dev] [PATCH] net/virtio-user: fix add pointer checking for rxvq
2018-05-24 13:04 [dpdk-dev] [PATCH] net/virtio-user: fix add pointer checking for rxvq zhiyong.yang
@ 2018-05-24 7:39 ` Maxime Coquelin
2018-05-24 15:51 ` [dpdk-dev] [PATCH v2] net/virtio: " zhiyong.yang
1 sibling, 0 replies; 4+ messages in thread
From: Maxime Coquelin @ 2018-05-24 7:39 UTC (permalink / raw)
To: zhiyong.yang, dev; +Cc: stable, tiwei.bie, lei.a.yao, ferruh.yigit
Hi,
I would use net/virtio prefix instead, as IIUC, the impacted code can
also be called by Virtio PMD.
On 05/24/2018 03:04 PM, zhiyong.yang@intel.com wrote:
> For virtio-user server mode, One use case comes across segmentation fault.
> step 1: Launch vhost side as client firstly.
> step 2: launch virtio-user side as server.
>
> The cause is: after registering virtio_interrupt_handler into
> eal-intr-thread, two threads (main thread and eal-intr-thread) have
> sync issues, so add rxvq pointer checking in function virtio_notify_peers
> to decide if the code can continue.
>
> Fixes: bd8f50a45d0f ("net/virtio-user: support server mode")
> Cc: stable@dpdk.org
> Cc: maxime.coquelin@redhat.com
> Cc: tiwei.bie@intel.com
> Cc: lei.a.yao@intel.com
> Cc: ferruh.yigit@intel.com
>
> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
> ---
> drivers/net/virtio/virtio_ethdev.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
> index 5833dad73..df50a571a 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -1245,6 +1245,9 @@ virtio_notify_peers(struct rte_eth_dev *dev)
> return;
>
> rxvq = dev->data->rx_queues[0];
> + if (!rxvq)
> + return;
> +
Other than that, it looks good to me:
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks,
Maxime
> rarp_mbuf = rte_net_make_rarp_packet(rxvq->mpool,
> (struct ether_addr *)hw->mac_addr);
> if (rarp_mbuf == NULL) {
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/virtio: fix add pointer checking for rxvq
2018-05-24 15:51 ` [dpdk-dev] [PATCH v2] net/virtio: " zhiyong.yang
@ 2018-05-24 12:33 ` Maxime Coquelin
0 siblings, 0 replies; 4+ messages in thread
From: Maxime Coquelin @ 2018-05-24 12:33 UTC (permalink / raw)
To: zhiyong.yang, dev; +Cc: stable, tiwei.bie, lei.a.yao, ferruh.yigit
On 05/24/2018 05:51 PM, zhiyong.yang@intel.com wrote:
> For virtio-user server mode, one use case comes across segmentation fault.
> step 1: Launch vhost side as client firstly.
> step 2: launch virtio-user side as server.
>
> The cause is: after registering virtio_interrupt_handler into
> eal-intr-thread, two threads (main thread and eal-intr-thread) have
> sync issues, so add rxvq pointer checking in function virtio_notify_peers
> to decide if the code can continue.
>
> Fixes: bd8f50a45d0f ("net/virtio-user: support server mode")
> Cc: stable@dpdk.org
> Cc: maxime.coquelin@redhat.com
> Cc: tiwei.bie@intel.com
> Cc: lei.a.yao@intel.com
> Cc: ferruh.yigit@intel.com
>
> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
>
> Change in V2:
> change title prefix from net/virtio-user to net/virtio.
>
> drivers/net/virtio/virtio_ethdev.c | 3 +++
> 1 file changed, 3 insertions(+)
Applied to dpdk-next-virtio/master.
Thanks,
Maxime
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH] net/virtio-user: fix add pointer checking for rxvq
@ 2018-05-24 13:04 zhiyong.yang
2018-05-24 7:39 ` Maxime Coquelin
2018-05-24 15:51 ` [dpdk-dev] [PATCH v2] net/virtio: " zhiyong.yang
0 siblings, 2 replies; 4+ messages in thread
From: zhiyong.yang @ 2018-05-24 13:04 UTC (permalink / raw)
To: dev
Cc: stable, maxime.coquelin, tiwei.bie, lei.a.yao, ferruh.yigit,
Zhiyong Yang
For virtio-user server mode, One use case comes across segmentation fault.
step 1: Launch vhost side as client firstly.
step 2: launch virtio-user side as server.
The cause is: after registering virtio_interrupt_handler into
eal-intr-thread, two threads (main thread and eal-intr-thread) have
sync issues, so add rxvq pointer checking in function virtio_notify_peers
to decide if the code can continue.
Fixes: bd8f50a45d0f ("net/virtio-user: support server mode")
Cc: stable@dpdk.org
Cc: maxime.coquelin@redhat.com
Cc: tiwei.bie@intel.com
Cc: lei.a.yao@intel.com
Cc: ferruh.yigit@intel.com
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
---
drivers/net/virtio/virtio_ethdev.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 5833dad73..df50a571a 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1245,6 +1245,9 @@ virtio_notify_peers(struct rte_eth_dev *dev)
return;
rxvq = dev->data->rx_queues[0];
+ if (!rxvq)
+ return;
+
rarp_mbuf = rte_net_make_rarp_packet(rxvq->mpool,
(struct ether_addr *)hw->mac_addr);
if (rarp_mbuf == NULL) {
--
2.14.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH v2] net/virtio: fix add pointer checking for rxvq
2018-05-24 13:04 [dpdk-dev] [PATCH] net/virtio-user: fix add pointer checking for rxvq zhiyong.yang
2018-05-24 7:39 ` Maxime Coquelin
@ 2018-05-24 15:51 ` zhiyong.yang
2018-05-24 12:33 ` Maxime Coquelin
1 sibling, 1 reply; 4+ messages in thread
From: zhiyong.yang @ 2018-05-24 15:51 UTC (permalink / raw)
To: dev
Cc: stable, maxime.coquelin, tiwei.bie, lei.a.yao, ferruh.yigit,
Zhiyong Yang
For virtio-user server mode, one use case comes across segmentation fault.
step 1: Launch vhost side as client firstly.
step 2: launch virtio-user side as server.
The cause is: after registering virtio_interrupt_handler into
eal-intr-thread, two threads (main thread and eal-intr-thread) have
sync issues, so add rxvq pointer checking in function virtio_notify_peers
to decide if the code can continue.
Fixes: bd8f50a45d0f ("net/virtio-user: support server mode")
Cc: stable@dpdk.org
Cc: maxime.coquelin@redhat.com
Cc: tiwei.bie@intel.com
Cc: lei.a.yao@intel.com
Cc: ferruh.yigit@intel.com
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
Change in V2:
change title prefix from net/virtio-user to net/virtio.
drivers/net/virtio/virtio_ethdev.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 5833dad73..df50a571a 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1245,6 +1245,9 @@ virtio_notify_peers(struct rte_eth_dev *dev)
return;
rxvq = dev->data->rx_queues[0];
+ if (!rxvq)
+ return;
+
rarp_mbuf = rte_net_make_rarp_packet(rxvq->mpool,
(struct ether_addr *)hw->mac_addr);
if (rarp_mbuf == NULL) {
--
2.14.3
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-05-24 12:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-24 13:04 [dpdk-dev] [PATCH] net/virtio-user: fix add pointer checking for rxvq zhiyong.yang
2018-05-24 7:39 ` Maxime Coquelin
2018-05-24 15:51 ` [dpdk-dev] [PATCH v2] net/virtio: " zhiyong.yang
2018-05-24 12:33 ` Maxime Coquelin
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).