Skip to contentSkip to conversation

virtio: fix crash if VIRTIO_NET_F_CTRL_VQ is not negotiated

PATCH In review [email protected] 4 participants 5 messages Sep 11, 2014 – Oct 1, 2014 3 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio: fix crash if VIRTIO_NET_F_CTRL_VQ is not negotiated

From: Damjan Marion <[email protected]>

If VIRTIO_NET_F_CTRL_VQ is not negotiated hw->cvq will be NULL

---
 lib/librte_pmd_virtio/virtio_rxtx.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
lib/librte_pmd_virtio/virtio_rxtx.c +4 -2
index 0b10108..8cb635e 100644
@@ -328,8 +328,10 @@ virtio_dev_cq_start(struct rte_eth_dev *dev)
 	struct virtio_hw *hw
 		= VIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
-	virtio_dev_vring_start(hw->cvq, VTNET_CQ);
-	VIRTQUEUE_DUMP((struct virtqueue *)hw->cvq);
+	if (hw->cvq) {
+		virtio_dev_vring_start(hw->cvq, VTNET_CQ);
+		VIRTQUEUE_DUMP((struct virtqueue *)hw->cvq);
+	}
 }
 
 void
Signature · 1 line
2.1.0
#2 lore raw
In reply to a message not in the archive

Hi

Quoted 36 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of [email protected]
Sent: Friday, September 12, 2014 6:25 AM
To: [email protected]
Subject: [dpdk-dev] [PATCH] virtio: fix crash if VIRTIO_NET_F_CTRL_VQ is not negotiated

From: Damjan Marion <[email protected]>

If VIRTIO_NET_F_CTRL_VQ is not negotiated hw->cvq will be NULL

---
 lib/librte_pmd_virtio/virtio_rxtx.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
lib/librte_pmd_virtio/virtio_rxtx.c +4 -3
index 0b10108..8cb635e 100644
@@ -328,8 +328,10 @@ virtio_dev_cq_start(struct rte_eth_dev *dev)
 	struct virtio_hw *hw
 		= VIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
-	virtio_dev_vring_start(hw->cvq, VTNET_CQ);
-	VIRTQUEUE_DUMP((struct virtqueue *)hw->cvq);
+	if (hw->cvq) {
+		virtio_dev_vring_start(hw->cvq, VTNET_CQ);
+		VIRTQUEUE_DUMP((struct virtqueue *)hw->cvq);
+	}
 }
 
 void
--
Quoted 1 line

2.1.0

#5 lore raw
In reply to a message not in the archive
Quoted 7 lines · Olivier MATZ

Hello,

Quoted 4 lines · On 09/12/2014 12:25 AM, [email protected] wrote:

From: Damjan Marion <[email protected]>

If VIRTIO_NET_F_CTRL_VQ is not negotiated hw->cvq will be NULL

Quoted 8 lines
Quoted 5 lines
---
 lib/librte_pmd_virtio/virtio_rxtx.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Is this going to be applied or any action pending on my side?

Thanks,

Damjan

#7 lore raw
In reply to a message not in the archive

2014-09-29 18:09, Damjan Marion:

Quoted 12 lines · Olivier MATZ
Quoted 9 lines · On 09/12/2014 12:25 AM, [email protected] wrote:
Quoted 6 lines

If VIRTIO_NET_F_CTRL_VQ is not negotiated hw->cvq will be NULL

---
 lib/librte_pmd_virtio/virtio_rxtx.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Is this going to be applied or any action pending on my side?

It's now applied.

Thanks

Signature · 1 line
Thomas