[dpdk-dev] virtio: fix crash if VIRTIO_NET_F_CTRL_VQ is not negotiated
Commit Message
From: Damjan Marion <damarion@cisco.com>
If VIRTIO_NET_F_CTRL_VQ is not negotiated hw->cvq will be NULL
Signed-off-by: Damjan Marion <damarion@cisco.com>
---
lib/librte_pmd_virtio/virtio_rxtx.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Comments
Hi
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of
> damarion@cisco.com
> Sent: Friday, September 12, 2014 6:25 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH] virtio: fix crash if VIRTIO_NET_F_CTRL_VQ is not
> negotiated
>
> From: Damjan Marion <damarion@cisco.com>
>
> If VIRTIO_NET_F_CTRL_VQ is not negotiated hw->cvq will be NULL
>
> Signed-off-by: Damjan Marion <damarion@cisco.com>
> ---
> lib/librte_pmd_virtio/virtio_rxtx.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/lib/librte_pmd_virtio/virtio_rxtx.c
> b/lib/librte_pmd_virtio/virtio_rxtx.c
> index 0b10108..8cb635e 100644
> --- a/lib/librte_pmd_virtio/virtio_rxtx.c
> +++ b/lib/librte_pmd_virtio/virtio_rxtx.c
> @@ -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
> --
> 2.1.0
Acked-by: Changchun Ouyang <Changchun.ouyang@intel.com>
Hello,
On 09/12/2014 12:25 AM, damarion@cisco.com wrote:
> From: Damjan Marion <damarion@cisco.com>
>
> If VIRTIO_NET_F_CTRL_VQ is not negotiated hw->cvq will be NULL
>
> Signed-off-by: Damjan Marion <damarion@cisco.com>
> ---
> lib/librte_pmd_virtio/virtio_rxtx.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
On 17 Sep 2014, at 09:32, Olivier MATZ <olivier.matz@6wind.com> wrote:
> Hello,
>
> On 09/12/2014 12:25 AM, damarion@cisco.com wrote:
>> From: Damjan Marion <damarion@cisco.com>
>>
>> If VIRTIO_NET_F_CTRL_VQ is not negotiated hw->cvq will be NULL
>>
>> Signed-off-by: Damjan Marion <damarion@cisco.com>
>> ---
>> lib/librte_pmd_virtio/virtio_rxtx.c | 6 ++++--
>> 1 file changed, 4 insertions(+), 2 deletions(-)
>>
>
> Acked-by: Olivier Matz <olivier.matz@6wind.com>
>
Is this going to be applied or any action pending on my side?
Thanks,
Damjan
2014-09-29 18:09, Damjan Marion:
> On 17 Sep 2014, at 09:32, Olivier MATZ <olivier.matz@6wind.com> wrote:
> > On 09/12/2014 12:25 AM, damarion@cisco.com wrote:
> > > If VIRTIO_NET_F_CTRL_VQ is not negotiated hw->cvq will be NULL
> > >
> > > Signed-off-by: Damjan Marion <damarion@cisco.com>
> > > ---
> > > lib/librte_pmd_virtio/virtio_rxtx.c | 6 ++++--
> > > 1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > Acked-by: Olivier Matz <olivier.matz@6wind.com>
>
> Is this going to be applied or any action pending on my side?
It's now applied.
Thanks
@@ -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